]>
Commit | Line | Data |
---|---|---|
ddc8c2e3 VZ |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: fontenum.h | |
3 | // Purpose: wxFontEnumerator class for getting available fonts | |
4 | // Author: Julian Smart, Vadim Zeitlin | |
3c1866e8 VZ |
5 | // Modified by: extended to enumerate more than just font facenames and works |
6 | // not only on Windows now (VZ) | |
ddc8c2e3 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 | ||
7beba2fc VZ |
20 | #include "wx/font.h" |
21 | ||
ddc8c2e3 VZ |
22 | // ---------------------------------------------------------------------------- |
23 | // wxFontEnumerator enumerates all available fonts on the system or only the | |
24 | // fonts with given attributes | |
25 | // ---------------------------------------------------------------------------- | |
26 | ||
d111a89a | 27 | class WXDLLEXPORT wxFontEnumerator |
ddc8c2e3 VZ |
28 | { |
29 | public: | |
3c1866e8 VZ |
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 | |
36f210c8 VZ |
35 | ( |
36 | wxFontEncoding encoding = wxFONTENCODING_SYSTEM, // all | |
37 | bool fixedWidthOnly = FALSE | |
38 | ); | |
ddc8c2e3 | 39 | |
3c1866e8 VZ |
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("")); | |
ddc8c2e3 VZ |
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 | ||
3c1866e8 VZ |
49 | // called by EnumerateFacenames |
50 | virtual bool OnFacename(const wxString& WXUNUSED(facename)) | |
ddc8c2e3 VZ |
51 | { return FALSE; } |
52 | ||
53 | // called by EnumerateEncodings | |
3c1866e8 | 54 | virtual bool OnFontEncoding(const wxString& WXUNUSED(facename), |
ddc8c2e3 VZ |
55 | const wxString& WXUNUSED(encoding)) |
56 | { return FALSE; } | |
36f210c8 VZ |
57 | |
58 | // virtual dtor for the base class | |
59 | virtual ~wxFontEnumerator() { } | |
ddc8c2e3 VZ |
60 | }; |
61 | ||
62 | #endif // _WX_FONTENUM_H_ |