SaveSelectedObjectsWidget.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/layer/utils/SaveSelectedObjectsWidget.h
22 
23 \brief This interface is used to create a new layer based on a layer with selected objects.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_LAYER_UTILS_INTERNAL_SAVESELECTEDOBJECTSWIDGET_H
27 #define __TERRALIB_QT_WIDGETS_LAYER_UTILS_INTERNAL_SAVESELECTEDOBJECTSWIDGET_H
28 
29 // TerraLib
30 #ifndef Q_MOC_RUN
31 #include "../../../../dataaccess/datasource/DataSource.h"
32 #include "../../../../dataaccess/datasource/DataSourceInfo.h"
33 #include "../../../../datatype/SimpleProperty.h"
34 #include "../../../../maptools/AbstractLayer.h"
35 #endif
36 #include "../../Config.h"
37 
38 // Qt
39 #include <QAction>
40 #include <QMenu>
41 #include <QSignalMapper>
42 #include <QWidget>
43 
44 namespace Ui { class SaveSelectedObjectsWidgetForm; }
45 
46 namespace te
47 {
48  namespace qt
49  {
50  namespace widgets
51  {
52  /*!
53  \class CreateLayerWidget
54 
55  \brief This interface is used to create a new layer based on a layer with selected objects.
56  */
58  {
59  Q_OBJECT
60 
61  public:
62 
63  /*! Default Constructor */
64  SaveSelectedObjectsWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
65 
66  /*! Default Destructor */
68 
69  public:
70 
71  /*! \brief Set parameters. */
72  void setParameters(te::map::AbstractLayerPtr layer);
73 
74  /*! \brief Update components with imput data. */
75  void updateWindowComponents();
76 
77  void save(te::da::DataSource* dataSource, te::da::DataSet* dataSet, te::da::DataSetType* dataSetType);
78 
79  te::map::AbstractLayerPtr getLayer();
80 
81  bool execute(std::string& errorMessage);
82 
83  protected slots:
84 
85  void onTargetDatasourceToolButtonPressed();
86 
87  void onTargetFileToolButtonPressed();
88 
89  private:
90 
91  std::auto_ptr<Ui::SaveSelectedObjectsWidgetForm> m_ui;
92 
93  te::map::AbstractLayerPtr m_layer; //!< TerraLib layer auto ptr
94 
95  int m_srid; //!< SRID of in/out layer
96 
97  const te::da::ObjectIdSet* m_oidSet; //!< Object Id Set.
98 
100 
102 
103  bool m_toFile;
104 
105  QSignalMapper* m_removeMapper; //!< The mapper used to know which action was executed.
106  };
107 
108  } // end namespace widgets
109  } // end namespace qt
110 } // end namespace te
111 
112 #endif // __TERRALIB_QT_WIDGETS_LAYER_UTILS_INTERNAL_SAVESELECTEDOBJECTSWIDGET_H
const te::da::ObjectIdSet * m_oidSet
Object Id Set.
std::auto_ptr< Ui::SaveSelectedObjectsWidgetForm > m_ui
A class that models the description of a dataset.
Definition: DataSetType.h:72
te::map::AbstractLayerPtr m_layer
TerraLib layer auto ptr.
An abstract class for data providers like a DBMS, Web Services or a regular file. ...
Definition: DataSource.h:119
QSignalMapper * m_removeMapper
The mapper used to know which action was executed.
This class represents a set of unique ids created in the same context. i.e. from the same data set...
Definition: ObjectIdSet.h:55
URI C++ Library.
A dataset is the unit of information manipulated by the data access module of TerraLib.
Definition: DataSet.h:112
#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
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr