BasicFillWidget.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/BasicFillWidget.h
22 
23  \brief A widget used to build a basic fill element.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_SE_INTERNAL_BASICFILLWIDGET_H
27 #define __TERRALIB_QT_WIDGETS_SE_INTERNAL_BASICFILLWIDGET_H
28 
29 // TerraLib
30 #include "../Config.h"
31 #include "AbstractFillWidget.h"
32 
33 // STL
34 #include <memory>
35 
36 // Forward declaraion
37 namespace Ui { class BasicFillWidgetForm; }
38 
39 namespace te
40 {
41 // Forward declarations
42  namespace se
43  {
44  class Fill;
45  }
46 
47  namespace qt
48  {
49  namespace widgets
50  {
51 // Forward declarations
52  class ColorPickerToolButton;
53 
54  /*!
55  \class BasicFillWidget
56 
57  \brief A widget used to build a basic fill element.
58 
59  \sa AbstractFillWidget, GraphicFillWidget
60  */
62  {
63  Q_OBJECT
64 
65  public:
66 
67  /** @name Initializer Methods
68  * Methods related to instantiation and destruction.
69  */
70  //@{
71 
72  /*! \brief Constructs a basic fill widget which is a child of parent, with widget flags set to f. */
73  BasicFillWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
74 
75  /*! \brief Destructor. */
76  ~BasicFillWidget();
77 
78  //@}
79 
80  public:
81 
82  /** @name Re-implementation of Pure Virtual Method
83  * AbstractFillWidget methods.
84  */
85  //@{
86 
87  bool setFill(const te::se::Fill* fill);
88 
89  te::se::Fill* getFill() const;
90 
91  QString getFillType() const;
92 
93  //@}
94 
95  protected:
96 
97  /*! \brief Internal method to initialize the widget (e.g.: color, combos, icons, etc.) */
98  void initialize();
99 
100  /*! \brief Updates the widget form based on internal fill element. */
101  void updateUi();
102 
103  /*! \brief Updates the widget form element used to visualize the fill color. */
104  void updateUiFillColor();
105 
106  protected slots:
107 
108  void onColorChanged(const QColor& color);
109 
110  void onFillOpacitySliderValueChanged(int value);
111 
112  signals:
113 
114  /*! This signal is emitted when the internal fill element is changed. */
115  void fillChanged();
116 
117  private:
118 
119  std::auto_ptr<Ui::BasicFillWidgetForm> m_ui; //!< Widget form.
120  ColorPickerToolButton* m_colorPicker; //!< Widget used to pick a color.
121  QColor m_color; //!< Auxiliary color attribute.
122  te::se::Fill* m_fill; //!< Fill element that will be configured by this widget.
123  };
124 
125  } // end namespace widgets
126  } // end namespace qt
127 } // end namespace te
128 
129 #endif // __TERRALIB_QT_WIDGETS_SE_INTERNAL_BASICFILLWIDGET_H
A widget used to build a basic fill element.
QColor m_color
Auxiliary color attribute.
Abstract class that represents a widget that can be used to build a fill element. ...
Abstract class that represents a widget that can be used to build a fill element. ...
ColorPickerToolButton * m_colorPicker
Widget used to pick a color.
Custom tool button used to pick a color.
te::se::Fill * m_fill
Fill element that will be configured by this widget.
URI C++ Library.
A Fill specifies the pattern for filling an area geometry.
Definition: Fill.h:59
std::auto_ptr< Ui::BasicFillWidgetForm > m_ui
Widget form.
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63