]> git.saurik.com Git - wxWidgets.git/blame - include/wx/dfb/font.h
Allow associating a validator with wxGridCellTextEditor.
[wxWidgets.git] / include / wx / dfb / font.h
CommitLineData
b3c86150
VS
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/dfb/font.h
3// Author: Vaclav Slavik
4// Purpose: wxFont declaration
5// Created: 2006-08-08
6// RCS-ID: $Id$
7// Copyright: (c) 2006 REA Elektronik GmbH
8// Licence: wxWindows licence
9/////////////////////////////////////////////////////////////////////////////
10
11#ifndef _WX_DFB_FONT_H_
12#define _WX_DFB_FONT_H_
13
52c8d32a 14#include "wx/dfb/dfbptr.h"
b3c86150
VS
15
16wxDFB_DECLARE_INTERFACE(IDirectFBFont);
17
18// ----------------------------------------------------------------------------
19// wxFont
20// ----------------------------------------------------------------------------
21
22class WXDLLIMPEXP_CORE wxFont : public wxFontBase
23{
24public:
25 wxFont() {}
b960795e
VZ
26
27 wxFont(const wxFontInfo& info)
28 {
29 Create(info.GetPointSize(),
30 info.GetFamily(),
31 info.GetStyle(),
32 info.GetWeight(),
33 info.IsUnderlined(),
34 info.GetFaceName(),
35 info.GetEncoding());
36
37 if ( info.IsUsingSizeInPixels() )
38 SetPixelSize(info.GetPixelSize());
39 }
40
b3c86150 41 wxFont(const wxNativeFontInfo& info) { Create(info); }
0c14b6c3 42#if FUTURE_WXWIN_COMPATIBILITY_3_0
b3c86150
VS
43 wxFont(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)
0c14b6c3
FM
50 {
51 (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding);
52 }
53#endif
54
55 wxFont(int size,
56 wxFontFamily family,
57 wxFontStyle style,
58 wxFontWeight weight,
59 bool underlined = false,
60 const wxString& face = wxEmptyString,
61 wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
b3c86150
VS
62 {
63 Create(size, family, style, weight, underlined, face, encoding);
64 }
03647350 65
b5791cc7
FM
66 wxFont(const wxSize& pixelSize,
67 wxFontFamily family,
68 wxFontStyle style,
69 wxFontWeight weight,
70 bool underlined = false,
71 const wxString& face = wxEmptyString,
72 wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
73 {
74 Create(10, family, style, weight, underlined, face, encoding);
75 SetPixelSize(pixelSize);
76 }
03647350 77
b3c86150 78 bool Create(int size,
0c14b6c3
FM
79 wxFontFamily family,
80 wxFontStyle style,
81 wxFontWeight weight,
b3c86150
VS
82 bool underlined = false,
83 const wxString& face = wxEmptyString,
84 wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
85 bool Create(const wxNativeFontInfo& fontinfo);
86
87 // implement base class pure virtuals
88 virtual int GetPointSize() const;
0c14b6c3
FM
89 virtual wxFontStyle GetStyle() const;
90 virtual wxFontWeight GetWeight() const;
b3c86150
VS
91 virtual wxString GetFaceName() const;
92 virtual bool GetUnderlined() const;
93 virtual wxFontEncoding GetEncoding() const;
94 virtual bool IsFixedWidth() const;
95 virtual const wxNativeFontInfo *GetNativeFontInfo() const;
96
97 virtual void SetPointSize(int pointSize);
0c14b6c3
FM
98 virtual void SetFamily(wxFontFamily family);
99 virtual void SetStyle(wxFontStyle style);
100 virtual void SetWeight(wxFontWeight weight);
b3c86150
VS
101 virtual bool SetFaceName(const wxString& faceName);
102 virtual void SetUnderlined(bool underlined);
103 virtual void SetEncoding(wxFontEncoding encoding);
104
f76c0758 105 wxDECLARE_COMMON_FONT_METHODS();
0c14b6c3 106
b3c86150 107 // implementation from now on:
d7ae4a62 108 wxIDirectFBFontPtr GetDirectFBFont(bool antialiased) const;
b3c86150
VS
109
110protected:
8f884a0d
VZ
111 virtual wxGDIRefData *CreateGDIRefData() const;
112 virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
b3c86150 113
59b7da02
VZ
114 virtual wxFontFamily DoGetFamily() const;
115
b3c86150
VS
116private:
117 DECLARE_DYNAMIC_CLASS(wxFont)
118};
119
120#endif // _WX_DFB_FONT_H_