LocalImagePropertyItem.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/LocalImagePropertyItem.h
22 
23  \brief A widget used to define a local image graphic for a se symbolizer.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_SE_INTERNAL_LOCALIMAGEPROPERTYITEM_H
27 #define __TERRALIB_QT_WIDGETS_SE_INTERNAL_LOCALIMAGEPROPERTYITEM_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 ExternalGraphic;
39  }
40 
41  namespace qt
42  {
43  namespace widgets
44  {
45  /*!
46  \class LocalImagePropertyItem
47 
48  \brief A widget used to define a local image graphic for a se symbolizer.
49 
50  */
51 
53  {
54  Q_OBJECT
55 
56  public:
57  /** @name Initializer Methods
58  * Methods related to instantiation and destruction.
59  */
60  //@{
61 
62  /*! \brief Constructor */
63  LocalImagePropertyItem(QtTreePropertyBrowser* pb, QColor c = QColor());
64 
65  /*! \brief Destructor. */
67 
68  //@}
69 
70  public:
71 
72  /*!
73  \brief Sets a mark element to this widget.
74 
75  \param mark A valid mark element.
76 
77  \note The widget will NOT take the ownership of the given mark.
78  \note The widget form will be update based on given mark parameters.
79  */
80  void setExternalGraphic(const te::se::ExternalGraphic* eg);
81 
82  /*!
83  \brief Gets the configured mark element.
84 
85  \return The configured mark element.
86 
87  \note The caller will take the ownership of the returned mark.
88  */
89  te::se::ExternalGraphic* getExternalGraphic() const;
90 
91  protected:
92 
93  /*! \brief Updates the widget form based on internal mark element. */
94  void updateUi();
95 
96  public slots:
97 
98  virtual void valueChanged(QtProperty* p, const QString &value);
99 
100  void setDlg(QWidget *parent, QtProperty * prop);
101 
102  void showImgDlg();
103 
104  signals:
105 
106  /*!
107  \brief This signal is emitted when the internal external graphic element is changed.
108 
109  \param size The size of selected image.
110  */
111  void externalGraphicChanged();
112 
113  protected:
114 
115  QtProperty* m_imgProperty;
116 
117  QWidget* m_dlg;
118 
119  te::se::ExternalGraphic* m_eg; //!< Mark element that will be configured by this widget.
120 
121  bool m_update;
122  };
123  }
124  }
125 }
126 
127 #endif //__TERRALIB_QT_WIDGETS_SE_INTERNAL_LOCALIMAGEPROPERTYITEM_H
A widget used to define the main property items that can be used to describe a se object...
te::se::ExternalGraphic * m_eg
Mark element that will be configured by this widget.
The ExternalGraphic allows a reference to be made to an external graphic file with a Web URL or to in...
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
A widget used to define a local image graphic for a se symbolizer.