GlyphMarkPropertyItem.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/GlyphMarkPropertyItem.h
22 
23  \brief A widget used to define a glyph object.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_SE_INTERNAL_GLYPHMARKPROPERTYITEM_H
27 #define __TERRALIB_QT_WIDGETS_SE_INTERNAL_GLYPHMARKPROPERTYITEM_H
28 
29 // TerraLib
30 #include "../Config.h"
31 #include "../propertybrowser/AbstractPropertyItem.h"
32 
33 namespace te
34 {
35 // Forward declarations
36  namespace se
37  {
38  class Mark;
39  }
40 
41  namespace qt
42  {
43  namespace widgets
44  {
45  class BasicFillPropertyItem;
46 
47  /*!
48  \class GlyphMarkPropertyItem
49 
50  \brief A widget used to define a glyph object.
51 
52  */
53 
55  {
56  Q_OBJECT
57 
58  public:
59  /** @name Initializer Methods
60  * Methods related to instantiation and destruction.
61  */
62  //@{
63 
64  /*! \brief Constructor */
65  GlyphMarkPropertyItem(QtTreePropertyBrowser* pb, QColor c = QColor());
66 
67  /*! \brief Destructor. */
69 
70  //@}
71 
72  public:
73 
74  /*!
75  \brief Sets a mark element to this widget.
76 
77  \param mark A valid mark element.
78 
79  \note The widget will NOT take the ownership of the given mark.
80  \note The widget form will be update based on given mark parameters.
81  */
82  void setMark(const te::se::Mark* mark);
83 
84  /*!
85  \brief Gets the configured mark element.
86 
87  \return The configured mark element.
88 
89  \note The caller will take the ownership of the returned mark.
90  */
91  te::se::Mark* getMark() const;
92 
93  protected:
94 
95  /*! \brief Updates the widget form based on internal mark element. */
96  void updateUi();
97 
98  /*! \brief Updates the mark well-known name enconding selected font and selected character. */
99  void updateMarkName();
100 
101  public slots:
102 
103  virtual void valueChanged(QtProperty* p, const QFont &value);
104  virtual void valueChanged(QtProperty* p, const QString &value);
105 
106  void setDlg(QWidget *parent, QtProperty * prop);
107 
108  void showCharMapDlg();
109 
110  void charMapSelected(const unsigned int& charCode);
111 
112  void onFillChanged();
113 
114  signals:
115 
116  void markChanged();
117 
118  protected:
119 
120  QtProperty* m_fontProperty;
121  QtProperty* m_charProperty;
122 
123  QWidget* m_charDlg;
124 
126 
127  te::se::Mark* m_mark; //!< Mark element that will be configured by this widget.
128 
129  bool m_update;
130  };
131  }
132  }
133 }
134 
135 #endif //__TERRALIB_QT_WIDGETS_SE_INTERNAL_GLYPHMARKPROPERTYITEM_H
A widget used to define a glyph object.
A widget used to define the main property items that can be used to describe a se object...
A Mark specifies a geometric shape and applies coloring to it.
Definition: Mark.h:84
te::qt::widgets::BasicFillPropertyItem * m_basicFill
URI C++ Library.
te::se::Mark * m_mark
Mark element that will be configured by this widget.
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63
A widget used to define the basic fill se object.