All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DataPropertiesWidget.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/DataPropertiesWidget.h
22 
23  \brief A class used to configure the properties of a new textual file based layer
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_INTERNAL_DATAPROPERTIESWIDGET_H
27 #define __TERRALIB_QT_WIDGETS_INTERNAL_DATAPROPERTIESWIDGET_H
28 
29 //TerraLib
30 #include "../Config.h"
31 #include "../../../dataaccess/datasource/DataSource.h"
32 
33 // Qt
34 #include <QSignalMapper>
35 #include <QWidget>
36 
37 //STL
38 #include <memory>
39 
40 namespace Ui { class DataPropertiesWidgetForm; }
41 
42 namespace te
43 {
44 
45  namespace da {class DataSet;
46  class DataSetAdapter;
47  class DataSetType;
48  class DataSetTypeConverter;}
49 
50  namespace qt
51  {
52  namespace widgets
53  {
54 
55  class DataSetTableView;
56 
57  /*!
58  \class DatapPropertiesWidget
59 
60  \brief A class to represent a chart display
61  */
63  {
64 
65  Q_OBJECT
66 
67  public:
68 
69  /*!
70  \brief Constructor
71 
72  It constructs a DatapPropertiesWidget.
73 
74  \param parent this widget's parent
75  \param f Window flags used to configure this widget
76 
77  */
78  DatapPropertiesWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
79 
80  /*!
81  \brief Destructor
82  */
84 
85  /*!
86  \brief Returns a pointer to the generated DataSetTypeConverter
87 
88  \return A DataSetTypeConverter pointer.
89  \note The caller will take ownership of the returned auto pointer.
90  */
91  std::auto_ptr<te::da::DataSetTypeConverter> getConverter();
92 
93  /*!
94  \brief Returns a pointer to the widget's dataSet
95 
96  \return A DataSet pointer.
97  \note The caller will not take ownership of the returned pointer.
98  */
99  te::da::DataSet* getDataSet();
100 
101  /*!
102  \brief Returns a pointer to the widget's dataSetType
103 
104  \return A DataSetType pointer.
105  \note The caller will not take ownership of the returned pointer.
106  */
107  te::da::DataSetType* getDataSetType();
108 
109  /*!
110  \brief Returns a pointer to the widget's dataSource
111 
112  \return A DataSource pointer.
113  \note The caller will not take ownership of the returned pointer.
114  */
115  te::da::DataSource* getDataSource();
116 
117  Ui::DataPropertiesWidgetForm* getForm() const;
118 
119  protected slots:
120 
121  void onInputDataToolButtonTriggered();
122  void onSridPushButtonCLicked();
123  void onGeomPropertyChecked(int checked);
124  void onPropertyTypeChanged(int index);
125 
126  signals:
127 
128  void itemChanged();
129 
130  private:
131 
132  QSignalMapper* m_mapper; //!< The mapper used to know which property was configured.
133  std::map<int, std::string> m_typeMap; //!< A map that correlates a terralib type with a label.
134  std::auto_ptr<te::da::DataSet> m_dataSet; //!< The DataSet that will be generated by this widget.
135  std::auto_ptr<te::da::DataSetType> m_dataType; //!< The DataSetType that will be generated by this widget.
136  std::auto_ptr<DataSetTableView> m_tblView; //!< The widget used to preview the data of the new dataset.
137  std::auto_ptr<Ui::DataPropertiesWidgetForm> m_ui; //!< The widget's form.
138  std::auto_ptr<te::da::DataSetTypeConverter> m_dsConverter; //!< The DataSetConverter that will be configured by this widget.
139  te::da::DataSourcePtr m_dataSource; //!< The DataSource that will be generated by this widget.
140  };
141  } // end namespace widgets
142  } // end namespace qt
143 } // end namespace te
144 
145 #endif // __TERRALIB_QT_WIDGETS_INTERNAL_DATAPROPERTIESWIDGET_H
std::map< int, std::string > m_typeMap
A map that correlates a terralib type with a label.
std::auto_ptr< Ui::DataPropertiesWidgetForm > m_ui
The widget's form.
boost::shared_ptr< DataSource > DataSourcePtr
Definition: DataSource.h:1435
A class to represent a chart display.
A class that models the description of a dataset.
Definition: DataSetType.h:72
An abstract class for data providers like a DBMS, Web Services or a regular file. ...
Definition: DataSource.h:118
std::auto_ptr< te::da::DataSetType > m_dataType
The DataSetType that will be generated by this widget.
std::auto_ptr< te::da::DataSetTypeConverter > m_dsConverter
The DataSetConverter that will be configured by this widget.
std::auto_ptr< te::da::DataSet > m_dataSet
The DataSet that will be generated by this widget.
te::da::DataSourcePtr m_dataSource
The DataSource that will be generated by this widget.
A dataset is the unit of information manipulated by the data access module of TerraLib.
Definition: DataSet.h:112
std::auto_ptr< DataSetTableView > m_tblView
The widget used to preview the data of the new dataset.
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:66
QSignalMapper * m_mapper
The mapper used to know which property was configured.