]> git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/font.h
Update to allow new wxNativeFontInfo stuff to compile
[wxWidgets.git] / include / wx / os2 / font.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: font.h
3 // Purpose: wxFont class
4 // Author: David Webster
5 // Modified by:
6 // Created: 10/06/99
7 // RCS-ID: $Id$
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_FONT_H_
13 #define _WX_FONT_H_
14
15 #include "wx/gdiobj.h"
16 #include "wx/os2/private.h"
17
18 WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString;
19
20 // ----------------------------------------------------------------------------
21 // wxFont
22 // ----------------------------------------------------------------------------
23
24 class WXDLLEXPORT wxFont : public wxFontBase
25 {
26 public:
27 // ctors and such
28 wxFont() { Init(); }
29 wxFont(const wxFont& rFont) { Init(); Ref(rFont); }
30
31 wxFont( int nSize
32 ,int nFamily
33 ,int nStyle
34 ,int nWeight
35 ,bool bUnderlined = FALSE
36 ,const wxString& rsFace = wxEmptyString
37 ,wxFontEncoding vEncoding = wxFONTENCODING_DEFAULT
38 )
39 {
40 Init();
41
42 (void)Create(nSize, nFamily, nStyle, nWeight, bUnderlined, rsFace, vEncoding);
43 }
44
45 wxFont(const wxNativeFontInfo& rInfo)
46 {
47 Init();
48
49 (void)Create( rInfo.pointSize
50 ,rInfo.family
51 ,rInfo.style
52 ,rInfo.weight
53 ,rInfo.underlined
54 ,rInfo.faceName
55 ,rInfo.encoding
56 );
57 }
58
59 bool Create( int nSize
60 ,int nFamily
61 ,int nStyle
62 ,int nWeight
63 ,bool bUnderlined = FALSE
64 ,const wxString& rsFace = wxEmptyString
65 ,wxFontEncoding vEncoding = wxFONTENCODING_DEFAULT
66 );
67
68 virtual ~wxFont();
69
70 //
71 // Assignment
72 //
73 wxFont& operator=(const wxFont& rFont);
74
75 //
76 // Implement base class pure virtuals
77 //
78 virtual int GetPointSize(void) const;
79 virtual int GetFamily(void) const;
80 virtual int GetStyle(void) const;
81 virtual int GetWeight(void) const;
82 virtual bool GetUnderlined(void) const;
83 virtual wxString GetFaceName(void) const;
84 virtual wxFontEncoding GetEncoding(void) const;
85 virtual HPS GetPS(void) const;
86
87 virtual void SetPointSize(int nPointSize);
88 virtual void SetFamily(int nFamily);
89 virtual void SetStyle(int nStyle);
90 virtual void SetWeight(int nWeight);
91 virtual void SetFaceName(const wxString& rsFaceName);
92 virtual void SetUnderlined(bool bUnderlined);
93 virtual void SetEncoding(wxFontEncoding vEncoding);
94 virtual void SetPS(HPS hPS);
95 virtual void SetFM( PFONTMETRICS pFM
96 ,int nNumFonts
97 );
98
99 //
100 // Implementation only from now on
101 // -------------------------------
102 //
103 int GetFontId(void) const;
104 virtual bool IsFree(void) const;
105 virtual bool RealizeResource(void);
106 virtual WXHANDLE GetResourceHandle(void);
107 virtual bool FreeResource(bool bForce = FALSE);
108
109 protected:
110 //
111 // Common part of all ctors
112 //
113 void Init(void);
114 void Unshare(void);
115
116 private:
117 void OS2SelectMatchingFontByName(void);
118
119 DECLARE_DYNAMIC_CLASS(wxFont)
120 }; // end of wxFont
121
122 #endif // _WX_FONT_H_