]>
Commit | Line | Data |
---|---|---|
ddc8c2e3 VZ |
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 families and work ot | |
6 | // only on Windows (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 | // ---------------------------------------------------------------------------- | |
21 | // wxFontEnumerator enumerates all available fonts on the system or only the | |
22 | // fonts with given attributes | |
23 | // ---------------------------------------------------------------------------- | |
24 | ||
d111a89a | 25 | class WXDLLEXPORT wxFontEnumerator |
ddc8c2e3 VZ |
26 | { |
27 | public: | |
36f210c8 VZ |
28 | // start enumerating font families (either all of them or those which |
29 | // support the given encoding) - will result in OnFontFamily() being | |
30 | // called for each available font family (until they are exhausted or | |
31 | // OnFontFamily returns FALSE) | |
32 | virtual bool EnumerateFamilies | |
33 | ( | |
34 | wxFontEncoding encoding = wxFONTENCODING_SYSTEM, // all | |
35 | bool fixedWidthOnly = FALSE | |
36 | ); | |
ddc8c2e3 VZ |
37 | |
38 | // enumerate the different encodings either for given font family or for | |
39 | // all font families - will result in OnFontEncoding() being called for | |
40 | // each available (family, encoding) couple | |
223d09f6 | 41 | virtual bool EnumerateEncodings(const wxString& family = wxT("")); |
ddc8c2e3 VZ |
42 | |
43 | // callbacks which are called after one of EnumerateXXX() functions from | |
44 | // above is invoked - all of them may return FALSE to stop enumeration or | |
45 | // TRUE to continue with it | |
46 | ||
47 | // called by EnumerateFamilies | |
48 | virtual bool OnFontFamily(const wxString& WXUNUSED(family)) | |
49 | { return FALSE; } | |
50 | ||
51 | // called by EnumerateEncodings | |
52 | virtual bool OnFontEncoding(const wxString& WXUNUSED(family), | |
53 | const wxString& WXUNUSED(encoding)) | |
54 | { return FALSE; } | |
36f210c8 VZ |
55 | |
56 | // virtual dtor for the base class | |
57 | virtual ~wxFontEnumerator() { } | |
ddc8c2e3 VZ |
58 | }; |
59 | ||
60 | #endif // _WX_FONTENUM_H_ |