00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _CEGUIFalWidgetLookFeel_h_
00029 #define _CEGUIFalWidgetLookFeel_h_
00030
00031 #include "falagard/CEGUIFalStateImagery.h"
00032 #include "falagard/CEGUIFalWidgetComponent.h"
00033 #include "falagard/CEGUIFalImagerySection.h"
00034 #include "falagard/CEGUIFalPropertyInitialiser.h"
00035 #include "falagard/CEGUIFalPropertyDefinition.h"
00036 #include "falagard/CEGUIFalPropertyLinkDefinition.h"
00037 #include "falagard/CEGUIFalNamedArea.h"
00038 #include <map>
00039
00040 #if defined(_MSC_VER)
00041 # pragma warning(push)
00042 # pragma warning(disable : 4251)
00043 #endif
00044
00045
00046
00047 namespace CEGUI
00048 {
00053 class CEGUIEXPORT WidgetLookFeel
00054 {
00055 public:
00056 WidgetLookFeel(const String& name);
00057 WidgetLookFeel() {}
00058
00066 const StateImagery& getStateImagery(const CEGUI::String& state) const;
00067
00075 const ImagerySection& getImagerySection(const CEGUI::String& section) const;
00076
00084 const String& getName() const;
00085
00095 void addImagerySection(const ImagerySection& section);
00096
00106 void addWidgetComponent(const WidgetComponent& widget);
00107
00117 void addStateSpecification(const StateImagery& state);
00118
00128 void addPropertyInitialiser(const PropertyInitialiser& initialiser);
00129
00137 void clearImagerySections();
00138
00146 void clearWidgetComponents();
00147
00155 void clearStateSpecifications();
00156
00164 void clearPropertyInitialisers();
00165
00177 void initialiseWidget(Window& widget) const;
00178
00189 void cleanUpWidget(Window& widget) const;
00190
00202 bool isStateImageryPresent(const String& state) const;
00203
00214 void addNamedArea(const NamedArea& area);
00215
00223 void clearNamedAreas();
00224
00235 const NamedArea& getNamedArea(const String& name) const;
00236
00248 bool isNamedAreaDefined(const String& name) const;
00249
00260 void layoutChildWidgets(const Window& owner) const;
00261
00272 void addPropertyDefinition(const PropertyDefinition& propdef);
00273
00284 void addPropertyLinkDefinition(const PropertyLinkDefinition& propdef);
00285
00293 void clearPropertyDefinitions();
00294
00302 void clearPropertyLinkDefinitions();
00303
00315 void writeXMLToStream(XMLSerializer& xml_stream) const;
00316
00330 void renameChildren(const Window& widget, const String& newBaseName) const;
00331
00341 const PropertyInitialiser* findPropertyInitialiser(const String& propertyName) const;
00342
00351 const WidgetComponent* findWidgetComponent(const String& nameSuffix) const;
00352
00354 typedef std::vector<PropertyInitialiser> PropertyList;
00355 typedef std::vector<PropertyDefinition> PropertyDefinitionList;
00356 typedef std::vector<PropertyLinkDefinition> PropertyLinkDefinitionList;
00357
00362 const PropertyDefinitionList& getPropertyDefinitions() const { return d_propertyDefinitions; }
00363
00368 const PropertyLinkDefinitionList& getPropertyLinkDefinitions() const { return d_propertyLinkDefinitions; }
00369
00374 const PropertyList& getProperties() const { return d_properties; }
00375
00376 private:
00377 typedef std::map<String, StateImagery, String::FastLessCompare> StateList;
00378 typedef std::map<String, ImagerySection, String::FastLessCompare> ImageryList;
00379 typedef std::map<String, NamedArea, String::FastLessCompare> NamedAreaList;
00380 typedef std::vector<WidgetComponent> WidgetList;
00381
00382 CEGUI::String d_lookName;
00383 ImageryList d_imagerySections;
00384 WidgetList d_childWidgets;
00385 StateList d_stateImagery;
00386 PropertyList d_properties;
00387 NamedAreaList d_namedAreas;
00388 mutable PropertyDefinitionList d_propertyDefinitions;
00389 mutable PropertyLinkDefinitionList d_propertyLinkDefinitions;
00390 };
00391
00392
00393 }
00394
00395
00396 #if defined(_MSC_VER)
00397 # pragma warning(pop)
00398 #endif
00399
00400 #endif // end of guard _CEGUIFalWidgetLookFeel_h_