GlyphMarkDialog.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/GlyphMarkDialog.h
22 
23  \brief A dialog used to build a glyph mark element.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_SE_INTERNAL_GLYPHMARKDIALOG_H
27 #define __TERRALIB_QT_WIDGETS_SE_INTERNAL_GLYPHMARKDIALOG_H
28 
29 // TerraLib
30 #include "../Config.h"
31 
32 // Qt
33 #include <QDialog>
34 
35 // STL
36 #include <memory>
37 #include <string>
38 #include <vector>
39 
40 // Forward declaraion
41 namespace Ui { class GlyphMarkDialogForm; }
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 GlyphMarkWidget;
57 
58  /*!
59  \class GlyphMarkDialog
60 
61  \brief A dialog used to build a glyph mark element.
62  If you want to use this dialog, you can use commands like:
63  <code>
64  te::se::Mark* m = te::qt::widgets::GlyphMarkWidget::getMark(0, parent, "Title");
65  te::se::Mark* m = te::qt::widgets::GlyphMarkWidget::getMark(initialMark, parent, "Title");
66  ...
67  delete m;
68  </code>
69  */
70  class TEQTWIDGETSEXPORT GlyphMarkDialog : public QDialog
71  {
72  public:
73 
74  /** @name Initializer Methods
75  * Methods related to instantiation and destruction.
76  */
77  //@{
78 
79  /*! \brief Constructs a glyph mark dialog which is a child of parent, with widget flags set to f. */
80  GlyphMarkDialog(QWidget* parent = 0, Qt::WindowFlags f = 0);
81 
82  /*! \brief Destructor. */
83  ~GlyphMarkDialog();
84 
85  //@}
86 
87  public:
88 
89  /*!
90  \brief Pops up a modal mark dialog with the given window title, lets the user configure the mark,
91  and returns that mark. The mark is initially set to initial. The dialog is a child of parent.
92 
93  \param initial A initial mark element that will be used.
94  The dialog form will be update based on mark element parameters. It can be NULL.
95  \param parent Dialog parent.
96  \param title Dialog title.
97 
98  \note The dialog will NOT take the ownership of the given initial mark.
99  \note The caller will take the ownership of the returned mark.
100  \note It returns a NULL mark element if the user cancels the dialog.
101  */
102  static te::se::Mark* getMark(const te::se::Mark* initial, QWidget* parent = 0, const QString& title = "");
103 
104  /*!
105  \brief Gets the configured mark element.
106 
107  \return The configured mark element.
108 
109  \note The caller will take the ownership of the returned mark.
110  */
111  te::se::Mark* getMark() const;
112 
113  private:
114 
115  std::auto_ptr<Ui::GlyphMarkDialogForm> m_ui; //!< Dialog form.
116  te::qt::widgets::GlyphMarkWidget* m_glyphMarkWidget; //!< Glyph Mark Widget used to configure the mak element.
117  };
118 
119  } // end namespace widgets
120  } // end namespace qt
121 } // end namespace te
122 
123 #endif // __TERRALIB_QT_WIDGETS_SE_INTERNAL_GLYPHMARKDIALOG_H
std::auto_ptr< Ui::GlyphMarkDialogForm > m_ui
Dialog form.
te::qt::widgets::GlyphMarkWidget * m_glyphMarkWidget
Glyph Mark Widget used to configure the mak element.
A Mark specifies a geometric shape and applies coloring to it.
Definition: Mark.h:84
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
A dialog used to build a glyph mark element. If you want to use this dialog, you can use commands lik...