InterfaceController.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/InterfaceController.h
22 
23  \brief A connector to controll all non modal interfaces.
24 */
25 
26 #ifndef __TERRALIB_QT_AF_CONNECTORS_INTERNAL_INTERFACECONTROLLER_H
27 #define __TERRALIB_QT_AF_CONNECTORS_INTERNAL_INTERFACECONTROLLER_H
28 
29 // Terralib
30 #include "../../../maptools/AbstractLayer.h"
31 #include "../Config.h"
32 
33 // Qt
34 #include <QtCore/QObject>
35 
36 //STL
37 #include <set>
38 
39 namespace te
40 {
41  namespace qt
42  {
43  // Forward declarations
44  namespace widgets
45  {
46  class InterfaceController;
47  }
48 
49  namespace af
50  {
51  namespace evt
52  {
53  // Forward declarations
54  struct Event;
55  }
56 
57  /*!
58  \class InterfaceController
59 
60  \brief A connector to controll all non modal interfaces.
61 
62  It is used to listen events sent by the application framework.
63  */
64  class TEQTAFEXPORT InterfaceController : public QObject
65  {
66  Q_OBJECT
67 
68  public:
69 
70  /*!
71  \brief Constructor.
72 
73  */
74  InterfaceController(QObject* parent = 0);
75 
76  /*! \brief Destructor. */
78 
79  public:
80 
81  void addInterface(te::qt::widgets::InterfaceController* i);
82 
83  void removeInteface(te::qt::widgets::InterfaceController* i);
84 
85  protected slots:
86 
87  /*!
88  \brief Listener to the application framewrork events.
89 
90  \param evt An event sent by framework.
91  */
92  void onApplicationTriggered(te::qt::af::evt::Event* evt);
93 
94  protected:
95 
96  /*!
97  \brief This method is used to set current layer
98 
99  */
100  void layerSelected(te::map::AbstractLayerPtr layer);
101 
102  /*!
103  \brief This method is used to add a new layer
104 
105  */
106  void layerAdded(te::map::AbstractLayerPtr layer);
107 
108  /*!
109  \brief This method is used to remove a layer
110 
111  */
112  void layerRemoved(te::map::AbstractLayerPtr layer);
113 
114  signals:
115 
116  void triggered(te::qt::af::evt::Event* e);
117 
118  protected:
119 
120  std::set<te::qt::widgets::InterfaceController*> m_interfaces;
121 
122  };
123 
124  } // end namespace af
125  } // end namespace qt
126 } // end namespace te
127 
128 #endif // __TERRALIB_QT_AF_CONNECTORS_INTERNAL_INTERFACECONTROLLER_H
129 
A base class for application events.
Definition: Event.h:59
std::set< te::qt::widgets::InterfaceController * > m_interfaces
A virtual class for non modal interfaces.
URI C++ Library.
#define TEQTAFEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:71
A connector to controll all non modal interfaces.
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr