Loading...
Searching...
No Matches
BasicStrokeDialog.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/BasicStrokeDialog.h
22
23 \brief A dialog used to build a basic stroke element.
24*/
25
26#ifndef __TERRALIB_QT_WIDGETS_SE_INTERNAL_BASICSTROKEDIALOG_H
27#define __TERRALIB_QT_WIDGETS_SE_INTERNAL_BASICSTROKEDIALOG_H
28
29// TerraLib
30#include "../Config.h"
31
32// Qt
33#include <QDialog>
34
35// STL
36#include <memory>
37
38// Forward declaraion
39namespace Ui { class BasicStrokeDialogForm; }
40
41namespace te
42{
43// Forward declarations
44 namespace se
45 {
46 class Stroke;
47 }
48
49 namespace qt
50 {
51 namespace widgets
52 {
53// Forward declarations
54 class BasicStrokeWidget;
55
56 /*!
57 \class BasicStrokeDialog
58
59 \brief A dialog used to build a basic stroke element.
60 If you want to use this dialog, you can use commands like:
61 <code>
62 te::se::Stroke* s = te::qt::widgets::BasicStrokeDialog::getStroke(0, parent, "Title");
63 te::se::Stroke* s = te::qt::widgets::BasicStrokeDialog::getStroke(initialStroke, parent, "Title");
64 ...
65 delete s;
66 </code>
67 */
68 class TEQTWIDGETSEXPORT BasicStrokeDialog : public QDialog
69 {
70 public:
71
72 /** @name Initializer Methods
73 * Methods related to instantiation and destruction.
74 */
75 //@{
76
77 /*! \brief Constructs a basic stroke dialog which is a child of parent, with widget flags set to f. */
78 BasicStrokeDialog(QWidget* parent = 0, Qt::WindowFlags f = 0);
79
80 /*! \brief Destructor. */
82
83 //@}
84
85 public:
86
87 /*!
88 \brief Pops up a modal basic stroke dialog with the given window title, lets the user configure the stroke,
89 and returns that stroke. The stroke is initially set to initial. The dialog is a child of parent.
90
91 \param initial A initial stroke element that will be used. The dialog form will be update based on
92 stroke element parameters. It can be NULL.
93 \param parent Dialog parent.
94 \param title Dialog title.
95
96 \note The dialog will NOT take the ownership of the given initial stroke.
97 \note The caller will take the ownership of the returned stroke.
98 \note It returns a NULL stroke element if the user cancels the dialog.
99 */
100 static te::se::Stroke* getStroke(const te::se::Stroke* initial, QWidget* parent = 0, const QString& title = "");
101
102 /*!
103 \brief Gets the configured stroke element.
104
105 \return The configured stroke element.
106
107 \note The caller will take the ownership of the returned stroke.
108 */
110
111 private:
112
113 std::unique_ptr<Ui::BasicStrokeDialogForm> m_ui; //!< Dialog form.
114 te::qt::widgets::BasicStrokeWidget* m_strokeWidget; //!< Basic Stroke Widget used to configure the stroke element.
115 };
116
117 } // end namespace widgets
118 } // end namespace qt
119} // end namespace te
120
121#endif // __TERRALIB_QT_WIDGETS_SE_INTERNAL_BASICSTROKEDIALOG_H
A dialog used to build a basic stroke element. If you want to use this dialog, you can use commands l...
te::qt::widgets::BasicStrokeWidget * m_strokeWidget
Basic Stroke Widget used to configure the stroke element.
static te::se::Stroke * getStroke(const te::se::Stroke *initial, QWidget *parent=0, const QString &title="")
Pops up a modal basic stroke dialog with the given window title, lets the user configure the stroke,...
te::se::Stroke * getStroke() const
Gets the configured stroke element.
BasicStrokeDialog(QWidget *parent=0, Qt::WindowFlags f=0)
Constructs a basic stroke dialog which is a child of parent, with widget flags set to f.
std::unique_ptr< Ui::BasicStrokeDialogForm > m_ui
Dialog form.
A widget used to build a basic stroke element.
A Stroke specifies the appearance of a linear geometry.
Definition: Stroke.h:68
TerraLib.
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63