Crazy Eddie's GUI System
0.8.4
|
00001 /*********************************************************************** 00002 created: 24/05/2009 00003 author: Paul Turner 00004 *************************************************************************/ 00005 /*************************************************************************** 00006 * Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team 00007 * 00008 * Permission is hereby granted, free of charge, to any person obtaining 00009 * a copy of this software and associated documentation files (the 00010 * "Software"), to deal in the Software without restriction, including 00011 * without limitation the rights to use, copy, modify, merge, publish, 00012 * distribute, sublicense, and/or sell copies of the Software, and to 00013 * permit persons to whom the Software is furnished to do so, subject to 00014 * the following conditions: 00015 * 00016 * The above copyright notice and this permission notice shall be 00017 * included in all copies or substantial portions of the Software. 00018 * 00019 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00020 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00021 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 00022 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 00023 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 00024 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 00025 * OTHER DEALINGS IN THE SOFTWARE. 00026 ***************************************************************************/ 00027 #ifndef _CEGUIRenderedStringComponent_h_ 00028 #define _CEGUIRenderedStringComponent_h_ 00029 00030 #include "CEGUI/Size.h" 00031 #include "CEGUI/Rect.h" 00032 #include "CEGUI/falagard/Enums.h" 00033 00034 #if defined(_MSC_VER) 00035 # pragma warning(push) 00036 # pragma warning(disable : 4251) 00037 #endif 00038 00039 // Start of CEGUI namespace section 00040 namespace CEGUI 00041 { 00047 class CEGUIEXPORT RenderedStringComponent : 00048 public AllocatedObject<RenderedStringComponent> 00049 { 00050 public: 00052 virtual ~RenderedStringComponent(); 00053 00055 void setVerticalFormatting(VerticalFormatting fmt); 00057 VerticalFormatting getVerticalFormatting() const; 00059 void setPadding(const Rectf& padding); 00061 void setLeftPadding(const float padding); 00063 void setRightPadding(const float padding); 00065 void setTopPadding(const float padding); 00067 void setBottomPadding(const float padding); 00069 const Rectf& getPadding() const; 00071 float getLeftPadding() const; 00073 float getRightPadding() const; 00075 float getTopPadding() const; 00077 float getBottomPadding() const; 00079 void setAspectLock(const bool setting); 00081 bool getAspectLock() const; 00082 00084 virtual void draw(const Window* ref_wnd, GeometryBuffer& buffer, 00085 const Vector2f& position, const ColourRect* mod_colours, 00086 const Rectf* clip_rect, const float vertical_space, 00087 const float space_extra) const = 0; 00088 00090 virtual Sizef getPixelSize(const Window* ref_wnd) const = 0; 00091 00093 virtual bool canSplit() const = 0; 00094 00105 virtual RenderedStringComponent* split(const Window* ref_wnd, 00106 float split_point, 00107 bool first_component) = 0; 00108 00110 virtual RenderedStringComponent* clone() const = 0; 00111 00113 virtual size_t getSpaceCount() const = 0; 00114 00116 virtual void setSelection(const Window* ref_wnd, 00117 const float start, const float end) = 0; 00118 00119 protected: 00121 RenderedStringComponent(); 00122 00124 Rectf d_padding; 00126 VerticalFormatting d_verticalFormatting; 00128 bool d_aspectLock; 00130 const Image* d_selectionImage; 00131 }; 00132 00133 } // End of CEGUI namespace section 00134 00135 #if defined(_MSC_VER) 00136 # pragma warning(pop) 00137 #endif 00138 00139 #endif // end of guard _CEGUIRenderedStringComponent_h_