]> git.saurik.com Git - wxWidgets.git/blame - include/wx/os2/font.h
wxStrnicmp() function is not defined under windows, so I've provided a workaround...
[wxWidgets.git] / include / wx / os2 / font.h
CommitLineData
0e320a79
DW
1/////////////////////////////////////////////////////////////////////////////
2// Name: font.h
3// Purpose: wxFont class
21802234 4// Author: David Webster
0e320a79 5// Modified by:
21802234 6// Created: 10/06/99
0e320a79 7// RCS-ID: $Id$
21802234
DW
8// Copyright: (c) David Webster
9// Licence: wxWindows licence
0e320a79
DW
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_FONT_H_
13#define _WX_FONT_H_
14
0e320a79
DW
15#include "wx/gdiobj.h"
16
21802234
DW
17WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString;
18
19// ----------------------------------------------------------------------------
20// wxFont
21// ----------------------------------------------------------------------------
0e320a79 22
21802234 23class WXDLLEXPORT wxFont : public wxFontBase
0e320a79 24{
0e320a79 25public:
21802234
DW
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 bool Create(int size,
44 int family,
45 int style,
46 int weight,
47 bool underlined = FALSE,
48 const wxString& face = wxEmptyString,
49 wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
50
51 virtual ~wxFont();
52
53 // assignment
54 wxFont& operator=(const wxFont& font);
55
56 // implement base class pure virtuals
57 virtual int GetPointSize() const;
58 virtual int GetFamily() const;
59 virtual int GetStyle() const;
60 virtual int GetWeight() const;
61 virtual bool GetUnderlined() const;
62 virtual wxString GetFaceName() const;
63 virtual wxFontEncoding GetEncoding() const;
64
65 virtual void SetPointSize(int pointSize);
66 virtual void SetFamily(int family);
67 virtual void SetStyle(int style);
68 virtual void SetWeight(int weight);
69 virtual void SetFaceName(const wxString& faceName);
70 virtual void SetUnderlined(bool underlined);
71 virtual void SetEncoding(wxFontEncoding encoding);
72
73 // implementation only from now on
74 // -------------------------------
75
76 int GetFontId() const;
77 virtual bool IsFree() const;
78 virtual bool RealizeResource();
79 virtual WXHANDLE GetResourceHandle();
80 virtual bool FreeResource(bool force = FALSE);
81 /*
82 virtual bool UseResource();
83 virtual bool ReleaseResource();
84 */
0e320a79 85
21802234
DW
86protected:
87 // common part of all ctors
88 void Init();
0e320a79 89
21802234 90 void Unshare();
0e320a79 91
21802234
DW
92private:
93 DECLARE_DYNAMIC_CLASS(wxFont)
0e320a79
DW
94};
95
96#endif
97 // _WX_FONT_H_