LayerExplorer.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 TerraView - A GIS Application.
4 
5  TerraView is free software: you can redistribute it and/or modify
6  it under the terms of the GNU 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  TerraView 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 General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with TerraLib Code Editor. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@dpi.inpe.br>.
18  */
19 
20 /*!
21  \file terralib/qt/af/connectors/LayerExplorer.h
22 
23  \brief A connector for the te::qt::widgets::LayerExplorer class to the Application Framework.
24 */
25 
26 #ifndef __TERRALIB_QT_AF_CONNECTORS_INTERNAL_LAYEREXPLORER_H
27 #define __TERRALIB_QT_AF_CONNECTORS_INTERNAL_LAYEREXPLORER_H
28 
29 // Terralib
30 #include "../Config.h"
31 
32 #include "../../../maptools/AbstractLayer.h"
33 
34 // Qt
35 #include <QtCore/QObject>
36 
37 // STL
38 #include <vector>
39 #include <list>
40 
41 // Forward declarations
42 class QItemSelection;
43 
44 namespace te
45 {
46  namespace qt
47  {
48 // Forward declarations
49  namespace widgets
50  {
51  class LayerItemView;
52  //class AbstractTreeItem;
53  }
54 
55  namespace af
56  {
57  namespace evt
58  {
59  // Forward declarations
60  struct Event;
61  }
62  /*!
63  \class LayerExplorer
64 
65  \brief A connector for the te::qt::widgets::LayerExplorer class to the Application Framework.
66 
67  It is used to listen events sent by the application framework.
68  It is a proxy for the te::qt::widgets::LayerExplorer.
69  */
70  class TEQTAFEXPORT LayerExplorer : public QObject
71  {
72  Q_OBJECT
73 
74  public:
75 
76  /*!
77  \brief Constructor.
78 
79  \param explorer te::qt::widgets::LayerExplorer to be listened.
80  */
81  LayerExplorer(te::qt::widgets::LayerItemView* explorer, QObject* parent = 0);
82 
83  /*! \brief Destructor. */
84  ~LayerExplorer();
85 
86  te::qt::widgets::LayerItemView* getExplorer() const;
87 
88  protected slots:
89 
90  /*!
91  \brief Listener to the application framewrork events.
92 
93  \param evt An event sent by framework.
94  */
95  void onApplicationTriggered(te::qt::af::evt::Event* evt);
96 
97  /*!
98  \brief It indicates whenever there are changes in the selection of layers in the layer explorer.
99 
100  \param selectedLayers The new list of selected layers.
101  */
102  void onSelectedLayersChanged(const std::list<te::map::AbstractLayerPtr>& selectedLayers);
103 
104  void onLayerVisibilityChanged();
105 
106  void onLayerOrderChanged();
107 
108  void onTreeItemDoubleClicked(te::map::AbstractLayerPtr layer);
109 
110  signals:
111 
112  void triggered(te::qt::af::evt::Event* e);
113 
114  protected:
115 
116  te::qt::widgets::LayerItemView* m_explorer; //!< Pointer to a component te::qt::widgets::LayerExplorer.
117  };
118 
119  } // end namespace af
120  } // end namespace qt
121 } // end namespace te
122 
123 #endif // __TERRALIB_QT_AF_CONNECTORS_INTERNAL_LAYEREXPLORER_H
124 
A base class for application events.
Definition: Event.h:59
A connector for the te::qt::widgets::LayerExplorer class to the Application Framework.
Definition: LayerExplorer.h:70
te::qt::widgets::LayerItemView * m_explorer
Pointer to a component te::qt::widgets::LayerExplorer.
URI C++ Library.
A specialization of QTreeView for manipulate layers.
Definition: LayerItemView.h:71
#define TEQTAFEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:71
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr