X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/73302af6dddd667af4ebec69c800bc9de106f28e..2c01d33555e3125057f4575ca7d0d2aba93f421f:/include/wx/fontmap.h?ds=sidebyside diff --git a/include/wx/fontmap.h b/include/wx/fontmap.h index 2dee4a244b..d3b0461e72 100644 --- a/include/wx/fontmap.h +++ b/include/wx/fontmap.h @@ -49,6 +49,8 @@ class WXDLLIMPEXP_CORE wxFontMapper; class WXDLLIMPEXP_BASE wxFontMapperBase { + // For IsWxFontMapper() + friend class WXDLLIMPEXP_CORE wxFontMapper; public: // constructtor and such // --------------------- @@ -60,14 +62,10 @@ public: virtual ~wxFontMapperBase(); // return instance of the wxFontMapper singleton -#if wxUSE_GUI - // GUI code needs to know it's a wxFontMapper because there - // are additional methods in the subclass. - static wxFontMapper *Get(); -#else // wxBase code only cares that it's a wxFontMapperBase + // In wxBase, wxFontMapper is only forward declared + // so one cannot implicitly cast from it to wxFontMapperBase. static wxFontMapperBase *Get(); -#endif // set the singleton to 'mapper' instance and return previous one static wxFontMapper *Set(wxFontMapper *mapper); @@ -92,10 +90,13 @@ public: // get the n-th supported encoding static wxFontEncoding GetEncoding(size_t n); - // return internal string identifier for the encoding (see also - // GetEncodingDescription()) + // return canonical name of this encoding (this is a short string, + // GetEncodingDescription() returns a longer one) static wxString GetEncodingName(wxFontEncoding encoding); + // return a list of all names of this encoding (see GetEncodingName) + static const wxChar** GetAllEncodingNames(wxFontEncoding encoding); + // return user-readable string describing the given encoding // // NB: hard-coded now, but might change later (read it from config?) @@ -162,6 +163,9 @@ protected: int NonInteractiveCharsetToEncoding(const wxString& charset); private: + // pseudo-RTTI since we aren't a wxObject. + virtual bool IsWxFontMapper(); + // the global fontmapper object or NULL static wxFontMapper *sm_instance; @@ -235,6 +239,9 @@ public: // the title for the dialogs (note that default is quite reasonable) void SetDialogTitle(const wxString& title) { m_titleDialog = title; } + // GUI code needs to know it's a wxFontMapper because there + // are additional methods in the subclass. + static wxFontMapper *Get(); protected: // GetAltForEncoding() helper: tests for the existence of the given @@ -255,6 +262,9 @@ protected: wxWindow *m_windowParent; private: + // pseudo-RTTI since we aren't a wxObject. + virtual bool IsWxFontMapper(); + DECLARE_NO_COPY_CLASS(wxFontMapper) };