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 #ifndef Q_MOC_RUN
32 #include "../../../maptools/AbstractLayer.h"
33 #endif
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 se
47  {
48  class Rule;
49  }
50 
51  namespace qt
52  {
53 // Forward declarations
54  namespace widgets
55  {
56  class LayerItemView;
57  //class AbstractTreeItem;
58  }
59 
60  namespace af
61  {
62  namespace evt
63  {
64  // Forward declarations
65  struct Event;
66  }
67  /*!
68  \class LayerExplorer
69 
70  \brief A connector for the te::qt::widgets::LayerExplorer class to the Application Framework.
71 
72  It is used to listen events sent by the application framework.
73  It is a proxy for the te::qt::widgets::LayerExplorer.
74  */
75  class TEQTAFEXPORT LayerExplorer : public QObject
76  {
77  Q_OBJECT
78 
79  public:
80 
81  /*!
82  \brief Constructor.
83 
84  \param explorer te::qt::widgets::LayerExplorer to be listened.
85  */
86  LayerExplorer(te::qt::widgets::LayerItemView* explorer, QObject* parent = 0);
87 
88  /*! \brief Destructor. */
89  ~LayerExplorer();
90 
91  te::qt::widgets::LayerItemView* getExplorer() const;
92 
93  protected slots:
94 
95  /*!
96  \brief Listener to the application framewrork events.
97 
98  \param evt An event sent by framework.
99  */
100  void onApplicationTriggered(te::qt::af::evt::Event* evt);
101 
102  /*!
103  \brief It indicates whenever there are changes in the selection of layers in the layer explorer.
104 
105  \param selectedLayers The new list of selected layers.
106  */
107  void onSelectedLayersChanged(const std::list<te::map::AbstractLayerPtr>& selectedLayers);
108 
109  void onLayerVisibilityChanged();
110 
111  void onStyleVisibilityChanged(te::map::AbstractLayerPtr layer);
112 
113  void onLayerOrderChanged();
114 
115  void onTreeItemDoubleClicked(te::map::AbstractLayerPtr layer);
116 
117  void onStyleItemDoubleClicked(te::map::AbstractLayerPtr layer, te::se::Style* style);
118 
119  void onRuleItemDoubleClicked(te::map::AbstractLayerPtr layer, te::se::Style* style, te::se::Rule* rule);
120 
121  signals:
122 
123  void triggered(te::qt::af::evt::Event* e);
124 
125  protected:
126 
127  te::qt::widgets::LayerItemView* m_explorer; //!< Pointer to a component te::qt::widgets::LayerExplorer.
128  };
129 
130  } // end namespace af
131  } // end namespace qt
132 } // end namespace te
133 
134 #endif // __TERRALIB_QT_AF_CONNECTORS_INTERNAL_LAYEREXPLORER_H
135 
#define slots
The Style defines the styling that is to be applied to a geographic dataset (vector geometries or cov...
Definition: Style.h:65
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:75
te::qt::widgets::LayerItemView * m_explorer
Pointer to a component te::qt::widgets::LayerExplorer.
TerraLib.
A specialization of QTreeView for manipulate layers.
Definition: LayerItemView.h:78
#define TEQTAFEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:71
A Rule is used to attach property/scale conditions to and group the individual symbols used for rende...
Definition: Rule.h:76
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr