wxWidgets/interface/wx/fontenum.h
Vadim Zeitlin 3f66f6a5b3 Remove all lines containing cvs/svn "$Id$" keyword.
This keyword is not expanded by Git which means it's not replaced with the
correct revision value in the releases made using git-based scripts and it's
confusing to have lines with unexpanded "$Id$" in the released files. As
expanding them with Git is not that simple (it could be done with git archive
and export-subst attribute) and there are not many benefits in having them in
the first place, just remove all these lines.

If nothing else, this will make an eventual transition to Git simpler.

Closes #14487.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-26 16:02:46 +00:00

92 lines
3.3 KiB
Objective-C

/////////////////////////////////////////////////////////////////////////////
// Name: fontenum.h
// Purpose: interface of wxFontEnumerator
// Author: wxWidgets team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
/**
@class wxFontEnumerator
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).
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.
@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{gdi}
@see @ref overview_fontencoding, @ref page_samples_font, wxFont, wxFontMapper
*/
class wxFontEnumerator
{
public:
wxFontEnumerator();
virtual ~wxFontEnumerator();
/**
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 = wxEmptyString);
/**
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.
*/
virtual bool EnumerateFacenames(wxFontEncoding encoding = wxFONTENCODING_SYSTEM,
bool fixedWidthOnly = false);
/**
Return array of strings containing all encodings found by
EnumerateEncodings().
*/
static wxArrayString GetEncodings(const wxString& facename = wxEmptyString);
/**
Return array of strings containing all facenames found by
EnumerateFacenames().
*/
static wxArrayString GetFacenames(wxFontEncoding encoding = wxFONTENCODING_SYSTEM,
bool fixedWidthOnly = false);
/**
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.
*/
static bool IsValidFacename(const wxString& facename);
/**
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.
*/
virtual bool OnFontEncoding(const wxString& font,
const wxString& encoding);
};