QueryConditionWidget.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/query/QueryConditionWidget.h
22 
23  \brief This file has the Query Condition Widget class.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_QUERY_INTERNAL_QUERYCONDITIONWIDGET_H
27 #define __TERRALIB_QT_WIDGETS_QUERY_INTERNAL_QUERYCONDITIONWIDGET_H
28 
29 // TerraLib
30 #ifndef Q_MOC_RUN
31 #include "../../../dataaccess/dataset/DataSetType.h"
32 #include "../../../dataaccess/datasource/DataSource.h"
33 #include "../../../dataaccess/query/Function.h"
34 #include "../Config.h"
35 #endif
36 
37 // STL
38 #include <memory>
39 
40 // Qt
41 #include <QTreeWidgetItem>
42 #include <QWidget>
43 
44 namespace Ui { class QueryConditionWidgetForm; }
45 
46 namespace te
47 {
48  namespace qt
49  {
50  namespace widgets
51  {
52  class QueryConnectorWidget;
53  /*!
54  \class QueryConditionWidget
55 
56  \brief This class is used to define the Query Condition for a where clause.
57  */
58  class TEQTWIDGETSEXPORT QueryConditionWidget : public QWidget
59  {
60  Q_OBJECT
61 
62  public:
63 
64  QueryConditionWidget(te::da::DataSourcePtr dataSource, std::string dataSetName, te::da::DataSetType* dsType, QWidget* parent = 0, Qt::WindowFlags f = 0);
65 
67 
68  void setCurrentCondition(te::da::Function* func);
69 
70  te::da::Expression* getExpression();
71 
72  void setConnectorParent(te::qt::widgets::QueryConnectorWidget* parent);
73 
74  te::qt::widgets::QueryConnectorWidget* getConnectorParent();
75 
76  protected:
77 
78  void setOperatorsList();
79 
80  void setAttributeList();
81 
82  void fillValuesComboBox(QStringList& list);
83 
84  std::string getAliasName(std::string fullName);
85 
86  signals:
87 
88  void addConnectorClicked(QWidget* owner, QWidget* parent);
89 
90  void removeConnectorClicked(QWidget* owner, QWidget* parent);
91 
92  protected slots:
93 
94  void onAddToolButtonClicked();
95 
96  void onRemoveToolButtonClicked();
97 
98  void onLoadAttrsToolButtonClicked();
99 
100  private:
101 
102  std::unique_ptr<Ui::QueryConditionWidgetForm> m_ui;
103 
105 
107 
108  std::string m_dataSetName;
109 
110  std::unique_ptr<te::da::DataSetType> m_dsType;
111 
112  public:
113 
114  QTreeWidgetItem * m_item;
115  };
116 
117  } // end namespace widgets
118  } // end namespace qt
119 } // end namespace te
120 
121 #endif // __TERRALIB_QT_WIDGETS_QUERY_INTERNAL_QUERYCONDITIONWIDGET_H
std::unique_ptr< Ui::QueryConditionWidgetForm > m_ui
#define slots
std::unique_ptr< te::da::DataSetType > m_dsType
boost::shared_ptr< DataSource > DataSourcePtr
Definition: DataSource.h:1449
A class that models the description of a dataset.
Definition: DataSetType.h:72
This class is used to define the Query Connector for a where clause.
This is an abstract class that models a query expression.
Definition: Expression.h:47
TerraLib.
A class that models a Function expression.
Definition: Function.h:47
This class is used to define the Query Condition for a where clause.
te::qt::widgets::QueryConnectorWidget * m_parent
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63