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  *   Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
00010  *
00011  *   Permission is hereby granted, free of charge, to any person obtaining
00012  *   a copy of this software and associated documentation files (the
00013  *   "Software"), to deal in the Software without restriction, including
00014  *   without limitation the rights to use, copy, modify, merge, publish,
00015  *   distribute, sublicense, and/or sell copies of the Software, and to
00016  *   permit persons to whom the Software is furnished to do so, subject to
00017  *   the following conditions:
00018  *
00019  *   The above copyright notice and this permission notice shall be
00020  *   included in all copies or substantial portions of the Software.
00021  *
00022  *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00023  *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00024  *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00025  *   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
00026  *   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
00027  *   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
00028  *   OTHER DEALINGS IN THE SOFTWARE.
00029  ***************************************************************************/
00030 #ifndef _CEGUIFontManager_h_
00031 #define _CEGUIFontManager_h_
00032 
00033 #include "CEGUIBase.h"
00034 #include "CEGUIString.h"
00035 #include "CEGUISingleton.h"
00036 #include "CEGUIIteratorBase.h"
00037 #include <map>
00038 
00039 #if defined(_MSC_VER)
00040 #       pragma warning(push)
00041 #       pragma warning(disable : 4275)
00042 #       pragma warning(disable : 4251)
00043 #endif
00044 
00045 
00046 // Start of CEGUI namespace section
00047 namespace CEGUI
00048 {
00058 class CEGUIEXPORT FontManager : public Singleton<FontManager>
00059 {
00060 public:
00065         FontManager(void);
00066 
00067 
00072         ~FontManager(void);
00073 
00074 
00095     Font *createFont(const String& filename, const String& resourceGroup = "");
00096 
00097 
00123     Font *createFont (const String &type, const String& name, const String& fontname,
00124                       const String& resourceGroup = "");
00125 
00126 
00134     Font *createFont (const String &type, const XMLAttributes& attributes);
00135 
00136 
00147         void    destroyFont(const String& name);
00148 
00149 
00160         void    destroyFont(Font* font);
00161 
00162 
00170         void    destroyAllFonts(void);
00171 
00172 
00183         bool    isFontPresent(const String& name) const;
00184 
00185 
00198         Font*   getFont(const String& name) const;
00199 
00200 
00211         void    notifyScreenResolution(const Size& size);
00212 
00213 
00227     void writeFontToStream(const String& name, OutStream& out_stream) const;
00228 
00229 
00230 private:
00231     /*************************************************************************
00232         Implementation Data
00233     *************************************************************************/
00234     typedef std::map<String, Font*, String::FastLessCompare> FontRegistry;
00235     FontRegistry d_fonts;
00236 
00237 public:
00238     /*************************************************************************
00239         Iterator stuff
00240     *************************************************************************/
00241     typedef ConstBaseIterator<FontRegistry> FontIterator;
00242 
00247     FontIterator getIterator (void) const;
00248 };
00249 
00250 } // End of  CEGUI namespace section
00251 
00252 
00253 #if defined(_MSC_VER)
00254 #       pragma warning(pop)
00255 #endif
00256 
00257 #endif  // end of guard _CEGUIFontManager_h_

Generated on Sun Nov 5 14:35:28 2006 for Crazy Eddies GUI System by  doxygen 1.4.7