]> git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/font.h
410e0bc200abc30f0bc2a0d333bbcc112c716ed2
[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 bool Create( int nSize
46 ,int nFamily
47 ,int nStyle
48 ,int nWeight
49 ,bool bUnderlined = FALSE
50 ,const wxString& rsFace = wxEmptyString
51 ,wxFontEncoding vEncoding = wxFONTENCODING_DEFAULT
52 );
53
54 virtual ~wxFont();
55
56 //
57 // Assignment
58 //
59 wxFont& operator=(const wxFont& rFont);
60
61 //
62 // Implement base class pure virtuals
63 //
64 virtual int GetPointSize(void) const;
65 virtual int GetFamily(void) const;
66 virtual int GetStyle(void) const;
67 virtual int GetWeight(void) const;
68 virtual bool GetUnderlined(void) const;
69 virtual wxString GetFaceName(void) const;
70 virtual wxFontEncoding GetEncoding(void) const;
71 virtual HPS GetPS(void) const;
72
73 virtual void SetPointSize(int nPointSize);
74 virtual void SetFamily(int nFamily);
75 virtual void SetStyle(int nStyle);
76 virtual void SetWeight(int nWeight);
77 virtual void SetFaceName(const wxString& rsFaceName);
78 virtual void SetUnderlined(bool bUnderlined);
79 virtual void SetEncoding(wxFontEncoding vEncoding);
80 virtual void SetPS(HPS hPS);
81 virtual void SetFM( PFONTMETRICS pFM
82 ,int nNumFonts
83 );
84
85 //
86 // Implementation only from now on
87 // -------------------------------
88 //
89 int GetFontId(void) const;
90 virtual bool IsFree(void) const;
91 virtual bool RealizeResource(void);
92 virtual WXHANDLE GetResourceHandle(void);
93 virtual bool FreeResource(bool bForce = FALSE);
94
95 protected:
96 //
97 // Common part of all ctors
98 //
99 void Init(void);
100 void Unshare(void);
101
102 private:
103 void OS2SelectMatchingFontByName(void);
104
105 DECLARE_DYNAMIC_CLASS(wxFont)
106 }; // end of wxFont
107
108 #endif // _WX_FONT_H_