compilation fixes for wxMSW
[wxWidgets.git] / include / wx / msw / font.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: font.h
3 // Purpose: wxFont class
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 01/02/97
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_FONT_H_
13 #define _WX_FONT_H_
14
15 #ifdef __GNUG__
16 #pragma interface "font.h"
17 #endif
18
19 // ----------------------------------------------------------------------------
20 // wxFont
21 // ----------------------------------------------------------------------------
22
23 class WXDLLEXPORT wxFont : public wxFontBase
24 {
25 public:
26 // ctors and such
27 wxFont() { Init(); }
28 wxFont(const wxFont& font) { Init(); Ref(font); }
29
30 wxFont(int size,
31 int family,
32 int style,
33 int weight,
34 bool underlined = FALSE,
35 const wxString& face = wxEmptyString,
36 wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
37 {
38 Init();
39
40 (void)Create(size, family, style, weight, underlined, face, encoding);
41 }
42
43 wxFont(const wxNativeFontInfo& info)
44 {
45 Init();
46
47 Create(info);
48 }
49
50 wxFont(const wxString& fontDesc);
51
52 bool Create(int size,
53 int family,
54 int style,
55 int weight,
56 bool underlined = FALSE,
57 const wxString& face = wxEmptyString,
58 wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
59
60 bool Create(const wxNativeFontInfo& info);
61
62 virtual ~wxFont();
63
64 // assignment
65 wxFont& operator=(const wxFont& font);
66
67 // implement base class pure virtuals
68 virtual int GetPointSize() const;
69 virtual int GetFamily() const;
70 virtual int GetStyle() const;
71 virtual int GetWeight() const;
72 virtual bool GetUnderlined() const;
73 virtual wxString GetFaceName() const;
74 virtual wxFontEncoding GetEncoding() const;
75
76 virtual void SetPointSize(int pointSize);
77 virtual void SetFamily(int family);
78 virtual void SetStyle(int style);
79 virtual void SetWeight(int weight);
80 virtual void SetFaceName(const wxString& faceName);
81 virtual void SetUnderlined(bool underlined);
82 virtual void SetEncoding(wxFontEncoding encoding);
83
84 // implementation only from now on
85 // -------------------------------
86
87 int GetFontId() const;
88 virtual bool IsFree() const;
89 virtual bool RealizeResource();
90 virtual WXHANDLE GetResourceHandle();
91 virtual bool FreeResource(bool force = FALSE);
92
93 // for consistency with other wxMSW classes and to have a const
94 // GetResourceHandle()-like function we have a synonym for it
95 WXHFONT GetHFONT() const;
96
97 /*
98 virtual bool UseResource();
99 virtual bool ReleaseResource();
100 */
101
102 protected:
103 // common part of all ctors
104 void Init();
105
106 void Unshare();
107
108 private:
109 DECLARE_DYNAMIC_CLASS(wxFont)
110 };
111
112 #endif
113 // _WX_FONT_H_