Loading...
Searching...
No Matches
TableLinkDialog.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/TableLinkDialog.h
22
23 \brief A Qt dialog that allows users to create a new query layer based on the information of two distinct datasets
24*/
25
26#ifndef __TERRALIB_QT_WIDGETS_INTERNAL_TABLELINKDIALOG_H
27#define __TERRALIB_QT_WIDGETS_INTERNAL_TABLELINKDIALOG_H
28
29// TerraLib
30#ifndef Q_MOC_RUN
31#include "../../../dataaccess/datasource/DataSource.h"
32#include "../../../dataaccess/query/Fields.h"
33#include "../../../maptools/DataSetLayer.h"
34#endif
35#include "../Config.h"
36
37//QT
38#include <QDialog>
39
40namespace Ui { class TableLinkDialogForm; }
41
42namespace te
43{
44 namespace da { class Join;
45 class Select; }
46
47 namespace qt
48 {
49 namespace widgets
50 {
51 class DataSetTableView;
52
53 /*!
54 \class TableLinkDialog
55
56 \brief This class represents a TableLinkDialog component.
57 */
58 class TEQTWIDGETSEXPORT TableLinkDialog : public QDialog
59 {
60 Q_OBJECT
61
62 public:
63
64 /*!
65 \brief Constructor
66
67 It constructs a TableLinkDialog.
68
69 \param parent this dialogs's parent
70 \param f Window flags used to configure this dialog
71
72 */
73 TableLinkDialog(QWidget* parent = 0, Qt::WindowFlags f = 0);
74
75 /*!
76 \brief Destructor
77 */
79
80 /*!
81 \brief It sets the Datasource that is being used to generate the new Layer.
82
83 \param datasource The dasource being used.
84 */
86
87 /*!
88 \brief Returns the generated Join.
89 \note The caller will take ownership of the returned pointer
90 */
92
93 /*!
94 \brief Returns a new query based on the requested parameters.
95 */
97
98 /*!
99 \brief Returns a new query layer based on the requested parameters.
100 */
102
103 public
104
105 slots:
106
107 int exec();
108
109 protected:
110
112
114
115 protected
116
117 slots:
118
119 void done(int r);
120
121 void onDataCBIndexChanged(int index);
122
123 /*!
124 \brief Displays or hides the data of the tabular Dataset
125 */
127
129
130 private:
131
132 //No copy allowed
135
136 te::map::DataSetLayerPtr m_inputLayer; //!< The layer the will serve as the base for the link.
137 te::da::DataSourcePtr m_ds; //!< The dasource of the layers to be linked.
138 std::vector<std::string> m_properties; //!< The name of the properties that the output layer will contain
139 std::vector<std::string> m_uniqueProps; //!< The name of the properties that must be unique in the output layer.
140 std::unique_ptr<DataSetTableView> m_tabularView; //!< The widget used to preview the data of the tabular dataset.
141 std::unique_ptr<Ui::TableLinkDialogForm> m_ui; //!< The widget's form.
142 };
143 } // end namespace widgets
144 } // end namespace qt
145} // end namespace te
146
147#endif // __TERRALIB_QT_WIDGETS_INTERNAL_TABLELINKDIALOG_H
A Join clause combines two FromItems.
Definition: Join.h:51
A Select models a query to be used when retrieving data from a DataSource.
Definition: Select.h:67
This class represents a TableLinkDialog component.
te::map::DataSetLayerPtr m_inputLayer
The layer the will serve as the base for the link.
std::unique_ptr< DataSetTableView > m_tabularView
The widget used to preview the data of the tabular dataset.
te::da::Join * getJoin()
Returns the generated Join.
void setInputLayer(te::map::AbstractLayerPtr inLayer)
It sets the Datasource that is being used to generate the new Layer.
TableLinkDialog(const TableLinkDialog &rhs)
TableLinkDialog & operator=(const TableLinkDialog &rhs)
std::vector< std::string > m_uniqueProps
The name of the properties that must be unique in the output layer.
TableLinkDialog(QWidget *parent=0, Qt::WindowFlags f=0)
Constructor.
std::vector< std::string > m_properties
The name of the properties that the output layer will contain.
void onDataToolButtonnClicked()
Displays or hides the data of the tabular Dataset.
te::map::AbstractLayerPtr getQueryLayer()
Returns a new query layer based on the requested parameters.
void onDataCBIndexChanged(int index)
std::unique_ptr< Ui::TableLinkDialogForm > m_ui
The widget's form.
te::da::Select getSelectQuery()
Returns a new query based on the requested parameters.
te::da::DataSourcePtr m_ds
The dasource of the layers to be linked.
boost::shared_ptr< DataSource > DataSourcePtr
Definition: DataSource.h:1449
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
boost::intrusive_ptr< DataSetLayer > DataSetLayerPtr
Definition: DataSetLayer.h:148
TerraLib.
#define slots
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63