]> git.saurik.com Git - wxWidgets.git/blame - include/wx/mac/carbon/font.h
reuse operator bool() check in compatibility_iterator::IndexOf() instead of rewriting it
[wxWidgets.git] / include / wx / mac / carbon / font.h
CommitLineData
8cf73271
SC
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
65571936 9// Licence: wxWindows licence
8cf73271
SC
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_FONT_H_
13#define _WX_FONT_H_
14
8cf73271
SC
15// ----------------------------------------------------------------------------
16// wxFont
17// ----------------------------------------------------------------------------
18
19class WXDLLEXPORT wxFont : public wxFontBase
20{
21public:
22 // ctors and such
f8855e47 23 wxFont() { }
8cf73271
SC
24
25 wxFont(int size,
26 int family,
27 int style,
28 int weight,
29 bool underlined = FALSE,
30 const wxString& face = wxEmptyString,
31 wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
32 {
8cf73271
SC
33 (void)Create(size, family, style, weight, underlined, face, encoding);
34 }
35
36 wxFont(const wxNativeFontInfo& info)
37 {
8cf73271
SC
38 (void)Create(info);
39 }
40
41 wxFont(const wxString& fontDesc);
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 bool Create(const wxNativeFontInfo& info);
52
4f305456
SC
53 bool MacCreateThemeFont( wxUint16 themeFontID ) ;
54
8cf73271
SC
55 virtual ~wxFont();
56
8cf73271
SC
57 // implement base class pure virtuals
58 virtual int GetPointSize() const;
59 virtual int GetFamily() const;
60 virtual int GetStyle() const;
61 virtual int GetWeight() const;
62 virtual bool GetUnderlined() const;
63 virtual wxString GetFaceName() const;
64 virtual wxFontEncoding GetEncoding() const;
65 virtual const wxNativeFontInfo *GetNativeFontInfo() const;
66
67 virtual void SetPointSize(int pointSize);
68 virtual void SetFamily(int family);
69 virtual void SetStyle(int style);
70 virtual void SetWeight(int weight);
71 virtual void SetFaceName(const wxString& faceName);
72 virtual void SetUnderlined(bool underlined);
73 virtual void SetEncoding(wxFontEncoding encoding);
74
75 // implementation only from now on
76 // -------------------------------
77
78 virtual bool RealizeResource();
79
80 // Unofficial API, don't use
81 virtual void SetNoAntiAliasing( bool noAA = TRUE ) ;
5ac2e80c 82 virtual bool GetNoAntiAliasing() const ;
8cf73271
SC
83
84 // Mac-specific, risks to change, don't use in portable code
7bca6cef
SC
85
86 // 'old' Quickdraw accessors
87
4f305456
SC
88 short MacGetFontNum() const;
89 short MacGetFontSize() const;
90 wxByte MacGetFontStyle() const;
7bca6cef
SC
91
92 // 'new' ATSUI accessors
93
4f305456
SC
94 wxUint32 MacGetATSUFontID() const;
95 wxUint32 MacGetATSUAdditionalQDStyles() const;
96 wxUint16 MacGetThemeFontID() const ;
7bca6cef
SC
97 // Returns an ATSUStyle not ATSUStyle*
98 void* MacGetATSUStyle() const ;
99
8cf73271 100protected:
8cf73271
SC
101 void Unshare();
102
103private:
104 DECLARE_DYNAMIC_CLASS(wxFont)
105};
106
107#endif
108 // _WX_FONT_H_