ChartStyle.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 terralib/qt/widgets/charts/ChartStyle.h
22 
23  \brief A class used to define a chartDisplay's style
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_INTERNAL_CHARTSTYLE_H
27 #define __TERRALIB_QT_WIDGETS_INTERNAL_CHARTSTYLE_H
28 
29 //TerraLib
30 #include "../Config.h"
31 
32 //QT
33 #include <qcolor.h>
34 #include <QFont>
35 
36 //STL
37 #include <string.h>
38 
39 namespace te
40 {
41  namespace se
42  {
43  //forward declarations
44  class Fill;
45  class Font;
46  class Stroke;
47  }
48 
49  namespace qt
50  {
51 
52  namespace widgets
53  {
55  {
56 
57  public:
58 
59  /*!
60  \brief Constructor
61  */
62  ChartStyle();
63 
64  /*!
65  \brief Constructor
66 
67  \param title The style's title
68  \param titleFont The title's font
69  \param axisX The x axis' label
70  \param axisY The y axis' label
71  \param axisFont The axis' font. Will be used for both x and y axis.
72  \param fill The title's fill
73  \param stroke The title's stroke
74  \param gridChecked Boolean used to decided weather to display the grid or not
75  \param color The style's background ccolor
76  */
77  ChartStyle(QString title, QFont titleFont, QString axisX, QString axisY, QFont axisFont, te::se::Fill* fill, te::se::Stroke* stroke, bool gridChecked, QColor color);
78 
79  /*!
80  \brief Destructor.
81  */
82  ~ChartStyle();
83 
84  /*!
85  \brief Returns a reference to the style's Title
86 
87  \return A QString that represents the style's Title.
88  */
89  QString& getTitle();
90 
91  /*!
92  \brief It sets the style's title
93 
94  \param newTitle The new title.
95  */
96  void setTitle(QString newTitle);
97 
98  /*!
99  \brief Returns a reference to the title's font.
100 
101  \return A QFont that represents the title's font.
102  */
103  QFont& getTitleFont();
104 
105  /*!
106  \brief It sets the title's font.
107 
108  \param newTitle The new title's font..
109  */
110  void setTitleFont(QFont newTitleFont);
111 
112  /*!
113  \brief Returns a reference to the style's x axis label
114 
115  \return A QString that represents the style's x axis label.
116  */
117  QString& getAxisX();
118 
119  /*!
120  \brief It sets the style's x axis label
121 
122  \param newAxisX The new x axis label.
123  */
124  void setAxisX(QString newAxisX);
125 
126  /*!
127  \brief Returns a reference to the style's y axis label
128 
129  \return A QString that represents the style's y axis label.
130  */
131  QString& getAxisY();
132 
133  /*!
134  \brief It sets the style's y axis label
135 
136  \param newAxisX The new y axis label.
137  */
138  void setAxisY(QString newAxisY);
139 
140  /*!
141  \brief Returns a reference to the axis' font.
142 
143  \return A QFont that represents the axis' font.
144  */
145  QFont& getAxisFont();
146 
147  /*!
148  \brief It sets the axis' font.
149 
150  \param newAxisX The new axis' font.
151  */
152  void setAxisFont(QFont newAxisFont);
153 
154  /*!
155  \brief Returns a pointer to the style's fill
156 
157  \return A Fill type pointer to the style's fill.
158  \note The caller will not take ownership of the returned pointer.
159  */
160  te::se::Fill* getFill();
161 
162  /*!
163  \brief It sets the style's fill
164 
165  \param newFill The new fill.
166  \note It will take ownership of the given pointer
167  */
168  void setFill(te::se::Fill* newFill);
169 
170  /*!
171  \brief Returns a pointer to the style's stroke
172 
173  \return A Fill type pointer to the style's stroke.
174  \note The caller will not take ownership of the returned pointer.
175  */
176  te::se::Stroke* getStroke();
177 
178  /*!
179  \brief It sets the style's stroke
180 
181  \param newStroke The new stroke.
182  \note It will take ownership of the given pointer
183  */
184  void setStroke(te::se::Stroke* newStroke);
185 
186  /*!
187  \brief Returns a reference to the style's color
188 
189  \return A QColor that represents the style's color.
190  */
191  QColor& getColor();
192 
193  /*!
194  \brief It sets the style's color
195 
196  \param newColor The new color.
197  */
198  void setColor(QColor newColor);
199 
200  /*!
201  \brief Returns true if the grid is to be displayed, otherwise returns false
202 
203  \return A boolean used to decided weather to display the grid or not
204  */
205  bool getGridChecked();
206 
207  /*!
208  \brief It sets the boolean used to decided weather to display the grid or not
209 
210  \param newGridChecked A boolean used to decided weather to display the grid or not
211  */
212  void setGridChecked(bool newGridChecked);
213 
214  private:
215 
216  QString m_title; //!< The chart's title.
217  QFont m_titleFont; //!< The title's font.
218  QString m_axisX; //!< The chart X axis' label.
219  QString m_axisY; //!< The chart Y axis' label.
220  QFont m_axisFont; //!< The axis' font.
221  bool m_gridChecked; //!< The boolean used to decide if the chart will have a background grid .
222  te::se::Fill* m_fill; //!< The chart's fill.
223  te::se::Stroke* m_stroke; //!< The chart's stroke.
224  QColor m_backColor; //!< The chart's background color.
225 
226  };
227  } //end namespace widgets
228  } //end namespace qt
229 } // end namespace te
230 
231 #endif // __TERRALIB_QT_WIDGETS_INTERNAL_CHARTSTYLE_H
QFont m_axisFont
The axis' font.
Definition: ChartStyle.h:220
te::se::Fill * m_fill
The chart's fill.
Definition: ChartStyle.h:222
QString m_axisY
The chart Y axis' label.
Definition: ChartStyle.h:219
QString m_title
The chart's title.
Definition: ChartStyle.h:216
URI C++ Library.
QString m_axisX
The chart X axis' label.
Definition: ChartStyle.h:218
A Fill specifies the pattern for filling an area geometry.
Definition: Fill.h:59
bool m_gridChecked
The boolean used to decide if the chart will have a background grid .
Definition: ChartStyle.h:221
QFont m_titleFont
The title's font.
Definition: ChartStyle.h:217
A Stroke specifies the appearance of a linear geometry.
Definition: Stroke.h:67
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63
QColor m_backColor
The chart's background color.
Definition: ChartStyle.h:224
te::se::Stroke * m_stroke
The chart's stroke.
Definition: ChartStyle.h:223