X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/12f5e1e78fe906050ff2fee9529476db332633f0..15fa4de377053c3c38f62593b2df941c217ea34b:/interface/wx/fontenum.h?ds=sidebyside diff --git a/interface/wx/fontenum.h b/interface/wx/fontenum.h index e34a77a2da..15763d5ebf 100644 --- a/interface/wx/fontenum.h +++ b/interface/wx/fontenum.h @@ -3,7 +3,7 @@ // Purpose: interface of wxFontEnumerator // Author: wxWidgets team // RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** @@ -12,36 +12,40 @@ wxFontEnumerator enumerates either all available fonts on the system or only the ones with given attributes - either only fixed-width (suited for use in programs such as terminal emulators and the like) or the fonts available in - the given encoding(). + the given encoding). To do this, you just have to call one of EnumerateXXX() functions - either - wxFontEnumerator::EnumerateFacenames or - wxFontEnumerator::EnumerateEncodings and the - corresponding callback (wxFontEnumerator::OnFacename or - wxFontEnumerator::OnFontEncoding) will be called - repeatedly until either all fonts satisfying the specified criteria are - exhausted or the callback returns @false. + wxFontEnumerator::EnumerateFacenames() or wxFontEnumerator::EnumerateEncodings() + and the corresponding callback (wxFontEnumerator::OnFacename() or + wxFontEnumerator::OnFontEncoding()) will be called repeatedly until either + all fonts satisfying the specified criteria are exhausted or the callback + returns @false. + + @section fontenum_virtual Virtual functions to override + + Either OnFacename or OnFontEncoding should be overridden depending on + whether you plan to call EnumerateFacenames or EnumerateEncodings. + Of course, if you call both of them, you should override both functions. @library{wxcore} - @category{FIXME} + @category{gdi} - @see @ref overview_wxfontencodingoverview, @ref overview_samplefont "Font - sample", wxFont, wxFontMapper + @see @ref overview_fontencoding, @ref page_samples_font, wxFont, wxFontMapper */ class wxFontEnumerator { public: /** - Call OnFontEncoding() for each - encoding supported by the given font - or for each encoding supported by at - least some font if @a font is not specified. + Call OnFontEncoding() for each encoding supported by the given font - + or for each encoding supported by at least some font if @a font is not specified. */ - virtual bool EnumerateEncodings(const wxString& font = ""); + virtual bool EnumerateEncodings(const wxString& font = wxEmptyString); /** - Call OnFacename() for each font which - supports given encoding (only if it is not wxFONTENCODING_SYSTEM) and is of - fixed width (if @a fixedWidthOnly is @true). + Call OnFacename() for each font which supports given encoding (only if + it is not @c wxFONTENCODING_SYSTEM) and is of fixed width + (if @a fixedWidthOnly is @true). + Calling this function with default arguments will result in enumerating all fonts available on the system. */ @@ -52,7 +56,7 @@ public: Return array of strings containing all encodings found by EnumerateEncodings(). */ - static wxArrayString GetEncodings(const wxString& facename = ""); + static wxArrayString GetEncodings(const wxString& facename = wxEmptyString); /** Return array of strings containing all facenames found by @@ -63,20 +67,21 @@ public: /** Returns @true if the given string is valid face name, i.e. it's the face name - of an installed - font and it can safely be used with wxFont::SetFaceName. + of an installed font and it can safely be used with wxFont::SetFaceName. */ static bool IsValidFacename(const wxString& facename); /** - Called by EnumerateFacenames() for - each match. Return @true to continue enumeration or @false to stop it. + Called by EnumerateFacenames() for each match. + + Return @true to continue enumeration or @false to stop it. */ virtual bool OnFacename(const wxString& font); /** - Called by EnumerateEncodings() for - each match. Return @true to continue enumeration or @false to stop it. + Called by EnumerateEncodings() for each match. + + Return @true to continue enumeration or @false to stop it. */ virtual bool OnFontEncoding(const wxString& font, const wxString& encoding);