Crazy Eddies GUI System  0.6.0
CEGUISchemeManager.h
1 /***********************************************************************
2  filename: CEGUISchemeManager.h
3  created: 21/2/2004
4  author: Paul D Turner
5 
6  purpose: Defines the interface to the SchemeManager class
7 *************************************************************************/
8 /***************************************************************************
9  * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
10  *
11  * Permission is hereby granted, free of charge, to any person obtaining
12  * a copy of this software and associated documentation files (the
13  * "Software"), to deal in the Software without restriction, including
14  * without limitation the rights to use, copy, modify, merge, publish,
15  * distribute, sublicense, and/or sell copies of the Software, and to
16  * permit persons to whom the Software is furnished to do so, subject to
17  * the following conditions:
18  *
19  * The above copyright notice and this permission notice shall be
20  * included in all copies or substantial portions of the Software.
21  *
22  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
25  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
26  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
27  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28  * OTHER DEALINGS IN THE SOFTWARE.
29  ***************************************************************************/
30 #ifndef _CEGUISchemeManager_h_
31 #define _CEGUISchemeManager_h_
32 
33 #include "CEGUIBase.h"
34 #include "CEGUIString.h"
35 #include "CEGUISingleton.h"
36 #include "CEGUIIteratorBase.h"
37 #include <map>
38 
39 
40 #if defined(_MSC_VER)
41 # pragma warning(push)
42 # pragma warning(disable : 4275)
43 # pragma warning(disable : 4251)
44 #endif
45 
46 
47 // Start of CEGUI namespace section
48 namespace CEGUI
49 {
54 class CEGUIEXPORT SchemeManager : public Singleton<SchemeManager>
55 {
56 public:
61  SchemeManager(void);
62 
63 
68  ~SchemeManager(void);
69 
70 
86  Scheme* loadScheme(const String& scheme_filename, const String& resourceGroup = "");
87 
88 
97  void unloadScheme(const String& scheme_name);
98 
99 
110  bool isSchemePresent(const String& scheme_name) const {return (d_schemes.find(scheme_name) != d_schemes.end());}
111 
112 
125  Scheme* getScheme(const String& name) const;
126 
127 
140  void unloadAllSchemes(void);
141 
142 private:
143  /*************************************************************************
144  Implementation Data
145  *************************************************************************/
146  typedef std::map<String, Scheme*, String::FastLessCompare> SchemeRegistry;
147  SchemeRegistry d_schemes;
148 
149 
150 public:
151  /*************************************************************************
152  Iterator stuff
153  *************************************************************************/
154  typedef ConstBaseIterator<SchemeRegistry> SchemeIterator;
155 
160  SchemeIterator getIterator(void) const;
161 };
162 
163 } // End of CEGUI namespace section
164 
165 #if defined(_MSC_VER)
166 # pragma warning(pop)
167 #endif
168 
169 #endif // end of guard _CEGUISchemeManager_h_