1 ///////////////////////////////////////////////////////////////////////////// 2 // Name: wx/qt/font.h 3 // Author: Peter Most, Javier Torres, Mariano Reingart 4 // Copyright: (c) 2010 wxWidgets dev team 5 // Licence: wxWindows licence 6 ///////////////////////////////////////////////////////////////////////////// 7 8 #ifndef _WX_QT_FONT_H_ 9 #define _WX_QT_FONT_H_ 10 11 class QFont; 12 class WXDLLIMPEXP_CORE wxFont : public wxFontBase 13 { 14 public: 15 wxFont(); 16 wxFont(const wxFontInfo& info); 17 wxFont(const wxString& nativeFontInfoString); 18 wxFont(const wxNativeFontInfo& info); 19 wxFont(const QFont& font); 20 wxFont(int size, 21 wxFontFamily family, 22 wxFontStyle style, 23 wxFontWeight weight, 24 bool underlined = false, 25 const wxString& face = wxEmptyString, 26 wxFontEncoding encoding = wxFONTENCODING_DEFAULT); 27 wxFont(const wxSize& pixelSize, 28 wxFontFamily family, 29 wxFontStyle style, 30 wxFontWeight weight, 31 bool underlined = false, 32 const wxString& face = wxEmptyString, 33 wxFontEncoding encoding = wxFONTENCODING_DEFAULT); 34 35 wxDEPRECATED_MSG("use wxFONT{FAMILY,STYLE,WEIGHT}_XXX constants") 36 wxFont(int size, 37 int family, 38 int style, 39 int weight, 40 bool underlined = false, 41 const wxString& face = wxEmptyString, 42 wxFontEncoding encoding = wxFONTENCODING_DEFAULT); 43 44 bool Create(wxSize size, 45 wxFontFamily family, 46 wxFontStyle style, 47 wxFontWeight weight, 48 bool underlined = false, 49 const wxString& face = wxEmptyString, 50 wxFontEncoding encoding = wxFONTENCODING_DEFAULT); 51 52 // accessors: get the font characteristics 53 virtual int GetPointSize() const wxOVERRIDE; 54 virtual double GetFractionalPointSize() const wxOVERRIDE; 55 virtual wxSize GetPixelSize() const wxOVERRIDE; 56 virtual wxFontStyle GetStyle() const wxOVERRIDE; 57 virtual int GetNumericWeight() const wxOVERRIDE; 58 virtual bool GetUnderlined() const wxOVERRIDE; 59 virtual wxString GetFaceName() const wxOVERRIDE; 60 virtual wxFontEncoding GetEncoding() const wxOVERRIDE; 61 virtual const wxNativeFontInfo *GetNativeFontInfo() const wxOVERRIDE; 62 virtual bool GetStrikethrough() const wxOVERRIDE; 63 64 // change the font characteristics 65 virtual void SetFractionalPointSize(double pointSize) wxOVERRIDE; 66 virtual void SetPixelSize(const wxSize& pixelSize) wxOVERRIDE; 67 virtual void SetFamily( wxFontFamily family ) wxOVERRIDE; 68 virtual void SetStyle( wxFontStyle style ) wxOVERRIDE; 69 virtual void SetNumericWeight(int weight) wxOVERRIDE; 70 virtual bool SetFaceName(const wxString& facename) wxOVERRIDE; 71 virtual void SetUnderlined( bool underlined ) wxOVERRIDE; 72 virtual void SetStrikethrough(bool strikethrough) wxOVERRIDE; 73 virtual void SetEncoding(wxFontEncoding encoding) wxOVERRIDE; 74 75 wxDECLARE_COMMON_FONT_METHODS(); 76 77 virtual QFont GetHandle() const; 78 79 protected: 80 virtual wxGDIRefData *CreateGDIRefData() const wxOVERRIDE; 81 virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const wxOVERRIDE; 82 virtual wxFontFamily DoGetFamily() const wxOVERRIDE; 83 virtual void DoSetNativeFontInfo(const wxNativeFontInfo& info) wxOVERRIDE; 84 85 wxDECLARE_DYNAMIC_CLASS(wxFont); 86 87 }; 88 89 90 #endif // _WX_QT_FONT_H_ 91