DataSetTableDockWidget.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 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 <QDockWidget>
33 
34 namespace te
35 {
36  // Forward declarations
37  namespace gm
38  {
39  class Envelope;
40  }
41 
42  namespace map
43  {
44  class AbstractLayer;
45  }
46 
47  namespace da
48  {
49  class ObjectIdSet;
50  }
51 
52  namespace qt
53  {
54  namespace widgets
55  {
56  // Forward declarations
57  class DataSetTableView;
58  class ChartDisplayWidget;
59  }
60 
61  namespace af
62  {
63  namespace evt
64  {
65  // Forward declarations
66  struct Event;
67  }
68 
69  /*!
70  \class DataSetTableDockWidget
71 
72  \brief A dock widget for DataSetTableView objects.
73  */
74  class TEQTAFEXPORT DataSetTableDockWidget : public QDockWidget
75  {
76  Q_OBJECT
77 
78  public:
79 
80  /*!
81  \brief Constructor.
82 
83  \param parent The widget parent.
84  */
85  DataSetTableDockWidget(QWidget* parent=0);
86 
87  /*!
88  \brief Destructor.
89  */
91 
92  /*!
93  \brief Sets the layer to be showed on view. This DOES NOT takes the ownership of \a layer.
94 
95  \param layer The layer to be showed.
96  */
97  void setLayer(te::map::AbstractLayer* layer);
98 
99  /*!
100  \brief Returns the layer being used.
101 
102  \return Layer being used.
103  */
104  te::map::AbstractLayer* getLayer() const;
105 
106  /*!
107  \brief Defines the color to be used as Highlight.
108 
109  \param color the Highlight color;
110  */
111  void setHighlightColor(QColor color);
112 
113  protected slots:
114 
115  /*!
116  \brief Broadcasts the creation of a new chartWidget to the application
117 
118  \param chartWidget The widget containing the generated chart.
119 
120  */
121  void chartDisplayCreated(te::qt::widgets::ChartDisplayWidget* chartWidget);
122 
123  /*!
124  \brief Used for capture events sent by application framework.
125  */
126  void onApplicationTriggered(te::qt::af::evt::Event* evt);
127 
128  /*!
129  \brief Used for selection changed on table view.
130 
131  \param oids The selected object ids.
132 
133  \param add True to add to previous selection, false to discard older selection.
134 
135  \param env Bounding box of the last object selected.
136 
137  \note This function WILL TAKE the ownership of \a oids. It gives the ownership to the layer.
138  */
139  void selectionChanged(te::da::ObjectIdSet* oids, const bool& add, te::gm::Envelope* env);
140 
141  /*!
142  \brief Removes the \a oids from the list of selected in the Layer.
143 
144  \param oids Set of objects ids to be removed.
145 
146  \note This WILL NOT TAKE the ownership of \a oids.
147  */
148  void removeSelectedOIds(te::da::ObjectIdSet* oids);
149 
150  signals:
151 
152  /*!
153  \brief Broadcasts the creation of a new chartWidget to the application
154 
155  \param chartWidget The widget containing the generated chart.
156 
157  */
158  void createChartDisplay(te::qt::widgets::ChartDisplayWidget*, te::map::AbstractLayer* layer);
159 
160  /*!
161  \brief Emitted before this widget was closed.
162  */
164 
165  void triggered(te::qt::af::evt::Event* e);
166 
167  protected:
168 
170 
171  te::map::AbstractLayer* m_layer; //!< Layer being visualized.
172  };
173  }
174  }
175 }
176 
177 #endif //__TERRALIB_QT_WIDGETS_TABLE_INTERNAL_DATASETTABLEDOCKWIDGET_H
This is the base class for layers.
Definition: AbstractLayer.h:76
A base class for application events.
Definition: Event.h:59
te::map::AbstractLayer * m_layer
Layer being visualized.
A dock widget for DataSetTableView objects.
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
This class represents a set of unique ids created in the same context. i.e. from the same data set...
Definition: ObjectIdSet.h:55
URI C++ Library.
te::qt::widgets::DataSetTableView * m_view
The table view.
#define TEQTAFEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:71
A wdiget used to display a chart.
A customized table view for te::map::AbstractLayer objects. Uses a te::qt::widgets::DataSetModel as i...