WellKnownGraphicWidget.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/WellKnownGraphicWidget.h
22 
23  \brief A widget used to build a graphic associate with a well-known mark element.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_SE_INTERNAL_WELLKNOWNGRAPHICWIDGET_H
27 #define __TERRALIB_QT_WIDGETS_SE_INTERNAL_WELLKNOWNGRAPHICWIDGET_H
28 
29 // TerraLib
30 #include "../Config.h"
31 #include "AbstractGraphicWidget.h"
32 
33 // STL
34 #include <memory>
35 
36 // Forward declaraion
37 namespace Ui { class WellKnownGraphicWidgetForm; }
38 
39 namespace te
40 {
41  namespace qt
42  {
43  namespace widgets
44  {
45 // Forward declarations
46  class WellKnownMarkWidget;
47 
48  /*!
49  \class WellKnownGraphicWidget
50 
51  \brief A widget used to build a graphic associate with a well-known mark element.
52  */
54  {
55  Q_OBJECT
56 
57  public:
58 
59  /** @name Initializer Methods
60  * Methods related to instantiation and destruction.
61  */
62  //@{
63 
64  /*! \brief Constructs a well known graphic widget which is a child of parent, with widget flags set to f. */
65  WellKnownGraphicWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
66 
67  /*! \brief Destructor. */
69 
70  //@}
71 
72  public:
73 
74  /** @name Re-implementation of Pure Virtual Method
75  * AbstractGraphicWidget methods.
76  */
77  //@{
78 
79  bool setGraphic(const te::se::Graphic* graphic);
80 
81  QString getGraphicType() const;
82 
83  QIcon getGraphicIcon(const QSize& size) const;
84 
85  //@}
86 
87  protected slots:
88 
89  void onMarkChanged();
90 
91  void onGraphicDisplacementChanged(const QString& text);
92 
93  void onGraphicAnchorPointChanged(const QString& text);
94 
95  private:
96 
97  /*! \brief Updates the widget form based on internal graphic element. */
98  void updateUi();
99 
100  private:
101 
102  std::auto_ptr<Ui::WellKnownGraphicWidgetForm> m_ui; //!< Widget form.
103  te::qt::widgets::WellKnownMarkWidget* m_markWidget; //!< Well known mark Widget used to configure the mark element.
104  };
105 
106  } // end namespace widgets
107  } // end namespace qt
108 } // end namespace te
109 
110 #endif // __TERRALIB_QT_WIDGETS_SE_INTERNAL_WELLKNOWNGRAPHICWIDGET_H
te::qt::widgets::WellKnownMarkWidget * m_markWidget
Well known mark Widget used to configure the mark element.
A Graphic is a graphic symbol with an inherent shape, color(s), and possibly size.
Definition: Graphic.h:66
URI C++ Library.
Abstract class that represents a widget that can be used to build a graphic element.
#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 build a well known mark element.
std::auto_ptr< Ui::WellKnownGraphicWidgetForm > m_ui
Widget form.
A widget used to build a graphic associate with a well-known mark element.
Abstract class that represents a widget that can be used to build a graphic element.