CEGUIFontManager.h

00001 /************************************************************************
00002         filename:       CEGUIFontManager.h
00003         created:        21/2/2004
00004         author:         Paul D Turner
00005         
00006         purpose:        Defines interface for the FontManager class
00007 *************************************************************************/
00008 /*************************************************************************
00009     Crazy Eddie's GUI System (http://www.cegui.org.uk)
00010     Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
00011 
00012     This library is free software; you can redistribute it and/or
00013     modify it under the terms of the GNU Lesser General Public
00014     License as published by the Free Software Foundation; either
00015     version 2.1 of the License, or (at your option) any later version.
00016 
00017     This library is distributed in the hope that it will be useful,
00018     but WITHOUT ANY WARRANTY; without even the implied warranty of
00019     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020     Lesser General Public License for more details.
00021 
00022     You should have received a copy of the GNU Lesser General Public
00023     License along with this library; if not, write to the Free Software
00024     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025 *************************************************************************/
00026 #ifndef _CEGUIFontManager_h_
00027 #define _CEGUIFontManager_h_
00028 
00029 #include "CEGUIBase.h"
00030 #include "CEGUIString.h"
00031 #include "CEGUISingleton.h"
00032 #include "CEGUIIteratorBase.h"
00033 #include <map>
00034 
00035 #if defined(_MSC_VER)
00036 #       pragma warning(push)
00037 #       pragma warning(disable : 4275)
00038 #       pragma warning(disable : 4251)
00039 #endif
00040 
00041 
00042 // Start of CEGUI namespace section
00043 namespace CEGUI
00044 {
00054 class CEGUIEXPORT FontManager : public Singleton<FontManager>
00055 {
00056 public:
00061         FontManager(void);
00062 
00063 
00068         ~FontManager(void);
00069 
00070 
00078         static  FontManager&    getSingleton(void);
00079 
00080 
00088         static  FontManager*    getSingletonPtr(void);
00089 
00090 
00111         Font*   createFont(const String& filename, const String& resourceGroup = "");
00112 
00113 
00141         Font*   createFont(const String& name, const String& fontname, uint size, uint flags, const String& resourceGroup = "");
00142 
00143 
00154         void    destroyFont(const String& name);
00155 
00156 
00167         void    destroyFont(Font* font);
00168 
00169 
00177         void    destroyAllFonts(void);
00178 
00179 
00190         bool    isFontPresent(const String& name) const;
00191 
00192 
00205         Font*   getFont(const String& name) const;
00206 
00207 
00218         void    notifyScreenResolution(const Size& size);
00219 
00220 
00234     void writeFontToStream(const String& name, OutStream& out_stream) const;
00235 
00236 
00237 private:
00238         /*************************************************************************
00239                 Implementation Data
00240         *************************************************************************/
00241         typedef std::map<String, Font*>         FontRegistry;
00242         FontRegistry            d_fonts;
00243 
00244         struct FontManagerImplData;
00245         FontManagerImplData*    d_implData;
00246 
00247 
00248 public:
00249         /*************************************************************************
00250                 Iterator stuff
00251         *************************************************************************/
00252         typedef ConstBaseIterator<FontRegistry> FontIterator;
00253 
00258         FontIterator    getIterator(void) const;
00259 };
00260 
00261 } // End of  CEGUI namespace section
00262 
00263 
00264 #if defined(_MSC_VER)
00265 #       pragma warning(pop)
00266 #endif
00267 
00268 #endif  // end of guard _CEGUIFontManager_h_

Generated on Sat Nov 26 09:34:48 2005 for Crazy Eddies GUI System by  doxygen 1.4.5