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