All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
AddCommand.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 AddCommand.h
22 
23  \brief Undo/Redo for add one components.
24 
25  \ingroup layout
26 */
27 
28 #ifndef __TERRALIB_LAYOUT_INTERNAL_ADD_COMMAND_H
29 #define __TERRALIB_LAYOUT_INTERNAL_ADD_COMMAND_H
30 
31 // TerraLib
32 #include "../../../../core/Config.h"
33 
34 // Qt
35 #include <QUndoCommand>
36 #include <QString>
37 #include <QPointF>
38 
39 class QGraphicsItem;
40 class QGraphicsScene;
41 
42 namespace te
43 {
44  namespace layout
45  {
46  /*!
47  \brief Undo/Redo for add one components.
48 
49  \ingroup layout
50  */
51  class TELAYOUTEXPORT AddCommand : public QUndoCommand
52  {
53  public:
54 
55  /*!
56  \brief Constructor
57 
58  \param item
59  \param parent
60  */
61  AddCommand(QGraphicsItem* item, QUndoCommand *parent = 0);
62 
63  /*!
64  \brief Destructor
65  */
66  virtual ~AddCommand();
67 
68  /*!
69  \brief Reimplemented from QUndoCommand
70  */
71  virtual void undo();
72 
73  /*!
74  \brief Reimplemented from QUndoCommand
75  */
76  virtual void redo();
77 
78  protected:
79 
80  virtual QString createCommandString(QGraphicsItem* item, const QPointF &pos);
81 
82  QGraphicsScene* m_scene;
83  QGraphicsItem* m_item;
85  };
86  }
87 }
88 
89 #endif
90 
91 
QGraphicsScene * m_scene
Definition: AddCommand.h:82
#define TELAYOUTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:99
Undo/Redo for add one components.
Definition: AddCommand.h:51
QGraphicsItem * m_item
Definition: AddCommand.h:83