xoreos  0.0.5
fonthandle.h
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
25 #ifndef GRAPHICS_AURORA_FONTHANDLE_H
26 #define GRAPHICS_AURORA_FONTHANDLE_H
27 
28 #include <map>
29 
30 #include "src/common/types.h"
31 #include "src/common/scopedptr.h"
32 #include "src/common/ptrmap.h"
33 #include "src/common/ustring.h"
34 
35 namespace Graphics {
36 
37 class Font;
38 
39 namespace Aurora {
40 
42 struct ManagedFont {
45 
46  ManagedFont(Font *f);
47 };
48 
50 
52 class FontHandle {
53 public:
54  FontHandle();
55  FontHandle(const FontHandle &right);
56  ~FontHandle();
57 
58  FontHandle &operator=(const FontHandle &right);
59 
60  bool empty() const;
61  const Common::UString &getName() const;
62 
63  void clear();
64 
65  Font &getFont() const;
66 
67 private:
68  bool _empty;
69  FontMap::iterator _it;
70 
71  FontHandle(FontMap::iterator &i);
72 
73  friend class FontManager;
74 };
75 
76 } // End of namespace Aurora
77 
78 } // End of namespace Graphics
79 
80 #endif // GRAPHICS_AURORA_FONTHANDLE_H
A managed font, storing how often it&#39;s referenced.
Definition: fonthandle.h:42
A map storing pointer to objects, with automatic deletion.
A class holding an UTF-8 string.
Definition: ustring.h:48
A handle to a font.
Definition: fonthandle.h:52
A simple scoped smart pointer template.
Common::ScopedPtr< Font > font
Definition: fonthandle.h:43
Common::PtrMap< Common::UString, ManagedFont > FontMap
Definition: fonthandle.h:49
Low-level type definitions to handle fixed width types portably.
An abstract font.
Definition: font.h:39
A scoped plain pointer, allowing pointer-y access and normal deletion.
Definition: scopedptr.h:120
The global Aurora font manager.
Definition: fontman.h:54
Unicode string handling.
uint32_t uint32
Definition: types.h:204
const Common::UString & getName() const
Definition: fonthandle.cpp:71
FontHandle & operator=(const FontHandle &right)
Definition: fonthandle.cpp:55
FontMap::iterator _it
Definition: fonthandle.h:69