Crazy Eddie's GUI System  0.8.7
RenderedStringComponent.h
1 /***********************************************************************
2  created: 24/05/2009
3  author: Paul Turner
4  *************************************************************************/
5 /***************************************************************************
6  * Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team
7  *
8  * Permission is hereby granted, free of charge, to any person obtaining
9  * a copy of this software and associated documentation files (the
10  * "Software"), to deal in the Software without restriction, including
11  * without limitation the rights to use, copy, modify, merge, publish,
12  * distribute, sublicense, and/or sell copies of the Software, and to
13  * permit persons to whom the Software is furnished to do so, subject to
14  * the following conditions:
15  *
16  * The above copyright notice and this permission notice shall be
17  * included in all copies or substantial portions of the Software.
18  *
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25  * OTHER DEALINGS IN THE SOFTWARE.
26  ***************************************************************************/
27 #ifndef _CEGUIRenderedStringComponent_h_
28 #define _CEGUIRenderedStringComponent_h_
29 
30 #include "CEGUI/Size.h"
31 #include "CEGUI/Rect.h"
32 #include "CEGUI/falagard/Enums.h"
33 
34 #if defined(_MSC_VER)
35 # pragma warning(push)
36 # pragma warning(disable : 4251)
37 #endif
38 
39 // Start of CEGUI namespace section
40 namespace CEGUI
41 {
47 class CEGUIEXPORT RenderedStringComponent :
48  public AllocatedObject<RenderedStringComponent>
49 {
50 public:
52  virtual ~RenderedStringComponent();
53 
55  void setVerticalFormatting(VerticalFormatting fmt);
57  VerticalFormatting getVerticalFormatting() const;
59  void setPadding(const Rectf& padding);
61  void setLeftPadding(const float padding);
63  void setRightPadding(const float padding);
65  void setTopPadding(const float padding);
67  void setBottomPadding(const float padding);
69  const Rectf& getPadding() const;
71  float getLeftPadding() const;
73  float getRightPadding() const;
75  float getTopPadding() const;
77  float getBottomPadding() const;
79  void setAspectLock(const bool setting);
81  bool getAspectLock() const;
82 
84  virtual void draw(const Window* ref_wnd, GeometryBuffer& buffer,
85  const Vector2f& position, const ColourRect* mod_colours,
86  const Rectf* clip_rect, const float vertical_space,
87  const float space_extra) const = 0;
88 
90  virtual Sizef getPixelSize(const Window* ref_wnd) const = 0;
91 
93  virtual bool canSplit() const = 0;
94 
105  virtual RenderedStringComponent* split(const Window* ref_wnd,
106  float split_point,
107  bool first_component) = 0;
108 
110  virtual RenderedStringComponent* clone() const = 0;
111 
113  virtual size_t getSpaceCount() const = 0;
114 
116  virtual void setSelection(const Window* ref_wnd,
117  const float start, const float end) = 0;
118 
119 protected:
122 
131 };
132 
133 } // End of CEGUI namespace section
134 
135 #if defined(_MSC_VER)
136 # pragma warning(pop)
137 #endif
138 
139 #endif // end of guard _CEGUIRenderedStringComponent_h_
Definition: MemoryAllocatedObject.h:109
VerticalFormatting
Enumeration of possible values to indicate the vertical formatting to be used for an image component...
Definition: Enums.h:58
Interface for Image.
Definition: Image.h:158
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
Abstract class defining the interface for objects that buffer geometry for later rendering.
Definition: GeometryBuffer.h:42
Class that holds details of colours for the four corners of a rectangle.
Definition: ColourRect.h:43
Base class representing a part of a rendered string. The 'part' represented may be a text string...
Definition: RenderedStringComponent.h:47
VerticalFormatting d_verticalFormatting
Vertical formatting to be used for this component.
Definition: RenderedStringComponent.h:126
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition: Window.h:149
const Image * d_selectionImage
Image to draw for selection.
Definition: RenderedStringComponent.h:130
Rectf d_padding
Rect object holding the padding values for this component.
Definition: RenderedStringComponent.h:124
bool d_aspectLock
true if the aspect ratio should be maintained where possible.
Definition: RenderedStringComponent.h:128