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"
22 // ----------------------------------------------------------------------------
23 // wxFontEnumerator enumerates all available fonts on the system or only the
24 // fonts with given attributes
25 // ----------------------------------------------------------------------------
27 class WXDLLEXPORT wxFontEnumerator
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
36 wxFontEncoding encoding
= wxFONTENCODING_SYSTEM
, // all
37 bool fixedWidthOnly
= FALSE
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(""));
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
49 // called by EnumerateFacenames
50 virtual bool OnFacename(const wxString
& WXUNUSED(facename
))
53 // called by EnumerateEncodings
54 virtual bool OnFontEncoding(const wxString
& WXUNUSED(facename
),
55 const wxString
& WXUNUSED(encoding
))
58 // virtual dtor for the base class
59 virtual ~wxFontEnumerator() { }
62 #endif // _WX_FONTENUM_H_