CEGUIFalWidgetLookFeel.h

00001 /***********************************************************************
00002     filename:   CEGUIFalWidgetLookFeel.h
00003     created:    Mon Jun 13 2005
00004     author:     Paul D Turner <paul@cegui.org.uk>
00005 *************************************************************************/
00006 /***************************************************************************
00007  *   Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
00008  *
00009  *   Permission is hereby granted, free of charge, to any person obtaining
00010  *   a copy of this software and associated documentation files (the
00011  *   "Software"), to deal in the Software without restriction, including
00012  *   without limitation the rights to use, copy, modify, merge, publish,
00013  *   distribute, sublicense, and/or sell copies of the Software, and to
00014  *   permit persons to whom the Software is furnished to do so, subject to
00015  *   the following conditions:
00016  *
00017  *   The above copyright notice and this permission notice shall be
00018  *   included in all copies or substantial portions of the Software.
00019  *
00020  *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00021  *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00022  *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00023  *   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
00024  *   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
00025  *   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
00026  *   OTHER DEALINGS IN THE SOFTWARE.
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 // Start of CEGUI namespace section
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 
00353     private:
00354         typedef std::map<String, StateImagery, String::FastLessCompare>    StateList;
00355         typedef std::map<String, ImagerySection, String::FastLessCompare>  ImageryList;
00356         typedef std::map<String, NamedArea, String::FastLessCompare>       NamedAreaList;
00357         typedef std::vector<WidgetComponent>      WidgetList;
00358         typedef std::vector<PropertyInitialiser>  PropertyList;
00359         typedef std::vector<PropertyDefinition>   PropertyDefinitionList;
00360         typedef std::vector<PropertyLinkDefinition> PropertyLinkDefinitionList;
00361 
00362         CEGUI::String   d_lookName;         
00363         ImageryList     d_imagerySections;  
00364         WidgetList      d_childWidgets;     
00365         StateList       d_stateImagery;     
00366         PropertyList    d_properties;       
00367         NamedAreaList   d_namedAreas;       
00368         mutable PropertyDefinitionList  d_propertyDefinitions;  
00369         mutable PropertyLinkDefinitionList d_propertyLinkDefinitions;  
00370     };
00371 
00372 
00373 } // End of  CEGUI namespace section
00374 
00375 
00376 #if defined(_MSC_VER)
00377 #       pragma warning(pop)
00378 #endif
00379 
00380 #endif  // end of guard _CEGUIFalWidgetLookFeel_h_

Generated on Sun Nov 5 14:35:28 2006 for Crazy Eddies GUI System by  doxygen 1.4.7