FieldsDialog.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/externaltable/FieldsDialog.h
22 
23  \brief A Qt Dialog that allows users to modify which fields will be included in a query
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_INTERNAL_FIELDSDIALOG_H
27 #define __TERRALIB_QT_WIDGETS_INTERNAL_FIELDSDIALOG_H
28 
29 // TerraLib
30 #include "../../../dataaccess/query/Fields.h"
31 #include "../../../dataaccess/Enums.h"
32 #include "../Config.h"
33 
34 //QT
35 #include <QDialog>
36 
37 namespace Ui { class FieldsDialogForm; }
38 
39 namespace te
40 {
41  namespace qt
42  {
43  namespace widgets
44  {
45  class DoubleListWidget;
46 
47  /*!
48  \class FieldsWidget
49 
50  \brief This class represents a FieldsWidget component.
51  */
52  class TEQTWIDGETSEXPORT FieldsDialog : public QDialog
53  {
54  Q_OBJECT
55 
56  public:
57 
58  /*!
59  \brief Constructor
60 
61  It constructs a FieldsWidget.
62 
63  \param parent this widget's parent
64  \param f Window flags used to configure this widget
65 
66  */
67  FieldsDialog(QWidget* parent = 0, Qt::WindowFlags f = 0);
68 
69  /*!
70  \brief Destructor
71  */
72  ~FieldsDialog();
73 
74  /*!
75  \brief Clears the input values list
76  */
77  void clearInputValues();
78 
79  /*!
80  \brief Clears the output values list
81  */
82  void clearOutputValues();
83 
84  /*!
85  \brief Sets the input values list
86  */
87  void setInputValues(std::vector<std::string> values);
88 
89  /*!
90  \brief Sets the output values list
91  */
92 
93  void setOutputValues(std::vector<std::string> values);
94 
95  /*!
96  \brief Sets the fixed output values list
97  */
98  void setFixedOutputValues(std::vector<std::string> values, std::string iconName);
99 
100  /*!
101  \brief Sets the label displayed above the left list widget
102  */
103  void setLeftLabel(const QString& value);
104 
105  /*!
106  \brief Sets the label displayed above the right list widget
107  */
108  void setRightLabel(const QString& value);
109 
110  /*!
111  \brief Returns the selected fields
112  \note By default, all fields will be used
113  \note The caller will take ownership of the returned pointer
114  */
115  te::da::Fields* getFields();
116 
117  /*!
118  \brief Returns the selected JoinType
119  */
120  te::da::JoinType getJoinType();
121 
122  protected
123 
124  slots:
125 
126  void onOkPushButtonClicked();
127 
128  void onCancelPushButtonClicked();
129 
130  private:
131 
132  std::auto_ptr<DoubleListWidget> m_fieldsWidget; //!< The widget used to select which fields will be added to the query.
133  std::auto_ptr<Ui::FieldsDialogForm> m_ui; //!< The widget's form.
134  };
135  } // end namespace widgets
136  } // end namespace qt
137 } // end namespace te
138 
139 #endif // __TERRALIB_QT_WIDGETS_INTERNAL_FIELDSDIALOG_H
std::auto_ptr< DoubleListWidget > m_fieldsWidget
The widget used to select which fields will be added to the query.
Definition: FieldsDialog.h:132
URI C++ Library.
boost::ptr_vector< Field > Fields
Fields is just a boost::ptr_vector of Field pointers.
Definition: Fields.h:37
JoinType
The type of join in a query.
Definition: Enums.h:49
std::auto_ptr< Ui::FieldsDialogForm > m_ui
The widget's form.
Definition: FieldsDialog.h:133
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63