OutputDataAccessItemWidget.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 src/terralib/vp/qt/OutputDataAccessItemWidget.h
22  *
23  * \brief Implements a widget used to return a Data Access object.
24  */
25 
26 #ifndef __TERRALIB_VP_QT_INTERNAL_OUTPUTDATAACCESSITEMWIDGET_H
27 #define __TERRALIB_VP_QT_INTERNAL_OUTPUTDATAACCESSITEMWIDGET_H
28 
29 #include "../Config.h"
30 
31 // TerraLib Includes
32 #include "../../dataaccess/datasource/DataSource.h"
33 #include "../../dataaccess/datasource/DataSourceInfo.h"
34 #include "../../dataaccess/utils/DataAccess.h"
35 
36 // STL Includes
37 #include <memory>
38 
39  // Qt Includes
40 #include <QWidget>
41 
42 namespace Ui { class OutputDataAccessItemWidgetForm; }
43 
44 namespace te
45 {
46  namespace vp
47  {
48  namespace qt
49  {
50  /*!
51  \class OutputDataAccessItemWidget
52 
53  \brief Implements a widget used to return a Data Access object.
54  */
55  class TEVPEXPORT OutputDataAccessItemWidget : public QWidget
56  {
57  Q_OBJECT
58 
59  public:
60 
61  /*!
62  \brief Constructor.
63  */
64  OutputDataAccessItemWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
65 
66  /*!
67  \brief Destructor.
68  */
70 
71  public:
72 
73  /*!
74  \brief Returns the internal widget
75 
76  \return Pointer to Qt Widget OutputDataAccessItemWidget
77  */
78  Ui::OutputDataAccessItemWidgetForm* getForm() const;
79 
80  /*!
81  \brief Used to get the output datasource given the user information
82 
83  \return Pointer to terraLib DataSource
84  */
85  te::da::DataSourcePtr getOutputDataSorce();
86 
87  /*!
88  \brief Get DataAccess given the user defined parameters in the interface
89 
90  \return TerraLib DataAccess object
91  */
92  std::unique_ptr<te::da::DataAccess> getDataAccess();
93 
94  //!< Resets the widget to its default clear state
95  void reset();
96 
97  protected:
98 
99  /*!
100  \brief Function used to register the new datasource into terralib datasource manager
101 
102  \param filePath path of new file data source
103  \param dataSetName dataset name for the new data to be created
104 
105  \return Return the terralib object with datasource metadata
106  */
107  te::da::DataSourceInfoPtr registerFileDataSource(const std::string& filePath, const std::string& dataSetName);
108 
109  protected slots:
110 
111  /*!
112  \brief Slot for target datasource tool button pressed
113  */
114  void onTargetDatasourceToolButtonPressed();
115 
116  /*!
117  \brief Slot for target file tool button pressed
118  */
119  void onTargetFileToolButtonPressed();
120 
121  private:
122 
123  std::unique_ptr<Ui::OutputDataAccessItemWidgetForm> m_ui; //!< Pointer to a internal Qt widget
124 
125  bool m_toFile; //!< The result is in a file
126 
127  te::da::DataSourceInfoPtr m_outputDatasourceInfo; //!< DataSource information metadata
128 
129  te::da::DataSourcePtr m_outputDatasource; //!< DataSource information
130  };
131  } // end namespace qt
132  } // end namespace qt
133 } // end namespace qt
134 
135 
136 #endif // __TERRALIB_VP_QT_INTERNAL_OUTPUTDATAACCESSITEMWIDGET_H
137 
#define TEVPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:61
#define slots
boost::shared_ptr< DataSource > DataSourcePtr
Definition: DataSource.h:1449
te::da::DataSourcePtr m_outputDatasource
DataSource information.
Implements a widget used to return a Data Access object.
TerraLib.
std::unique_ptr< Ui::OutputDataAccessItemWidgetForm > m_ui
Pointer to a internal Qt widget.
te::da::DataSourceInfoPtr m_outputDatasourceInfo
DataSource information metadata.
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr