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 #include "../../../../dataaccess/datasource/DataSource.h"
31 #include "../../../../dataaccess/datasource/DataSourceInfo.h"
32 #include "../../../../datatype/SimpleProperty.h"
33 #include "../../../../maptools/AbstractLayer.h"
34 #include "../../Config.h"
35 
36 // Qt
37 #include <QAction>
38 #include <QMenu>
39 #include <QSignalMapper>
40 #include <QWidget>
41 
42 namespace Ui { class SaveSelectedObjectsWidgetForm; }
43 
44 namespace te
45 {
46  namespace qt
47  {
48  namespace widgets
49  {
50  /*!
51  \class CreateLayerWidget
52 
53  \brief This interface is used to create a new layer based on a layer with selected objects.
54  */
56  {
57  Q_OBJECT
58 
59  public:
60 
61  /*! Default Constructor */
62  SaveSelectedObjectsWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
63 
64  /*! Default Destructor */
66 
67  public:
68 
69  /*! \brief Set parameters. */
70  void setParameters(te::map::AbstractLayerPtr layer);
71 
72  /*! \brief Update components with imput data. */
73  void updateWindowComponents();
74 
75  void save(te::da::DataSource* dataSource, te::da::DataSet* dataSet, te::da::DataSetType* dataSetType);
76 
77  te::map::AbstractLayerPtr getLayer();
78 
79  bool execute(std::string& errorMessage);
80 
81  protected slots:
82 
83  void onTargetDatasourceToolButtonPressed();
84 
85  void onTargetFileToolButtonPressed();
86 
87  private:
88 
89  std::auto_ptr<Ui::SaveSelectedObjectsWidgetForm> m_ui;
90 
91  te::map::AbstractLayerPtr m_layer; //!< TerraLib layer auto ptr
92 
93  int m_srid; //!< SRID of in/out layer
94 
95  const te::da::ObjectIdSet* m_oidSet; //!< Object Id Set.
96 
98 
100 
101  bool m_toFile;
102 
103  QSignalMapper* m_removeMapper; //!< The mapper used to know which action was executed.
104  };
105 
106  } // end namespace widgets
107  } // end namespace qt
108 } // end namespace te
109 
110 #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:118
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