Crazy Eddie's GUI System  0.8.5
PropertyDefinitionBase.h
1 /***********************************************************************
2  created: Sat Jun 16 2012
3  author: Paul D Turner <paul@cegui.org.uk>
4 *************************************************************************/
5 /***************************************************************************
6  * Copyright (C) 2004 - 2012 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 _CEGUIPropertyDefinitionBase_h_
28 #define _CEGUIPropertyDefinitionBase_h_
29 
30 #include "CEGUI/String.h"
31 
32 namespace CEGUI
33 {
34 class XMLSerializer;
35 
42 class CEGUIEXPORT PropertyDefinitionBase
43 {
44 public:
45  PropertyDefinitionBase(const String& name, const String& help,
46  const String& initialValue,
47  bool redrawOnWrite, bool layoutOnWrite,
48  const String& fireEvent, const String& eventNamespace);
49 
50  virtual ~PropertyDefinitionBase();
51 
52  const String& getPropertyName() const;
53  void setPropertyName(const String& name);
54 
55  const String& getInitialValue() const;
56  void setInitialValue(const String& value);
57 
58  const String& getHelpString() const;
59  void setHelpString(const String& help);
60 
61  bool isRedrawOnWrite() const;
62  void setRedrawOnWrite(bool value);
63 
64  bool isLayoutOnWrite() const;
65  void setLayoutOnWrite(bool value);
66 
67  const String& getEventFiredOnWrite() const;
68  void setEventFiredOnWrite(const String& eventName);
69 
70  const String& getEventNamespace() const;
71  void setEventNamespace(const String& eventNamespace);
72 
81  virtual void writeDefinitionXMLToStream(XMLSerializer& xml_stream) const;
82 
85 
86 protected:
87 
97  virtual void writeDefinitionXMLElementType(XMLSerializer& xml_stream) const = 0;
98 
109  virtual void writeDefinitionXMLAttributes(XMLSerializer& xml_stream) const;
110 
111  String d_propertyName;
112  String d_initialValue;
113  String d_helpString;
114  bool d_writeCausesRedraw;
115  bool d_writeCausesLayout;
116  String d_eventFiredOnWrite;
117  String d_eventNamespace;
118 };
119 
120 }
121 
122 #endif
123 
common base class used for types representing a new property to be available on all widgets that use ...
Definition: PropertyDefinitionBase.h:42
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
static const String UserStringNameSuffix
The PropertyDefinition's user string name suffix, which is appended to each #d_userStringName.
Definition: PropertyDefinitionBase.h:84
Class used to create XML Document.
Definition: XMLSerializer.h:85
String class used within the GUI system.
Definition: String.h:62