Crazy Eddie's GUI System  0.8.4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
WidgetLookManager.h
1 /***********************************************************************
2  created: Mon Jun 13 2005
3  author: Paul D Turner <paul@cegui.org.uk>
4 *************************************************************************/
5 /***************************************************************************
6  * Copyright (C) 2004 - 2010 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 _CEGUIFalWidgetLookManager_h_
28 #define _CEGUIFalWidgetLookManager_h_
29 
30 #include "../Singleton.h"
31 #include "../String.h"
32 #include "../Exceptions.h"
33 #include "./WidgetLookFeel.h"
34 #include <map>
35 
36 #if defined(_MSC_VER)
37 # pragma warning(push)
38 # pragma warning(disable : 4251)
39 # pragma warning(disable : 4275)
40 #endif
41 
42 // Start of CEGUI namespace section
43 namespace CEGUI
44 {
49  class CEGUIEXPORT WidgetLookManager :
50  public Singleton<WidgetLookManager>,
51  public AllocatedObject<WidgetLookManager>
52  {
53  public:
59 
65 
73  static WidgetLookManager& getSingleton(void);
74 
75 
83  static WidgetLookManager* getSingletonPtr(void);
84 
85 
87  typedef std::set<String, StringFastLessCompare
88  CEGUI_SET_ALLOC(String)> WidgetLookNameSet;
89 
111  void parseLookNFeelSpecificationFromContainer(const RawDataContainer& source);
112 
116  void parseLookNFeelSpecificationFromFile(const String& filename, const String& resourceGroup = "");
117 
121  void parseLookNFeelSpecificationFromString(const String& source);
122 
134  bool isWidgetLookAvailable(const String& widget) const;
135 
136 
149  const WidgetLookFeel& getWidgetLook(const String& widget) const;
150 
151 
163  void eraseWidgetLook(const String& widget);
164 
166  void eraseAllWidgetLooks();
167 
184  void addWidgetLook(const WidgetLookFeel& look);
185 
186 
198  void writeWidgetLookToStream(const String& widgetLookName, OutStream& out_stream) const;
199 
211  String getWidgetLookAsString(const String& widgetLookName) const;
212 
224  String getWidgetLookSetAsString(const WidgetLookNameSet& widgetLookNameSet) const;
225 
242  void writeWidgetLookSeriesToStream(const String& prefix, OutStream& out_stream) const;
243 
258  void writeWidgetLookSetToStream(const WidgetLookNameSet& widgetLookNameSet, OutStream& out_stream) const;
259 
268  static const String& getDefaultResourceGroup()
269  { return d_defaultResourceGroup; }
270 
281  static void setDefaultResourceGroup(const String& resourceGroup)
282  { d_defaultResourceGroup = resourceGroup; }
283 
284 
285  private:
286  static const String FalagardSchemaName;
287 
288  typedef std::map<String, WidgetLookFeel, StringFastLessCompare> WidgetLookList;
289  WidgetLookList d_widgetLooks;
290 
291  static String d_defaultResourceGroup;
292  public:
293  typedef ConstMapIterator<WidgetLookList> WidgetLookIterator;
294  WidgetLookIterator getWidgetLookIterator() const;
295 
296  };
297 
298 } // End of CEGUI namespace section
299 
300 
301 #if defined(_MSC_VER)
302 # pragma warning(pop)
303 #endif
304 
305 #endif // end of guard _CEGUIFalWidgetLookManager_h_