All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DataSetTableDockWidget.h
Go to the documentation of this file.
1 /* Copyright (C) 2011-2012 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 DataSetTableDockWidget.h
22 
23  \brief A dock widget for table view objects.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_TABLE_INTERNAL_DATASETTABLEDOCKWIDGET_H
27 #define __TERRALIB_QT_WIDGETS_TABLE_INTERNAL_DATASETTABLEDOCKWIDGET_H
28 
29 #include "../Config.h"
30 
31 // Qt
32 #include <QtGui/QDockWidget>
33 
34 namespace te
35 {
36  namespace map
37  {
38  // Forward declarations
39  class AbstractLayer;
40  }
41 
42  namespace da
43  {
44  class ObjectIdSet;
45  }
46 
47  namespace qt
48  {
49  namespace widgets
50  {
51  // Forward declarations
52  class DataSetTableView;
53  }
54 
55  namespace af
56  {
57  namespace evt
58  {
59  // Forward declarations
60  struct Event;
61  }
62 
63  /*!
64  \class DataSetTableDockWidget
65 
66  \brief A dock widget for DataSetTableView objects.
67  */
68  class TEQTAFEXPORT DataSetTableDockWidget : public QDockWidget
69  {
70  Q_OBJECT
71 
72  public:
73 
74  /*!
75  \brief Constructor.
76 
77  \param parent The widget parent.
78  */
79  DataSetTableDockWidget(QWidget* parent=0);
80 
81  /*!
82  \brief Destructor.
83  */
85 
86  /*!
87  \brief Sets the layer to be showed on view. This DOES NOT takes the ownership of \a layer.
88 
89  \param layer The layer to be showed.
90  */
91  void setLayer(te::map::AbstractLayer* layer);
92 
93  /*!
94  \brief Returns the layer being used.
95 
96  \return Layer being used.
97  */
98  te::map::AbstractLayer* getLayer() const;
99 
100  protected slots:
101 
102  /*!
103  \brief Used for capture events sent by application framework.
104  */
105  void onApplicationTriggered(te::qt::af::evt::Event* evt);
106 
107  /*!
108  \brief Used for selection changed on table view.
109 
110  \param oids The selected object ids.
111 
112  \param add True to add to previous selection, false to discard older selection.
113 
114  \note This function WILL TAKE the ownership of \a oids. It gives the ownership to the layer.
115  */
116  void selectionChanged(te::da::ObjectIdSet* oids, const bool& add);
117 
118  /*!
119  \brief Removes the \a oids from the list of selected in the Layer.
120 
121  \param oids Set of objects ids to be removed.
122 
123  \note This WILL NOT TAKE the ownership of \a oids.
124  */
125  void removeSelectedOIds(te::da::ObjectIdSet* oids);
126 
127  signals:
128 
129  /*!
130  \brief Emitted before this widget was closed.
131  */
133 
134  protected:
135 
137 
138  te::map::AbstractLayer* m_layer; //!< Layer being visualized.
139  };
140  }
141  }
142 }
143 
144 #endif //__TERRALIB_QT_WIDGETS_TABLE_INTERNAL_DATASETTABLEDOCKWIDGET_H
This class represents a set of unique ids created in the same context. i.e. from the same data set...
Definition: ObjectIdSet.h:53
This is the base class for layers.
Definition: AbstractLayer.h:76
A dock widget for DataSetTableView objects.
te::map::AbstractLayer * m_layer
Layer being visualized.
A customized table view for te::map::AbstractLayer objects. Uses a te::qt::widgets::DataSetModel as i...
#define TEQTAFEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:108
te::qt::widgets::DataSetTableView * m_view
The table view.
A base class for application events.
Definition: Event.h:59