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  \param editable True to allow layer editions.
98  */
99  void setLayer(te::map::AbstractLayer* layer, const bool& editable = true);
100 
101  /*!
102  \brief Returns the layer being used.
103 
104  \return Layer being used.
105  */
106  te::map::AbstractLayer* getLayer() const;
107 
108  /*!
109  \brief Defines the color to be used as Highlight.
110 
111  \param color the Highlight color;
112  */
113  void setHighlightColor(QColor color);
114 
115  protected slots:
116 
117  /*!
118  \brief Broadcasts the creation of a new chartWidget to the application
119 
120  \param chartWidget The widget containing the generated chart.
121 
122  */
123  void chartDisplayCreated(te::qt::widgets::ChartDisplayWidget* chartWidget);
124 
125  /*!
126  \brief Used for capture events sent by application framework.
127  */
128  void onApplicationTriggered(te::qt::af::evt::Event* evt);
129 
130  /*!
131  \brief Used for selection changed on table view.
132 
133  \param oids The selected object ids.
134 
135  \param add True to add to previous selection, false to discard older selection.
136 
137  \param env Bounding box of the last object selected.
138 
139  \note This function WILL TAKE the ownership of \a oids. It gives the ownership to the layer.
140  */
141  void selectionChanged(te::da::ObjectIdSet* oids, const bool& add, te::gm::Envelope* env);
142 
143  /*!
144  \brief Removes the \a oids from the list of selected in the Layer.
145 
146  \param oids Set of objects ids to be removed.
147 
148  \note This WILL NOT TAKE the ownership of \a oids.
149  */
150  void removeSelectedOIds(te::da::ObjectIdSet* oids);
151 
152  signals:
153 
154  /*!
155  \brief Broadcasts the creation of a new chartWidget to the application
156 
157  \param chartWidget The widget containing the generated chart.
158 
159  */
160  void createChartDisplay(te::qt::widgets::ChartDisplayWidget*, te::map::AbstractLayer* layer);
161 
162  /*!
163  \brief Emitted before this widget was closed.
164  */
166 
167  void triggered(te::qt::af::evt::Event* e);
168 
169  protected:
170 
172 
173  te::map::AbstractLayer* m_layer; //!< Layer being visualized.
174  };
175  }
176  }
177 }
178 
179 #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...