CreateLayerWidget.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/CreateLayerWidget.h
22 
23 \brief This interface is used to create new layer operation.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_LAYER_UTILS_INTERNAL_CREATELAYERWIDGET_H
27 #define __TERRALIB_QT_WIDGETS_LAYER_UTILS_INTERNAL_CREATELAYERWIDGET_H
28 
29 // TerraLib
30 #include "../../../../dataaccess/datasource/DataSourceInfo.h"
31 #include "../../../../datatype/SimpleProperty.h"
32 #include "../../../../maptools/AbstractLayer.h"
33 #include "../../Config.h"
34 
35 //STL
36 #include <memory>
37 
38 // Qt
39 #include <QAction>
40 #include <QMenu>
41 #include <QSignalMapper>
42 #include <QWidget>
43 
44 namespace Ui { class CreateLayerWidgetForm; }
45 
46 namespace te
47 {
48  namespace qt
49  {
50  namespace widgets
51  {
52  class NewPropertyWidget;
53 
54  /*!
55  \class CreateLayerWidget
56 
57  \brief This interface is used to create new layer operation.
58  */
59  class TEQTWIDGETSEXPORT CreateLayerWidget : public QWidget
60  {
61  Q_OBJECT
62 
63  public:
64 
65  /*! Default Constructor */
66  CreateLayerWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
67 
68  /*! Default Destructor */
70 
71  public:
72 
73  void setDataSource(te::da::DataSourceInfoPtr dsInfo);
74 
75  bool createLayer(std::string& errorMessage);
76 
77  te::map::AbstractLayerPtr getLayer();
78 
79  void clear();
80 
81  protected slots:
82 
83  void onAddPushButtonClicked();
84 
85  void onTargetDatasourceToolButtonPressed();
86 
87  void onTargetFileToolButtonPressed();
88 
89  void onRemoveAttrExecuted(int row);
90 
91  protected:
92 
93  void listProperties();
94 
95  private:
96 
97  std::auto_ptr<Ui::CreateLayerWidgetForm> m_ui;
98 
100 
102 
103  std::vector<te::dt::SimpleProperty*> m_props;
104 
105  bool m_toFile;
106 
107  QSignalMapper* m_removeMapper; //!< The mapper used to know which action was executed.
108  };
109 
110  } // end namespace widgets
111  } // end namespace qt
112 } // end namespace te
113 
114 #endif // __TERRALIB_QT_WIDGETS_LAYER_UTILS_INTERNAL_CREATELAYERWIDGET_H
QSignalMapper * m_removeMapper
The mapper used to know which action was executed.
std::vector< te::dt::SimpleProperty * > m_props
te::da::DataSourceInfoPtr m_outputDatasource
std::auto_ptr< Ui::CreateLayerWidgetForm > m_ui
URI C++ Library.
te::qt::widgets::NewPropertyWidget * m_newPropWidget
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63
This interface is used to create new layer operation.
TEQTWIDGETSEXPORT te::map::AbstractLayerPtr createLayer(const std::string &driverName, const std::map< std::string, std::string > &connInfo)
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr