]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/font.h
MSW compilation fixes (untested)
[wxWidgets.git] / include / wx / msw / font.h
CommitLineData
2bda0e17
KB
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$
bbcdf8bc
JS
8// Copyright: (c) Julian Smart
9// Licence: wxWindows licence
2bda0e17
KB
10/////////////////////////////////////////////////////////////////////////////
11
bbcdf8bc
JS
12#ifndef _WX_FONT_H_
13#define _WX_FONT_H_
2bda0e17
KB
14
15#ifdef __GNUG__
0c5d3e1c 16 #pragma interface "font.h"
2bda0e17
KB
17#endif
18
19#include "wx/gdiobj.h"
20
39ca6d79 21WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString;
2bda0e17 22
0c5d3e1c
VZ
23// ----------------------------------------------------------------------------
24// wxFont
25// ----------------------------------------------------------------------------
26
27class WXDLLEXPORT wxFont : public wxFontBase
2bda0e17 28{
2bda0e17 29public:
0c5d3e1c
VZ
30 // ctors and such
31 wxFont() { Init(); }
32 wxFont(const wxFont& font) { Init(); Ref(font); }
33
34 wxFont(int size,
35 int family,
36 int style,
37 int weight,
38 bool underlined = FALSE,
39 const wxString& face = wxEmptyString,
40 wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
41 {
42 Init();
43
44 (void)Create(size, family, style, weight, underlined, face, encoding);
45 }
46
47 bool Create(int size,
48 int family,
49 int style,
50 int weight,
51 bool underlined = FALSE,
52 const wxString& face = wxEmptyString,
53 wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
54
55 virtual ~wxFont();
56
74b31181
VZ
57 // assignment
58 wxFont& operator=(const wxFont& font);
59
0c5d3e1c
VZ
60 // implement base class pure virtuals
61 virtual int GetPointSize() const;
62 virtual int GetFamily() const;
63 virtual int GetStyle() const;
64 virtual int GetWeight() const;
65 virtual bool GetUnderlined() const;
66 virtual wxString GetFaceName() const;
67 virtual wxFontEncoding GetEncoding() const;
68
69 virtual void SetPointSize(int pointSize);
70 virtual void SetFamily(int family);
71 virtual void SetStyle(int style);
72 virtual void SetWeight(int weight);
73 virtual void SetFaceName(const wxString& faceName);
74 virtual void SetUnderlined(bool underlined);
75 virtual void SetEncoding(wxFontEncoding encoding);
76
77 // implementation only from now on
78 // -------------------------------
79
80 int GetFontId() const;
81 virtual bool IsFree() const;
82 virtual bool RealizeResource();
83 virtual WXHANDLE GetResourceHandle();
84 virtual bool FreeResource(bool force = FALSE);
85 /*
86 virtual bool UseResource();
87 virtual bool ReleaseResource();
88 */
b823f5a1
JS
89
90protected:
0c5d3e1c
VZ
91 // common part of all ctors
92 void Init();
93
94 void Unshare();
95
96private:
97 DECLARE_DYNAMIC_CLASS(wxFont)
2bda0e17
KB
98};
99
100#endif
bbcdf8bc 101 // _WX_FONT_H_