]> Shamusworld >> Repos - architektonas/blob - src/base/fontlist.h
Bugfixes related to removing Snapper class.
[architektonas] / src / base / fontlist.h
1 #ifndef __FONTLIST_H__
2 #define __FONTLIST_H__
3
4 #include <QtCore>
5
6 #define FONTLIST FontList::instance()
7
8 class Font;
9
10 /**
11  * The global list of fonts. This is implemented as a singleton.
12  * Use FontList::instance() to get a pointer to the object.
13  *
14  * @author James Hammons
15  * @author Andrew Mustun
16  */
17 class FontList
18 {
19         protected:
20                 FontList();
21
22         public:
23                 /**
24                  * @return Instance to the unique font list.
25                  */
26                 static FontList * instance();
27
28                 virtual ~FontList();
29
30                 void init();
31                 void clearFonts();
32                 int countFonts();
33                 virtual void removeFont(Font * font);
34                 Font * requestFont(const QString & name);
35                 Font * firstFont();
36                 Font * nextFont();
37
38                 friend std::ostream & operator<<(std::ostream & os, FontList & l);
39
40         protected:
41                 static FontList * uniqueInstance;
42
43         private:
44                 //! fonts in the graphic
45                 QList<Font *> fonts;
46                 QListIterator<Font *> fontIterator;
47 };
48
49 #endif  // __FONTLIST_H__