Fix issue in Rocket.lua script.
[Cafu-Engine.git] / Libs / GuiSys / GuiResources.hpp
blobd8a1b556a0512d41d5f5f14dcd4fc55f02fc7458
1 /*
2 Cafu Engine, http://www.cafu.de/
3 Copyright (c) Carsten Fuchs and other contributors.
4 This project is licensed under the terms of the MIT license.
5 */
7 #ifndef CAFU_GUISYS_GUI_RESOURCES_HPP_INCLUDED
8 #define CAFU_GUISYS_GUI_RESOURCES_HPP_INCLUDED
10 #include "Templates/Array.hpp"
12 #include <string>
15 namespace cf { class TrueTypeFontT; }
16 class CafuModelT;
17 class ModelManagerT;
20 namespace cf
22 namespace GuiSys
24 /// This class manages and provides resources (fonts and models) for GuiImplT instances.
25 /// One GuiResourcesT can be commonly used for several GuiImplT instances at once.
26 class GuiResourcesT
28 public:
30 /// The constructor.
31 GuiResourcesT(ModelManagerT& ModelMan);
33 /// The destructor.
34 ~GuiResourcesT();
36 /// Returns (a pointer to) a font instance for the given filename.
37 /// The returned font instance is possibly shared with other users, and must not be deleted.
38 /// @param FontName The name of the font to return.
39 /// @returns A pointer to the specified font, or NULL if there was an error (e.g. the font could not be loaded).
40 TrueTypeFontT* GetFont(const std::string& FontName);
42 /// Returns (a pointer to) a model instance for the given filename.
43 /// @see ModelManagerT::GetModel() for more details.
44 const CafuModelT* GetModel(const std::string& FileName, std::string& ErrorMsg);
47 private:
49 GuiResourcesT(const GuiResourcesT&); ///< Use of the Copy Constructor is not allowed.
50 void operator = (const GuiResourcesT&); ///< Use of the Assignment Operator is not allowed.
52 ArrayT<TrueTypeFontT*> m_Fonts; ///< The fonts that are used within the GUIs.
53 ModelManagerT& m_ModelMan; ///< The model manager from which any models that occur in the GUIs are aquired.
58 #endif