All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DataSetSelectorWidget.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 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 #include "../../../../dataaccess/dataset/DataSetType.h"
31 #include "../../../../dataaccess/datasource/DataSourceInfo.h"
32 #include "../../Config.h"
33 
34 // STL
35 #include <list>
36 #include <memory>
37 #include <set>
38 
39 // Qt
40 #include <QtGui/QWidget>
41 
42 namespace Ui { class DataSetSelectorWidgetForm; }
43 
44 namespace te
45 {
46  namespace qt
47  {
48  namespace widgets
49  {
50  class DataSetDisplay;
51  class DataSetItem;
52  class DataSetGroupItem;
53  class DataSetTableView;
54  class DataSetTreeView;
55 
56  /*!
57  \class DataSetSelectorWidget
58 
59  \brief A wizard for selecting datasets from a data source.
60 
61  \ingroup widgets
62  */
64  {
65  Q_OBJECT
66 
67  public:
68 
69  DataSetSelectorWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
70 
72 
73  void set(const te::da::DataSourceInfoPtr& ds, bool useCheckableItems = false);
74 
75  void setMapPreviewVisible(bool visible);
76 
77  void setMapPreviewEnabled(bool enabled);
78 
79  void setDataPreviewVisible(bool visible);
80 
81  void setDataPreviewEnabled(bool enabled);
82 
83  void setNumPreviewRows(int nrows);
84 
85  std::list<te::da::DataSetTypePtr> getCheckedDataSets() const;
86 
87  bool hasCheckedDataSets() const;
88 
89  std::list<te::da::DataSetTypePtr> getSelectedDataSets() const;
90 
91  bool hasSelectedDataSets() const;
92 
93  DataSetTreeView* getTreeView() const;
94 
95  protected:
96 
97  void previewMap(const te::da::DataSetTypePtr& dataset);
98 
99  void previewData(const te::da::DataSetTypePtr& dataset);
100 
101  protected slots:
102 
103  void onDataSetToggled(DataSetItem* item);
104 
105  void onDataSetClicked(DataSetItem* item);
106 
107  void onDataSetGroupToggled(DataSetGroupItem* item);
108 
109  void onMapPreviewToggled(bool on);
110 
111  void onDataPreviewToggled(bool on);
112 
113  private:
114 
116  {
117  bool operator()(const te::da::DataSetTypePtr& first, const te::da::DataSetTypePtr& second) const;
118  };
119 
120  std::set<te::da::DataSetTypePtr, DataSetComparer> m_checkedDatasets;
121  std::auto_ptr<Ui::DataSetSelectorWidgetForm> m_ui;
122  std::auto_ptr<te::qt::widgets::DataSetDisplay> m_mapPreview;
123  std::auto_ptr<DataSetTableView> m_tblView;
124  std::auto_ptr<DataSetTreeView> m_datasetTreeView;
127  };
128 
129  } // end namespace widgets
130  } // end namespace qt
131 } // end namespace te
132 
133 #endif // __TERRALIB_QT_WIDGETS_DATASET_SELECTOR_INTERNAL_DATASETSELECTORWIDGET_H
134 
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:101
A tree view for datasets of a data source.
A wizard for selecting datasets from a data source.
std::auto_ptr< DataSetTreeView > m_datasetTreeView
std::auto_ptr< DataSetTableView > m_tblView
std::auto_ptr< Ui::DataSetSelectorWidgetForm > m_ui
std::set< te::da::DataSetTypePtr, DataSetComparer > m_checkedDatasets
std::auto_ptr< te::qt::widgets::DataSetDisplay > m_mapPreview
boost::shared_ptr< DataSetType > DataSetTypePtr
Definition: DataSetType.h:653
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr