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 
40 namespace Ui { class TableLinkDialogForm; }
41 
42 namespace te
43 {
44  namespace da { class Join;
45  class Select; }
46 
47  namespace qt
48  {
49  namespace widgets
50  {
51  class DataSetTableView;
52  class FieldsDialog;
53 
54  /*!
55  \class TableLinkDialog
56 
57  \brief This class represents a TableLinkDialog component.
58  */
59  class TEQTWIDGETSEXPORT TableLinkDialog : public QDialog
60  {
61  Q_OBJECT
62 
63  public:
64 
65  /*!
66  \brief Constructor
67 
68  It constructs a TableLinkDialog.
69 
70  \param parent this dialogs's parent
71  \param f Window flags used to configure this dialog
72 
73  */
74  TableLinkDialog(QWidget* parent = 0, Qt::WindowFlags f = 0);
75 
76  /*!
77  \brief Destructor
78  */
79  ~TableLinkDialog();
80 
81  /*!
82  \brief It sets the Datasource that is being used to generate the new Layer.
83 
84  \param datasource The dasource being used.
85  */
86  void setInputLayer(te::map::AbstractLayerPtr inLayer);
87 
88  /*!
89  \brief Returns the generated Join.
90  \note The caller will take ownership of the returned pointer
91  */
92  te::da::Join* getJoin();
93 
94  /*!
95  \brief Returns a new query based on the requested parameters.
96  */
97  te::da::Select getSelectQuery();
98 
99  /*!
100  \brief Returns a new query layer based on the requested parameters.
101  */
102  te::map::AbstractLayerPtr getQueryLayer();
103 
104  public
105 
106  slots:
107 
108  int exec();
109 
110  protected:
111 
112  void getDataSets();
113 
114  void getProperties();
115 
116  protected
117 
118  slots:
119 
120  void done(int r);
121 
122  void onDataCBIndexChanged(int index);
123 
124  /*!
125  \brief Displays or hides the data of the tabular Dataset
126  */
127  void onDataToolButtonnClicked();
128 
129  /*!
130  \brief Displays or hides the widget's used to configure the query's fields.
131  */
132  void onAdvancedToolButtonnClicked();
133 
134  void onOkPushButtonClicked();
135 
136  private:
137 
138  te::map::DataSetLayerPtr m_inputLayer; //!< The layer the will serve as the base for the link.
139  te::da::DataSourcePtr m_ds; //!< The dasource of the layers to be linked.
140  std::auto_ptr<DataSetTableView> m_tabularView; //!< The widget used to preview the data of the tabular dataset.
141  std::auto_ptr<FieldsDialog> m_fieldsDialog; //!< The widget used to select which fields will be added to the query.
142  std::auto_ptr<Ui::TableLinkDialogForm> m_ui; //!< The widget's form.
143  };
144  } // end namespace widgets
145  } // end namespace qt
146 } // end namespace te
147 
148 #endif // __TERRALIB_QT_WIDGETS_INTERNAL_TABLELINKDIALOG_H
boost::shared_ptr< DataSource > DataSourcePtr
Definition: DataSource.h:1435
te::da::DataSourcePtr m_ds
The dasource of the layers to be linked.
std::auto_ptr< FieldsDialog > m_fieldsDialog
The widget used to select which fields will be added to the query.
std::auto_ptr< Ui::TableLinkDialogForm > m_ui
The widget&#39;s form.
te::map::DataSetLayerPtr m_inputLayer
The layer the will serve as the base for the link.
URI C++ Library.
A Join clause combines two FromItems.
Definition: Join.h:50
std::auto_ptr< DataSetTableView > m_tabularView
The widget used to preview the data of the tabular dataset.
A Select models a query to be used when retrieving data from a DataSource.
Definition: Select.h:65
This class represents a TableLinkDialog component.
boost::intrusive_ptr< DataSetLayer > DataSetLayerPtr
Definition: DataSetLayer.h:146
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr