SymbolTreeFilter.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 #ifndef __TERRALIB_QT_WIDGETS_SE_INTERNAL_SYMBOL_TREE_FILTER_H
21 #define __TERRALIB_QT_WIDGETS_SE_INTERNAL_SYMBOL_TREE_FILTER_H
22 
23 // TerraLib
24 #include "../Config.h"
25 
26 // Boost
27 #include <boost/noncopyable.hpp>
28 
29 // Qt
30 #include <QtCore/QObject>
31 
32 // Forward declarations
33 class QDragEnterEvent;
34 class QDropEvent;
35 
36 namespace te
37 {
38  namespace qt
39  {
40  namespace widgets
41  {
42 
43  class TEQTWIDGETSEXPORT SymbolTreeFilter : public QObject, public boost::noncopyable
44  {
45  Q_OBJECT
46 
47  public:
48 
49  /** @name Initializer Methods
50  * Methods related to instantiation and destruction.
51  */
52  //@{
53 
54  /*!
55  \brief It constructs a tool associated with the given map display and with the specified cursor.
56 
57  \note The tool will NOT take the ownership of the given pointers.
58  \note If the given cursor is different of Qt::BlankCursor, it will be setted on map display.
59  */
60  SymbolTreeFilter(QObject* parent = 0);
61 
62  /*! \brief Destructor. */
63  virtual ~SymbolTreeFilter();
64 
65  //@}
66 
67  /** @name AbstractTool Methods
68  * Methods related with tool behavior.
69  */
70  //@{
71 
72  /*!
73  \brief Filters events if this object has been installed as an event filter for the watched object.
74 
75  \param watched The watched object.
76  \param event The last event sent to watched object.
77 
78  \note In your reimplementation of this function, if you want to filter the event out,
79  i.e. stop it being handled further, return true; otherwise return false.
80 
81  \note Here, the default implementation looks for QMouseEvents and call the pure virutal methods
82  defined on AbstractTool class, e.g. mousePressEvent().
83  */
84  virtual bool eventFilter(QObject* watched, QEvent* e);
85 
86  /*!
87  \brief This event handler can be reimplemented in a concrete tool class
88  to receive mouse press events for the watched object.
89 
90  \param e The mouse event.
91 
92  \return If you want to filter the event out, i.e. stop it being handled further, return true; otherwise return false.
93  */
94  virtual bool drag(QDragEnterEvent* e);
95 
96  /*!
97  \brief This event handler can be reimplemented in a concrete tool class
98  to receive mouse press events for the watched object.
99 
100  \param e The mouse event.
101 
102  \return If you want to filter the event out, i.e. stop it being handled further, return true; otherwise return false.
103  */
104  virtual bool drop(QDropEvent* e);
105 
106  signals:
107 
108  void drag();
109 
110  void drop();
111  };
112  }
113  }
114 }
115 
116 
117 #endif // __TERRALIB_LAYOUT_INTERNAL_ABSTRACTLAYOUT_TOOL_H
te::qt::widgets::SymbolTreeFilter::eventFilter
virtual bool eventFilter(QObject *watched, QEvent *e)
Filters events if this object has been installed as an event filter for the watched object.
te
TerraLib.
Definition: AddressGeocodingOp.h:52
TEQTWIDGETSEXPORT
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63
te::qt::widgets::SymbolTreeFilter
Definition: SymbolTreeFilter.h:44
te::qt::widgets::SymbolTreeFilter::drag
virtual bool drag(QDragEnterEvent *e)
This event handler can be reimplemented in a concrete tool class to receive mouse press events for th...
te::qt::widgets::SymbolTreeFilter::drop
virtual bool drop(QDropEvent *e)
This event handler can be reimplemented in a concrete tool class to receive mouse press events for th...
te::qt::widgets::SymbolTreeFilter::drag
void drag()
te::qt::widgets::SymbolTreeFilter::drop
void drop()
te::qt::widgets::SymbolTreeFilter::SymbolTreeFilter
SymbolTreeFilter(QObject *parent=0)
It constructs a tool associated with the given map display and with the specified cursor.
te::qt::widgets::SymbolTreeFilter::~SymbolTreeFilter
virtual ~SymbolTreeFilter()
Destructor.