WellKnownMarkWidget.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/se/WellKnownMarkWidget.h
22 
23  \brief A widget used to build a well known mark element.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_SE_INTERNAL_WELLKNOWNMARKWIDGET_H
27 #define __TERRALIB_QT_WIDGETS_SE_INTERNAL_WELLKNOWNMARKWIDGET_H
28 
29 // TerraLib
30 #include "../Config.h"
31 
32 // Qt
33 #include <QWidget>
34 
35 // STL
36 #include <memory>
37 #include <string>
38 #include <vector>
39 
40 // Forward declaraion
41 namespace Ui { class WellKnownMarkWidgetForm; }
42 
43 namespace te
44 {
45 // Forward declarations
46  namespace se
47  {
48  class Mark;
49  }
50 
51  namespace qt
52  {
53  namespace widgets
54  {
55 // Forward declarations
56  class BasicFillWidget;
57  class BasicStrokeWidget;
58 
59  /*!
60  \class WellKnownMarkWidget
61 
62  \brief A widget used to build a well known mark element.
63  */
64  class TEQTWIDGETSEXPORT WellKnownMarkWidget : public QWidget
65  {
66  Q_OBJECT
67 
68  public:
69 
70  /** @name Initializer Methods
71  * Methods related to instantiation and destruction.
72  */
73  //@{
74 
75  /*! \brief Constructs a well known mark widget which is a child of parent, with widget flags set to f. */
76  WellKnownMarkWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
77 
78  /*! \brief Destructor. */
80 
81  //@}
82 
83  public:
84 
85  /*!
86  \brief Sets a mark element to this widget.
87 
88  \param mark A valid mark element.
89 
90  \note The widget will NOT take the ownership of the given mark.
91  \note The widget form will be update based on given mark parameters.
92  */
93  void setMark(const te::se::Mark* mark);
94 
95  /*!
96  \brief Gets the configured mark element.
97 
98  \return The configured mark element.
99 
100  \note The caller will take the ownership of the returned mark.
101  */
102  te::se::Mark* getMark() const;
103 
104  protected:
105 
106  /*! \brief Updates the widget form based on internal mark element. */
107  void updateUi();
108 
109  protected slots:
110 
111  void onMarkTypeComboBoxCurrentIndexChanged(const QString& currentText);
112 
113  void onStrokeChanged();
114 
115  void onStrokeGroupBoxToggled(bool on);
116 
117  void onFillChanged();
118 
119  void onFillGroupBoxToggled(bool on);
120 
121  signals:
122 
123  /*! This signal is emitted when the internal mark element is changed. */
124  void markChanged();
125 
126  private:
127 
128  std::auto_ptr<Ui::WellKnownMarkWidgetForm> m_ui; //!< Widget form.
129  te::qt::widgets::BasicFillWidget* m_fillWidget; //!< Basic Fill Widget used to configure the mark fill element.
130  te::qt::widgets::BasicStrokeWidget* m_strokeWidget; //!< Basic Stroke Widget used to configure the mark stroke element.
131  te::se::Mark* m_mark; //!< Mark element that will be configured by this widget.
132  std::vector<std::string> m_supportedMarks; //!< Names of supported marks.
133  };
134 
135  } // end namespace widgets
136  } // end namespace qt
137 } // end namespace te
138 
139 #endif // __TERRALIB_QT_WIDGETS_SE_INTERNAL_WELLKNOWNMARKWIDGET_H
A widget used to build a basic fill element.
A Mark specifies a geometric shape and applies coloring to it.
Definition: Mark.h:84
te::qt::widgets::BasicStrokeWidget * m_strokeWidget
Basic Stroke Widget used to configure the mark stroke element.
std::auto_ptr< Ui::WellKnownMarkWidgetForm > m_ui
Widget form.
A widget used to build a basic stroke element.
URI C++ Library.
std::vector< std::string > m_supportedMarks
Names of supported marks.
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63
te::qt::widgets::BasicFillWidget * m_fillWidget
Basic Fill Widget used to configure the mark fill element.
A widget used to build a well known mark element.
te::se::Mark * m_mark
Mark element that will be configured by this widget.