27 #ifndef _CEGUIFormattingSetting_h_
28 #define _CEGUIFormattingSetting_h_
30 #include "CEGUI/Window.h"
31 #include "CEGUI/falagard/XMLEnumHelper.h"
37 class FormattingSetting
42 d_value(FalagardXMLHelper<T>::fromString(
""))
46 FormattingSetting(
const String& property_name) :
47 d_value(FalagardXMLHelper<T>::fromString(
"")),
48 d_propertySource(property_name)
52 FormattingSetting(T val) :
57 T
get(
const Window& wnd)
const
59 if (d_propertySource.
empty())
62 return FalagardXMLHelper<T>::fromString(
63 wnd.getProperty(d_propertySource));
70 d_propertySource.
clear();
80 const String& getPropertySource()
const
82 return d_propertySource;
86 void setPropertySource(
const String& property_name)
88 d_propertySource = property_name;
92 bool isFetchedFromProperty()
const
94 return !d_propertySource.
empty();
98 void writeXMLToStream(XMLSerializer& xml_stream)
const
100 writeXMLTagToStream(xml_stream);
101 writeXMLAttributesToStream(xml_stream);
102 xml_stream.closeTag();
106 virtual void writeXMLTagToStream(XMLSerializer& )
const
112 virtual void writeXMLAttributesToStream(XMLSerializer& )
const
118 bool operator==(
const FormattingSetting<T>& rhs)
const
120 return d_value == rhs.d_value &&
121 d_propertySource == rhs.d_propertySource;
125 bool operator!=(
const FormattingSetting<T>& rhs)
const
127 return !operator==(rhs);
132 String d_propertySource;
135 template<>
void CEGUIEXPORT FormattingSetting<VerticalFormatting>::writeXMLTagToStream(
136 XMLSerializer& xml_stream)
const;
137 template<>
void CEGUIEXPORT FormattingSetting<VerticalFormatting>::writeXMLAttributesToStream(
138 XMLSerializer& xml_stream)
const;
139 template<>
void CEGUIEXPORT FormattingSetting<HorizontalFormatting>::writeXMLTagToStream(
140 XMLSerializer& xml_stream)
const;
141 template<>
void CEGUIEXPORT FormattingSetting<HorizontalFormatting>::writeXMLAttributesToStream(
142 XMLSerializer& xml_stream)
const;
143 template<>
void CEGUIEXPORT FormattingSetting<VerticalTextFormatting>::writeXMLTagToStream(
144 XMLSerializer& xml_stream)
const;
145 template<>
void CEGUIEXPORT FormattingSetting<VerticalTextFormatting>::writeXMLAttributesToStream(
146 XMLSerializer& xml_stream)
const;
147 template<>
void CEGUIEXPORT FormattingSetting<HorizontalTextFormatting>::writeXMLTagToStream(
148 XMLSerializer& xml_stream)
const;
149 template<>
void CEGUIEXPORT FormattingSetting<HorizontalTextFormatting>::writeXMLAttributesToStream(
150 XMLSerializer& xml_stream)
const;
Main namespace for Crazy Eddie's GUI Library.
Definition: cegui/include/CEGUI/Affector.h:42
bool empty(void) const
Returns true if the String is empty.
Definition: cegui/include/CEGUI/String.h:633
void clear(void)
Removes all data from the String.
Definition: cegui/include/CEGUI/String.h:2348