Loading...
Searching...
No Matches
DataSetSelectorWidget.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 terralib/qt/widgets/dataset/selector/DataSetSelectorWidget.h
22
23 \brief A wizard for selecting datasets from a data source.
24*/
25
26#ifndef __TERRALIB_QT_WIDGETS_DATASET_SELECTOR_INTERNAL_DATASETSELECTORWIDGET_H
27#define __TERRALIB_QT_WIDGETS_DATASET_SELECTOR_INTERNAL_DATASETSELECTORWIDGET_H
28
29// TerraLib
30#ifndef Q_MOC_RUN
31#include "../../../../dataaccess/dataset/DataSetType.h"
32#include "../../../../dataaccess/datasource/DataSourceInfo.h"
33#endif
34#include "../../Config.h"
35
36// STL
37#include <list>
38#include <memory>
39#include <set>
40
41// Qt
42#include <QWidget>
43
44namespace Ui { class DataSetSelectorWidgetForm; }
45
46namespace te
47{
48 namespace qt
49 {
50 namespace widgets
51 {
52 class DataSetDisplay;
53 class DataSetItem;
54 class DataSetGroupItem;
55 class DataSetTableView;
56 class DataSetTreeView;
57
58 /*!
59 \class DataSetSelectorWidget
60
61 \brief A wizard for selecting datasets from a data source.
62
63 \ingroup widgets
64 */
66 {
67 Q_OBJECT
68
69 public:
70
71 DataSetSelectorWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
72
74
75 void set(const te::da::DataSourceInfoPtr& ds, bool useCheckableItems = false);
76
77 void setMapPreviewVisible(bool visible);
78
79 void setMapPreviewEnabled(bool enabled);
80
81 void setDataPreviewVisible(bool visible);
82
83 void setDataPreviewEnabled(bool enabled);
84
85 void setNumPreviewRows(int nrows);
86
87 std::list<te::da::DataSetTypePtr> getCheckedDataSets() const;
88
89 bool hasCheckedDataSets() const;
90
91 std::list<std::string> getCheckedGeomProperties() const;
92
93 std::list<te::da::DataSetTypePtr> getSelectedDataSets() const;
94
95 bool hasSelectedDataSets() const;
96
97 std::list<std::string> getSelectedGeomProperties() const;
98
100
101 protected:
102
103 void previewMap(const te::da::DataSetTypePtr& dataset);
104
106
107 protected slots:
108
110
112
114
115 void onMapPreviewToggled(bool on);
116
117 void onDataPreviewToggled(bool on);
118
119 void onFilterLineEditTextChanged(const QString& text);
120
121 private:
122
124 {
125 bool operator()(const te::da::DataSetTypePtr& first, const te::da::DataSetTypePtr& second) const;
126 };
127
128 std::map<te::da::DataSetTypePtr, std::string, DataSetComparer> m_checkedDatasets;
129 std::unique_ptr<Ui::DataSetSelectorWidgetForm> m_ui;
130 std::unique_ptr<te::qt::widgets::DataSetDisplay> m_mapPreview;
131 std::unique_ptr<DataSetTableView> m_tblView;
132 std::unique_ptr<DataSetTreeView> m_datasetTreeView;
136 };
137
138 } // end namespace widgets
139 } // end namespace qt
140} // end namespace te
141
142#endif // __TERRALIB_QT_WIDGETS_DATASET_SELECTOR_INTERNAL_DATASETSELECTORWIDGET_H
143
A wizard for selecting datasets from a data source.
void previewData(const te::da::DataSetTypePtr &dataset)
std::list< te::da::DataSetTypePtr > getCheckedDataSets() const
DataSetTreeView * getTreeView() const
std::list< std::string > getSelectedGeomProperties() const
DataSetSelectorWidget(QWidget *parent=0, Qt::WindowFlags f=0)
void onFilterLineEditTextChanged(const QString &text)
std::map< te::da::DataSetTypePtr, std::string, DataSetComparer > m_checkedDatasets
std::unique_ptr< DataSetTableView > m_tblView
void set(const te::da::DataSourceInfoPtr &ds, bool useCheckableItems=false)
void onDataSetClicked(DataSetItem *item)
std::list< te::da::DataSetTypePtr > getSelectedDataSets() const
void onDataSetToggled(DataSetItem *item)
std::unique_ptr< Ui::DataSetSelectorWidgetForm > m_ui
std::unique_ptr< DataSetTreeView > m_datasetTreeView
void previewMap(const te::da::DataSetTypePtr &dataset)
void onDataSetGroupToggled(DataSetGroupItem *item)
std::list< std::string > getCheckedGeomProperties() const
std::unique_ptr< te::qt::widgets::DataSetDisplay > m_mapPreview
A tree view for datasets of a data source.
boost::shared_ptr< DataSetType > DataSetTypePtr
Definition: DataSetType.h:653
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr
TerraLib.
#define slots
bool operator()(const te::da::DataSetTypePtr &first, const te::da::DataSetTypePtr &second) const
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63