1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/common/fontenumcmn.cpp
3 // Purpose: wxFontEnumerator class
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 1999-2003 Vadim Zeitlin <vadim@wxwindows.org>
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 // For compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
27 #include "wx/fontenum.h"
29 // ============================================================================
31 // ============================================================================
33 // A simple wxFontEnumerator which doesn't perform any filtering and
34 // just returns all facenames and encodings found in the system
35 class WXDLLEXPORT wxSimpleFontEnumerator
: public wxFontEnumerator
38 wxSimpleFontEnumerator() { }
40 // called by EnumerateFacenames
41 virtual bool OnFacename(const wxString
& facename
)
43 m_arrFacenames
.Add(facename
);
47 // called by EnumerateEncodings
48 virtual bool OnFontEncoding(const wxString
& WXUNUSED(facename
),
49 const wxString
& encoding
)
51 m_arrEncodings
.Add(encoding
);
56 wxArrayString m_arrFacenames
, m_arrEncodings
;
61 wxArrayString
wxFontEnumerator::GetFacenames(wxFontEncoding encoding
, bool fixedWidthOnly
)
63 wxSimpleFontEnumerator temp
;
64 temp
.EnumerateFacenames(encoding
, fixedWidthOnly
);
65 return temp
.m_arrFacenames
;
69 wxArrayString
wxFontEnumerator::GetEncodings(const wxString
& facename
)
71 wxSimpleFontEnumerator temp
;
72 temp
.EnumerateEncodings(facename
);
73 return temp
.m_arrEncodings
;