]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/palmos/font.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/palmos/font.h
3 // Purpose: wxFont class
4 // Author: William Osborne - minimal working wxPalmOS port
5 // Modified by: Yunhui Fu
8 // Copyright: (c) William Osborne
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #include "wx/gdicmn.h"
17 // ----------------------------------------------------------------------------
19 // ----------------------------------------------------------------------------
21 class WXDLLIMPEXP_CORE wxFont
: public wxFontBase
27 #if FUTURE_WXWIN_COMPATIBILITY_3_0
32 bool underlined
= false,
33 const wxString
& face
= wxEmptyString
,
34 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
36 (void)Create(size
, (wxFontFamily
)family
, (wxFontStyle
)style
, (wxFontWeight
)weight
, underlined
, face
, encoding
);
44 bool underlined
= false,
45 const wxString
& face
= wxEmptyString
,
46 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
48 Create(size
, family
, style
, weight
, underlined
, face
, encoding
);
55 bool underlined
= false,
56 const wxString
& face
= wxEmptyString
,
57 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
59 wxFont(const wxSize
& pixelSize
,
63 bool underlined
= false,
64 const wxString
& face
= wxEmptyString
,
65 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
67 (void)Create(pixelSize
, family
, style
, weight
,
68 underlined
, face
, encoding
);
71 wxFont(const wxNativeFontInfo
& info
, WXHFONT hFont
= 0)
76 wxFont(const wxString
& fontDesc
);
78 bool Create(const wxSize
& pixelSize
,
82 bool underlined
= false,
83 const wxString
& face
= wxEmptyString
,
84 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
86 return DoCreate(-1, pixelSize
, true, family
, style
,
87 weight
, underlined
, face
, encoding
);
90 bool Create(const wxNativeFontInfo
& info
, WXHFONT hFont
= 0);
94 // wxFontBase overridden functions
95 virtual wxString
GetNativeFontInfoDesc() const;
96 virtual wxString
GetNativeFontInfoUserDesc() const;
98 // implement base class pure virtuals
99 virtual int GetPointSize() const;
100 virtual wxSize
GetPixelSize() const;
101 virtual bool IsUsingSizeInPixels() const;
102 virtual wxFontFamily
GetFamily() const;
103 virtual wxFontStyle
GetStyle() const;
104 virtual wxFontWeight
GetWeight() const;
105 virtual bool GetUnderlined() const;
106 virtual wxString
GetFaceName() const;
107 virtual wxFontEncoding
GetEncoding() const;
108 virtual const wxNativeFontInfo
*GetNativeFontInfo() const;
110 virtual void SetPointSize(int pointSize
);
111 virtual void SetPixelSize(const wxSize
& pixelSize
);
112 virtual void SetFamily(wxFontFamily family
);
113 virtual void SetStyle(wxFontStyle style
);
114 virtual void SetWeight(wxFontWeight weight
);
115 virtual bool SetFaceName(const wxString
& faceName
);
116 virtual void SetUnderlined(bool underlined
);
117 virtual void SetEncoding(wxFontEncoding encoding
);
119 wxDECLARE_COMMON_FONT_METHODS();
121 virtual bool IsFixedWidth() const;
123 // implementation only from now on
124 // -------------------------------
126 virtual bool IsFree() const;
127 virtual bool RealizeResource();
128 virtual WXHANDLE
GetResourceHandle() const;
129 virtual bool FreeResource(bool force
= false);
132 // real font creation function, used in all cases
133 bool DoCreate(int size
,
134 const wxSize
& pixelSize
,
135 bool sizeUsingPixels
,
139 bool underlined
= false,
140 const wxString
& face
= wxEmptyString
,
141 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
143 virtual void DoSetNativeFontInfo(const wxNativeFontInfo
& info
);
145 // implement wxObject virtuals which are used by AllocExclusive()
146 virtual wxGDIRefData
*CreateGDIRefData() const;
147 virtual wxGDIRefData
*CloneGDIRefData(const wxGDIRefData
*data
) const;
150 DECLARE_DYNAMIC_CLASS(wxFont
)
153 #endif // _WX_FONT_H_