# CEGUIFalWidgetLookManager.h

    00001 /************************************************************************
    00002     filename:   CEGUIFalWidgetLookManager.h
    00003     created:    Mon Jun 13 2005
    00004     author:     Paul D Turner <paul@cegui.org.uk>
    00005 *************************************************************************/
    00006 /*************************************************************************
    00007     Crazy Eddie's GUI System (http://www.cegui.org.uk)
    00008     Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
    00009
    00010     This library is free software; you can redistribute it and/or
    00011     modify it under the terms of the GNU Lesser General Public
    00012     License as published by the Free Software Foundation; either
    00013     version 2.1 of the License, or (at your option) any later version.
    00014
    00015     This library is distributed in the hope that it will be useful,
    00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
    00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00018     Lesser General Public License for more details.
    00019
    00020     You should have received a copy of the GNU Lesser General Public
    00021     License along with this library; if not, write to the Free Software
    00022     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    00023 *************************************************************************/
    00024 #ifndef _CEGUIFalWidgetLookManager_h_
    00025 #define _CEGUIFalWidgetLookManager_h_
    00026
    00027 #include "CEGUISingleton.h"
    00028 #include "CEGUIString.h"
    00029 #include "CEGUIExceptions.h"
    00030 #include "falagard/CEGUIFalWidgetLookFeel.h"
    00031 #include <map>
    00032
    00033 #if defined(_MSC_VER)
    00034 #       pragma warning(push)
    00035 #       pragma warning(disable : 4251)
    00036 #       pragma warning(disable : 4275)
    00037 #endif
    00038
    00039 // Start of CEGUI namespace section
    00040 namespace CEGUI
    00041 {
    00046     class CEGUIEXPORT WidgetLookManager : public Singleton<WidgetLookManager>
    00047     {
    00048     public:
    00053         WidgetLookManager();
    00054
    00059         ~WidgetLookManager();
    00060
    00068               static    WidgetLookManager&      getSingleton(void);
    00069
    00070
    00078               static    WidgetLookManager*      getSingletonPtr(void);
    00079
    00080
    00102         void parseLookNFeelSpecification(const String& filename, const String& resourceGroup = "");
    00103
    00104
    00116         bool isWidgetLookAvailable(const String& widget) const;
    00117
    00118
    00131         const WidgetLookFeel& getWidgetLook(const String& widget) const;
    00132
    00133
    00145         void eraseWidgetLook(const String& widget);
    00146
    00147
    00164         void addWidgetLook(const WidgetLookFeel& look);
    00165
    00170         void writeFalagardXMLHeadToStream(OutStream& out_stream) const;
    00171
    00179         void writeFalagardXMLTailToStream(OutStream& out_stream) const;
    00180
    00192         void writeWidgetLookToStream(const String& name, OutStream& out_stream) const;
    00193
    00210         void writeWidgetLookSeriesToStream(const String& prefix, OutStream& out_stream) const;
    00211
    00212
    00213     private:
    00214         static const String FalagardSchemaName;
    00215
    00216         typedef std::map<String, WidgetLookFeel> WidgetLookList;
    00217         WidgetLookList  d_widgetLooks;
    00218     };
    00219
    00220 } // End of  CEGUI namespace section
    00221
    00222
    00223 #if defined(_MSC_VER)
    00224 #       pragma warning(pop)
    00225 #endif
    00226
    00227 #endif  // end of guard _CEGUIFalWidgetLookManager_h_