All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Font.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file Font.h
22 
23  \brief Class specifies a font.
24 
25  \ingroup layout
26 */
27 
28 #ifndef __TERRALIB_LAYOUT_INTERNAL_FONT_H
29 #define __TERRALIB_LAYOUT_INTERNAL_FONT_H
30 
31 // TerraLib
32 #include "enum/AbstractType.h"
33 
34 // STL
35 #include <string>
36 
37 namespace te
38 {
39  namespace layout
40  {
41  /*!
42  \brief Class specifies a font.
43 
44  \ingroup layout
45  */
46  class Font
47  {
48  public:
49 
50  /*!
51  \brief Constructor
52  */
53  Font();
54 
55  /*!
56  \brief Destructor
57  */
58  virtual ~Font();
59 
60  /*!
61  \brief Returns font family name.
62 
63  \param font family name
64  */
65  void setFamily(std::string family);
66 
67  /*!
68  \brief Sets font family name.
69 
70  \return font family name
71  */
72  std::string getFamily();
73 
74  /*!
75  \brief Sets point size of the font.
76 
77  \param point size of the font
78  */
79  void setPointSize(int point);
80 
81  /*!
82  \brief Returns point size of the font.
83 
84  \return point size of the font
85  */
86  int getPointSize();
87 
88  /*!
89  \brief Sets font with bold style.
90 
91  \param true if font use bold, false otherwise
92  */
93  void setBold(bool bold);
94 
95  /*!
96  \brief Returns true if font use bold, false otherwise
97 
98  \return true if font use bold, false otherwise
99  */
100  bool isBold();
101 
102  /*!
103  \brief Sets font with italic style.
104 
105  \param true if font use italic, false otherwise
106  */
107  void setItalic(bool italic);
108 
109  /*!
110  \brief Returns true if font use italic, false otherwise
111 
112  \return true if font use italic, false otherwise
113  */
114  bool isItalic();
115 
116  /*!
117  \brief Sets font with underline style.
118 
119  \param true if font use underline, false otherwise
120  */
121  void setUnderline(bool underline);
122 
123  /*!
124  \brief Returns true if font use underline, false otherwise
125 
126  \return true if font use underline, false otherwise
127  */
128  bool isUnderline();
129 
130  /*!
131  \brief Sets font with strikeout style.
132 
133  \param true if font use strikeout, false otherwise
134  */
135  void setStrikeout(bool strikeout);
136 
137  /*!
138  \brief Returns true if font use strikeout, false otherwise
139 
140  \return true if font use strikeout, false otherwise
141  */
142  bool isStrikeout();
143 
144  /*!
145  \brief Sets font with kerning style.
146 
147  \param true if font use kerning, false otherwise
148  */
149  void setKerning(bool kerning);
150 
151  /*!
152  \brief Returns true if font use kerning, false otherwise
153 
154  \return true if font use kerning, false otherwise
155  */
156  bool isKerning();
157 
158  /*!
159  \brief Serialize font object.
160 
161  \return font object serialized
162  */
163  virtual std::string toString();
164 
165  /*!
166  \brief Sets this object state from a string.
167 
168  \param font object serialized
169  */
170  virtual void fromString(std::string font);
171 
172  protected:
173 
174  /*!
175  \brief State boolean to string.
176 
177  \param font style option
178  */
179  virtual std::string toString(bool flag);
180 
181  /*!
182  \brief State string to boolean.
183 
184  \param font style option
185  */
186  virtual bool toBool(std::string str);
187 
188  std::string m_family; //!< font family name
189  int m_pointSize; //!< point size of the font
190  bool m_bold; //!< true if font use bold, false otherwise
191  bool m_italic; //!< true if font use italic, false otherwise
192  bool m_underline; //!< true if font use underline, false otherwise
193  bool m_strikeout; //!< true if font use strikeout, false otherwise
194  bool m_kerning; //!< true if font use kerning, false otherwise
196  };
197  }
198 }
199 
200 #endif
bool m_bold
true if font use bold, false otherwise
Definition: Font.h:190
Class specifies a font.
Definition: Font.h:46
bool isBold()
Returns true if font use bold, false otherwise.
Definition: Font.cpp:81
bool isStrikeout()
Returns true if font use strikeout, false otherwise.
Definition: Font.cpp:111
void setStrikeout(bool strikeout)
Sets font with strikeout style.
Definition: Font.cpp:106
void setKerning(bool kerning)
Sets font with kerning style.
Definition: Font.cpp:116
int getPointSize()
Returns point size of the font.
Definition: Font.cpp:71
std::string m_family
font family name
Definition: Font.h:188
virtual bool toBool(std::string str)
State string to boolean.
Definition: Font.cpp:177
bool m_strikeout
true if font use strikeout, false otherwise
Definition: Font.h:193
bool m_underline
true if font use underline, false otherwise
Definition: Font.h:192
void setPointSize(int point)
Sets point size of the font.
Definition: Font.cpp:66
Font()
Constructor.
Definition: Font.cpp:38
virtual void fromString(std::string font)
Sets this object state from a string.
Definition: Font.cpp:150
bool m_kerning
true if font use kerning, false otherwise
Definition: Font.h:194
void setBold(bool bold)
Sets font with bold style.
Definition: Font.cpp:76
void setFamily(std::string family)
Returns font family name.
Definition: Font.cpp:56
void setUnderline(bool underline)
Sets font with underline style.
Definition: Font.cpp:96
bool isItalic()
Returns true if font use italic, false otherwise.
Definition: Font.cpp:91
bool isUnderline()
Returns true if font use underline, false otherwise.
Definition: Font.cpp:101
virtual ~Font()
Destructor.
Definition: Font.cpp:51
LayoutAlign m_textAlign
Definition: Font.h:195
void setItalic(bool italic)
Sets font with italic style.
Definition: Font.cpp:86
std::string getFamily()
Sets font family name.
Definition: Font.cpp:61
int m_pointSize
point size of the font
Definition: Font.h:189
virtual std::string toString()
Serialize font object.
Definition: Font.cpp:126
bool m_italic
true if font use italic, false otherwise
Definition: Font.h:191
LayoutAlign
Enum TdkAbstractComponentType. This is the enumeration of the components types.
Definition: AbstractType.h:92
bool isKerning()
Returns true if font use kerning, false otherwise.
Definition: Font.cpp:121