All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MapLayerChoiceOutside.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/layout/qt/outside/MapLayerChoiceOutside.h
22 
23  \brief A dialog configure the input layer to address geocoding operation
24 */
25 
26 #ifndef __TERRALIB_LAYOUT_INTERNAL_MAP_LAYER_CHOICE_OUTSIDE_H
27 #define __TERRALIB_LAYOUT_INTERNAL_MAP_LAYER_CHOICE_OUTSIDE_H
28 
29 // TerraLib
30 #include "../../../qt/widgets/utils/DoubleListWidget.h"
31 #include "../../../maptools/AbstractLayer.h"
32 #include "../../core/Config.h"
34 #include "../../core/pattern/mvc/OutsideObserver.h"
35 
36 // STL
37 #include <map>
38 #include <memory>
39 
40 // Qt
41 #include <QDialog>
42 
43 namespace Ui { class MapLayerChoice; }
44 
45 // Forward declarations
46 class QModelIndex;
47 
48 namespace te
49 {
50  namespace layout
51  {
52  class OutsideController;
53  class Observable;
54 
55  class TELAYOUTEXPORT MapLayerChoiceOutside : public QDialog, public OutsideObserver
56  {
57  Q_OBJECT
58 
59  public:
60 
62 
64 
65  /*!
66  \brief Set the layer that can be used
67 
68  \param layers List of AbstractLayerPtr
69  */
70  void setLayers(std::list<te::map::AbstractLayerPtr> layers);
71 
72  te::map::AbstractLayerPtr getLayer();
73 
74  te::da::DataSourcePtr getDataSource();
75 
76  virtual void updateObserver( ContextItem context );
77 
78  virtual void setPosition( const double& x, const double& y );
79 
80  virtual te::gm::Coord2D getPosition();
81 
82  protected slots:
83 
84  void onOkPushButtonClicked();
85 
86  void onCancelPushButtonClicked();
87 
88  private:
89 
90  std::auto_ptr<Ui::MapLayerChoice> m_ui;
91  std::auto_ptr<te::qt::widgets::DoubleListWidget> m_widget;
92  std::list<te::map::AbstractLayerPtr> m_layers; //!< List of layers.
94  te::map::AbstractLayerPtr m_selectedLayer; //!< Layer used for address geocoding
95  std::vector<std::string> m_selectedProps; //!< Selected properties related to the selected Layer
96 
97  };
98  } // end namespace addressgeocoding
99 } // end namespace te
100 
101 #endif
102 
103 
104 
Abstract class to represent an observable. "Model" part of MVC component.
Definition: Observable.h:56
Class responsible for maintaining the drawing context of a MVC component. It is always used by the "M...
Definition: ContextItem.h:49
#define TELAYOUTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:99
boost::shared_ptr< DataSource > DataSourcePtr
Definition: DataSource.h:1435
An abstract class for data providers like a DBMS, Web Services or a regular file. ...
Abstract class to represent an observer. "View" part of MVC widget. All classes representing the grap...
An utility struct for representing 2D coordinates.
Definition: Coord2D.h:40
std::auto_ptr< te::qt::widgets::DoubleListWidget > m_widget
te::map::AbstractLayerPtr m_selectedLayer
Layer used for address geocoding.
std::auto_ptr< Ui::MapLayerChoice > m_ui
std::list< te::map::AbstractLayerPtr > m_layers
List of layers.
Abstract class to represent a controller. "Controller" part of MVC widget. All classes representing t...
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
std::vector< std::string > m_selectedProps
Selected properties related to the selected Layer.