GlyphMarkWidget.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/GlyphMarkWidget.h
22 
23  \brief A widget used to build a mark element represented by a glyph.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_SE_INTERNAL_GLYPHMARKWIDGET_H
27 #define __TERRALIB_QT_WIDGETS_SE_INTERNAL_GLYPHMARKWIDGET_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 GlyphMarkWidgetForm; }
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 CharMapWidget;
58 
59  /*!
60  \class GlyphMarkWidget
61 
62  \brief A widget used to build a mark element represented by a glyph.
63  */
64  class TEQTWIDGETSEXPORT GlyphMarkWidget : 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 glyph mark widget which is a child of parent, with widget flags set to f. */
76  GlyphMarkWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
77 
78  /*! \brief Destructor. */
79  ~GlyphMarkWidget();
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  /*! \brief Updates the mark well-known name enconding selected font and selected character. */
110  void updateMarkName();
111 
112  protected slots:
113 
114  void onCurrentFontChanged(const QFont& font);
115 
116  void onCharSelected(const unsigned int& charCode);
117 
118  void onFillChanged();
119 
120  signals:
121 
122  /*! This signal is emitted when the internal mark element is changed. */
123  void markChanged();
124 
125  private:
126 
127  std::auto_ptr<Ui::GlyphMarkWidgetForm> m_ui; //!< Widget form.
128  te::qt::widgets::BasicFillWidget* m_fillWidget; //!< Basic Fill Widget used to configure the mark fill element.
129  te::qt::widgets::CharMapWidget* m_charMapWidget; //!< Character map widget.
130  te::se::Mark* m_mark; //!< Mark element that will be configured by this widget.
131  };
132 
133  } // end namespace widgets
134  } // end namespace qt
135 } // end namespace te
136 
137 #endif // __TERRALIB_QT_WIDGETS_SE_INTERNAL_GLYPHMARKWIDGET_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
A widget used to show the set of characters of a specified font.
Definition: CharMapWidget.h:46
te::qt::widgets::BasicFillWidget * m_fillWidget
Basic Fill Widget used to configure the mark fill element.
A widget used to build a mark element represented by a glyph.
URI C++ Library.
#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::CharMapWidget * m_charMapWidget
Character map widget.
std::auto_ptr< Ui::GlyphMarkWidgetForm > m_ui
Widget form.
te::se::Mark * m_mark
Mark element that will be configured by this widget.