]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: fontenum.h | |
3 | // Purpose: wxFontEnumerator class for getting available fonts | |
4 | // Author: Julian Smart, Vadim Zeitlin | |
5 | // Modified by: extended to enumerate more than just font facenames and works | |
6 | // not only on Windows now (VZ) | |
7 | // Created: 04/01/98 | |
8 | // RCS-ID: $Id$ | |
9 | // Copyright: (c) Julian Smart, Vadim Zeitlin | |
10 | // Licence: wxWindows licence | |
11 | ///////////////////////////////////////////////////////////////////////////// | |
12 | ||
13 | #ifndef _WX_FONTENUM_H_ | |
14 | #define _WX_FONTENUM_H_ | |
15 | ||
16 | #ifdef __GNUG__ | |
17 | #pragma interface "fontenum.h" | |
18 | #endif | |
19 | ||
20 | #include "wx/font.h" | |
21 | ||
22 | // ---------------------------------------------------------------------------- | |
23 | // wxFontEnumerator enumerates all available fonts on the system or only the | |
24 | // fonts with given attributes | |
25 | // ---------------------------------------------------------------------------- | |
26 | ||
27 | class WXDLLEXPORT wxFontEnumerator | |
28 | { | |
29 | public: | |
30 | // start enumerating font facenames (either all of them or those which | |
31 | // support the given encoding) - will result in OnFacename() being | |
32 | // called for each available facename (until they are exhausted or | |
33 | // OnFacename returns FALSE) | |
34 | virtual bool EnumerateFacenames | |
35 | ( | |
36 | wxFontEncoding encoding = wxFONTENCODING_SYSTEM, // all | |
37 | bool fixedWidthOnly = FALSE | |
38 | ); | |
39 | ||
40 | // enumerate the different encodings either for given font facename or for | |
41 | // all facenames - will result in OnFontEncoding() being called for each | |
42 | // available (facename, encoding) couple | |
43 | virtual bool EnumerateEncodings(const wxString& facename = wxT("")); | |
44 | ||
45 | // callbacks which are called after one of EnumerateXXX() functions from | |
46 | // above is invoked - all of them may return FALSE to stop enumeration or | |
47 | // TRUE to continue with it | |
48 | ||
49 | // called by EnumerateFacenames | |
50 | virtual bool OnFacename(const wxString& WXUNUSED(facename)) | |
51 | { return FALSE; } | |
52 | ||
53 | // called by EnumerateEncodings | |
54 | virtual bool OnFontEncoding(const wxString& WXUNUSED(facename), | |
55 | const wxString& WXUNUSED(encoding)) | |
56 | { return FALSE; } | |
57 | ||
58 | // virtual dtor for the base class | |
59 | virtual ~wxFontEnumerator() { } | |
60 | }; | |
61 | ||
62 | #endif // _WX_FONTENUM_H_ |