Crazy Eddie's GUI System  0.8.4
WidgetLookManager.h
00001 /***********************************************************************
00002     created:    Mon Jun 13 2005
00003     author:     Paul D Turner <paul@cegui.org.uk>
00004 *************************************************************************/
00005 /***************************************************************************
00006  *   Copyright (C) 2004 - 2010 Paul D Turner & The CEGUI Development Team
00007  *
00008  *   Permission is hereby granted, free of charge, to any person obtaining
00009  *   a copy of this software and associated documentation files (the
00010  *   "Software"), to deal in the Software without restriction, including
00011  *   without limitation the rights to use, copy, modify, merge, publish,
00012  *   distribute, sublicense, and/or sell copies of the Software, and to
00013  *   permit persons to whom the Software is furnished to do so, subject to
00014  *   the following conditions:
00015  *
00016  *   The above copyright notice and this permission notice shall be
00017  *   included in all copies or substantial portions of the Software.
00018  *
00019  *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00020  *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00021  *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00022  *   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
00023  *   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
00024  *   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
00025  *   OTHER DEALINGS IN THE SOFTWARE.
00026  ***************************************************************************/
00027 #ifndef _CEGUIFalWidgetLookManager_h_
00028 #define _CEGUIFalWidgetLookManager_h_
00029 
00030 #include "../Singleton.h"
00031 #include "../String.h"
00032 #include "../Exceptions.h"
00033 #include "./WidgetLookFeel.h"
00034 #include <map>
00035 
00036 #if defined(_MSC_VER)
00037 #       pragma warning(push)
00038 #       pragma warning(disable : 4251)
00039 #       pragma warning(disable : 4275)
00040 #endif
00041 
00042 // Start of CEGUI namespace section
00043 namespace CEGUI
00044 {
00049     class CEGUIEXPORT WidgetLookManager :
00050         public Singleton<WidgetLookManager>,
00051         public AllocatedObject<WidgetLookManager>
00052     {
00053     public:
00058         WidgetLookManager();
00059 
00064         ~WidgetLookManager();
00065 
00073               static    WidgetLookManager&      getSingleton(void);
00074 
00075 
00083               static    WidgetLookManager*      getSingletonPtr(void);
00084 
00085 
00087         typedef std::set<String, StringFastLessCompare
00088           CEGUI_SET_ALLOC(String)> WidgetLookNameSet;
00089 
00111         void parseLookNFeelSpecificationFromContainer(const RawDataContainer& source);
00112         
00116         void parseLookNFeelSpecificationFromFile(const String& filename, const String& resourceGroup = "");
00117         
00121         void parseLookNFeelSpecificationFromString(const String& source);
00122 
00134         bool isWidgetLookAvailable(const String& widget) const;
00135 
00136 
00149         const WidgetLookFeel& getWidgetLook(const String& widget) const;
00150 
00151 
00163         void eraseWidgetLook(const String& widget);
00164 
00166         void eraseAllWidgetLooks();
00167 
00184         void addWidgetLook(const WidgetLookFeel& look);
00185 
00186 
00198         void writeWidgetLookToStream(const String& widgetLookName, OutStream& out_stream) const;
00199 
00211         String getWidgetLookAsString(const String& widgetLookName) const;
00212  
00224         String getWidgetLookSetAsString(const WidgetLookNameSet& widgetLookNameSet) const;
00225 
00242         void writeWidgetLookSeriesToStream(const String& prefix, OutStream& out_stream) const;
00243 
00258         void writeWidgetLookSetToStream(const WidgetLookNameSet& widgetLookNameSet, OutStream& out_stream) const;
00259 
00268         static const String& getDefaultResourceGroup()
00269             { return d_defaultResourceGroup; }
00270 
00281         static void setDefaultResourceGroup(const String& resourceGroup)
00282             { d_defaultResourceGroup = resourceGroup; }
00283 
00284 
00285     private:
00286         static const String FalagardSchemaName;     
00287 
00288         typedef std::map<String, WidgetLookFeel, StringFastLessCompare> WidgetLookList;
00289         WidgetLookList  d_widgetLooks;
00290 
00291         static String d_defaultResourceGroup;   
00292     public:
00293         typedef ConstMapIterator<WidgetLookList> WidgetLookIterator;
00294         WidgetLookIterator getWidgetLookIterator() const;
00295 
00296     };
00297 
00298 } // End of  CEGUI namespace section
00299 
00300 
00301 #if defined(_MSC_VER)
00302 #       pragma warning(pop)
00303 #endif
00304 
00305 #endif  // end of guard _CEGUIFalWidgetLookManager_h_
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends