1 /////////////////////////////////////////////////////////////////////////////
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)
9 // Copyright: (c) Julian Smart, Vadim Zeitlin
10 // Licence: wxWindows licence
11 /////////////////////////////////////////////////////////////////////////////
13 #ifndef _WX_FONTENUM_H_
14 #define _WX_FONTENUM_H_
17 #pragma interface "fontenum.h"
20 // ----------------------------------------------------------------------------
21 // wxFontEnumerator enumerates all available fonts on the system or only the
22 // fonts with given attributes
23 // ----------------------------------------------------------------------------
25 class WXDLLEXPORT wxFontEnumerator
28 // start enumerating font facenames (either all of them or those which
29 // support the given encoding) - will result in OnFacename() being
30 // called for each available facename (until they are exhausted or
31 // OnFacename returns FALSE)
32 virtual bool EnumerateFacenames
34 wxFontEncoding encoding
= wxFONTENCODING_SYSTEM
, // all
35 bool fixedWidthOnly
= FALSE
38 // enumerate the different encodings either for given font facename or for
39 // all facenames - will result in OnFontEncoding() being called for each
40 // available (facename, encoding) couple
41 virtual bool EnumerateEncodings(const wxString
& facename
= wxT(""));
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
47 // called by EnumerateFacenames
48 virtual bool OnFacename(const wxString
& WXUNUSED(facename
))
51 // called by EnumerateEncodings
52 virtual bool OnFontEncoding(const wxString
& WXUNUSED(facename
),
53 const wxString
& WXUNUSED(encoding
))
56 // virtual dtor for the base class
57 virtual ~wxFontEnumerator() { }
60 #endif // _WX_FONTENUM_H_