All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ToolBar.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/plugins/edit/ToolBar.h
22 
23  \brief The main toolbar of TerraLib Edit Qt plugin.
24 */
25 
26 #ifndef __TERRALIB_QT_PLUGINS_EDIT_INTERNAL_TOOLBAR_H
27 #define __TERRALIB_QT_PLUGINS_EDIT_INTERNAL_TOOLBAR_H
28 
29 // TerraLib
30 #include "../../../maptools/AbstractLayer.h"
31 #include "Config.h"
32 
33 // Qt
34 #include <QAction>
35 #include <QIcon>
36 #include <QList>
37 #include <QToolBar>
38 
39 // STL
40 #include <string>
41 
42 namespace te
43 {
44  namespace qt
45  {
46  namespace plugins
47  {
48  namespace edit
49  {
50  /*!
51  \class ToolBar
52 
53  \brief The main toolbar of TerraLib Edit Qt plugin.
54  */
55  class ToolBar : public QObject
56  {
57  Q_OBJECT
58 
59  public:
60 
61  ToolBar();
62 
63  ~ToolBar();
64 
65  QToolBar* get() const;
66 
67  protected:
68 
70 
71  te::map::AbstractLayerPtr getLayer(const std::string& id);
72 
73  void initialize();
74 
75  void initializeActions();
76 
77  void createAction(QAction*& action, const QString& tooltip, const QString& icon, bool checkable, bool enabled, const char* member);
78 
79  protected slots:
80 
81  void onEditActivated(bool checked);
82 
83  void onSaveActivated();
84 
85  void onVertexToolActivated(bool checked);
86 
87  void onCreatePolygonToolActivated(bool checked);
88 
89  void onCreateLineToolActivated(bool checked);
90 
91  void onMoveGeometryToolActivated(bool checked);
92 
94 
95  protected:
96 
97  QToolBar* m_toolBar;
98 
99  QAction* m_editAction;
100  QAction* m_saveAction;
106 
107  QList<QAction*> m_tools;
108  };
109 
110  } // end namespace edit
111  } // end namespace plugins
112  } // end namespace qt
113 } // end namespace te
114 
115 #endif //__TERRALIB_QT_PLUGINS_EDIT_INTERNAL_TOOLBAR_H
The main toolbar of TerraLib Edit Qt plugin.
Definition: ToolBar.h:55
void createAction(QAction *&action, const QString &tooltip, const QString &icon, bool checkable, bool enabled, const char *member)
Definition: ToolBar.cpp:159
void onMoveGeometryToolActivated(bool checked)
Definition: ToolBar.cpp:323
te::map::AbstractLayerPtr getSelectedLayer()
Definition: ToolBar.cpp:83
void onCreateLineToolActivated(bool checked)
Definition: ToolBar.cpp:305
void onEditActivated(bool checked)
Definition: ToolBar.cpp:169
Configuration flags for the TerraLib Edit plugin.
QAction * m_createPolygonToolAction
Definition: ToolBar.h:102
te::map::AbstractLayerPtr getLayer(const std::string &id)
Definition: ToolBar.cpp:93
void onCreatePolygonToolActivated(bool checked)
Definition: ToolBar.cpp:287
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
void onVertexToolActivated(bool checked)
Definition: ToolBar.cpp:269
QAction * m_moveGeometryToolAction
Definition: ToolBar.h:104
QList< QAction * > m_tools
Definition: ToolBar.h:107