Crazy Eddie's GUI System  0.8.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
SectionSpecification.h
1 /***********************************************************************
2  filename: CEGUISectionSpecification.h
3  created: Mon Jun 13 2005
4  author: Paul D Turner <paul@cegui.org.uk>
5 *************************************************************************/
6 /***************************************************************************
7  * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
8  *
9  * Permission is hereby granted, free of charge, to any person obtaining
10  * a copy of this software and associated documentation files (the
11  * "Software"), to deal in the Software without restriction, including
12  * without limitation the rights to use, copy, modify, merge, publish,
13  * distribute, sublicense, and/or sell copies of the Software, and to
14  * permit persons to whom the Software is furnished to do so, subject to
15  * the following conditions:
16  *
17  * The above copyright notice and this permission notice shall be
18  * included in all copies or substantial portions of the Software.
19  *
20  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26  * OTHER DEALINGS IN THE SOFTWARE.
27  ***************************************************************************/
28 #ifndef _CEGUIFalSectionSpecification_h_
29 #define _CEGUIFalSectionSpecification_h_
30 
31 #include "../Window.h"
32 #include "../ColourRect.h"
33 
34 
35 // Start of CEGUI namespace section
36 namespace CEGUI
37 {
38  // forward refs
39  class WidgetLookFeel;
40 
48  class CEGUIEXPORT SectionSpecification :
49  public AllocatedObject<SectionSpecification>
50  {
51  public:
53 
82  SectionSpecification(const String& owner, const String& sectionName,
83  const String& controlPropertySource,
84  const String& controlPropertyValue,
85  const String& controlPropertyWidget);
86 
118  SectionSpecification(const String& owner, const String& sectionName,
119  const String& controlPropertySource,
120  const String& controlPropertyValue,
121  const String& controlPropertyWidget,
122  const ColourRect& cols);
123 
134  void render(Window& srcWindow, const ColourRect* modcols = 0, const Rectf* clipper = 0, bool clipToDisplay = false) const;
135 
149  void render(Window& srcWindow, const Rectf& baseRect, const ColourRect* modcols = 0, const Rectf* clipper = 0, bool clipToDisplay = false) const;
150 
158  const String& getOwnerWidgetLookFeel() const;
159 
170  void setOwnerWidgetLookFeel(const String& owner);
171 
179  const String& getSectionName() const;
190  void setSectionName(const String& name);
191 
200  const ColourRect& getOverrideColours() const;
201 
212  void setOverrideColours(const ColourRect& cols);
213 
222  bool isUsingOverrideColours() const;
223 
235  void setUsingOverrideColours(bool setting = true);
243  const String& getOverrideColoursPropertySource() const;
244 
255  void setOverrideColoursPropertySource(const String& property);
256 
265  const String& getRenderControlPropertySource() const;
266 
278  void setRenderControlPropertySource(const String& property);
279 
291  const String& getRenderControlValue() const;
292 
304  void setRenderControlValue(const String& value);
305 
320  const String& getRenderControlWidget() const;
321 
336  void setRenderControlWidget(const String& widget);
337 
349  void writeXMLToStream(XMLSerializer& xml_stream) const;
350 
351  protected:
362  void initColourRectForOverride(const Window& wnd, ColourRect& cr) const;
363 
367  bool shouldBeDrawn(const Window& wnd) const;
368 
369  private:
370  String d_owner;
371  String d_sectionName;
372  ColourRect d_coloursOverride;
373  bool d_usingColourOverride;
374  String d_colourPropertyName;
375 
376  String d_renderControlProperty;
378  String d_renderControlValue;
380  String d_renderControlWidget;
381  };
382 
383 
384 } // End of CEGUI namespace section
385 
386 
387 #endif // end of guard _CEGUIFalSectionSpecification_h_