DataSetTreeView.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/explorer/DataSetTreeView.h
22 
23  \brief A tree view for datasets of a data source.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_DATASET_EXPLORER_INTERNAL_DATASETTREEVIEW_H
27 #define __TERRALIB_QT_WIDGETS_DATASET_EXPLORER_INTERNAL_DATASETTREEVIEW_H
28 
29 // TerraLib
30 #ifndef Q_MOC_RUN
31 #include "../../../../dataaccess/datasource/DataSourceInfo.h"
32 #endif
33 #include "../../Config.h"
34 
35 // STL
36 #include <list>
37 #include <memory>
38 
39 // Qt
40 #include <QTreeView>
41 
42 namespace te
43 {
44  namespace qt
45  {
46  namespace widgets
47  {
48  class DataSetGroupItem;
49  class DataSetCategoryGroupItem;
50  class DataSetItem;
51  class DataSetTreeModel;
52  class DataSetCategoryModel;
53 
54  /*!
55  \class DataSetTreeView
56 
57  \brief A tree view for datasets of a data source.
58 
59  \ingroup widgets
60 
61  \sa DataSetTreeViewModel, DataSetExplorer
62  */
63  class TEQTWIDGETSEXPORT DataSetTreeView : public QTreeView
64  {
65  Q_OBJECT
66 
67  public:
68 
69  DataSetTreeView(QWidget* parent = 0);
70 
72 
73  void set(const te::da::DataSourceInfoPtr& ds, bool useCheckableItems = false);
74 
75  std::list<DataSetItem*> getSelectedDataSets() const;
76 
77  bool hasSelectedDataSets() const;
78 
79  signals:
80 
81  void activated(DataSetItem* item);
82 
84 
86 
87  void clicked(DataSetItem* item);
88 
90 
92 
94 
96 
98 
99  void entered(DataSetItem* item);
100 
102 
104 
105  void pressed(DataSetItem* item);
106 
108 
110 
111  void toggled(DataSetItem* item);
112 
114 
116 
117  protected slots:
118 
119  void onItemActivated(const QModelIndex & index);
120 
121  void onItemClicked(const QModelIndex & index);
122 
123  void onItemDoubleClicked(const QModelIndex & index);
124 
125  void onItemEntered(const QModelIndex & index);
126 
127  void onItemPressed(const QModelIndex & index);
128 
129  void customContextMenu(const QPoint &point);
130 
131  void onModelToggled(bool checked);
132 
133  private:
134 
135  std::unique_ptr<DataSetCategoryModel> m_categoryModel;
136  std::unique_ptr<DataSetTreeModel> m_treeModel;
140  };
141  } // end namespace widgets
142  } // end namespace qt
143 } // end namespace te
144 
145 #endif // __TERRALIB_QT_WIDGETS_DATASET_EXPLORER_INTERNAL_DATASETTREEVIEW_H
te::qt::widgets::DataSetTreeView::entered
void entered(DataSetGroupItem *item)
te
TerraLib.
Definition: AddressGeocodingOp.h:52
te::qt::widgets::DataSetTreeView::clicked
void clicked(DataSetCategoryGroupItem *item)
te::qt::widgets::DataSetTreeView::activated
void activated(DataSetCategoryGroupItem *item)
te::qt::widgets::DataSetTreeView
A tree view for datasets of a data source.
Definition: DataSetTreeView.h:64
te::da::DataSourceInfoPtr
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr
Definition: DataSourceInfo.h:107
te::qt::widgets::DataSetTreeView::doubleClicked
void doubleClicked(DataSetCategoryGroupItem *item)
te::qt::widgets::DataSetTreeView::m_useCheckableItems
bool m_useCheckableItems
Definition: DataSetTreeView.h:139
te::qt::widgets::DataSetTreeView::doubleClicked
void doubleClicked(DataSetItem *item)
te::qt::widgets::DataSetTreeView::m_categoryModel
std::unique_ptr< DataSetCategoryModel > m_categoryModel
Definition: DataSetTreeView.h:135
te::qt::widgets::DataSetTreeView::m_isCategoryModel
bool m_isCategoryModel
Definition: DataSetTreeView.h:138
TEQTWIDGETSEXPORT
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63
te::qt::widgets::DataSetTreeView::activated
void activated(DataSetItem *item)
te::qt::widgets::DataSetTreeView::onItemClicked
void onItemClicked(const QModelIndex &index)
te::qt::widgets::DataSetTreeView::customContextMenu
void customContextMenu(const QPoint &point)
te::qt::widgets::DataSetTreeView::~DataSetTreeView
~DataSetTreeView()
te::qt::widgets::DataSetTreeView::entered
void entered(DataSetCategoryGroupItem *item)
te::qt::widgets::DataSetGroupItem
Definition: DataSetGroupItem.h:45
te::qt::widgets::DataSetTreeView::doubleClicked
void doubleClicked(DataSetGroupItem *item)
slots
#define slots
Definition: VirtualMachine.h:48
te::qt::widgets::DataSetTreeView::onItemEntered
void onItemEntered(const QModelIndex &index)
te::qt::widgets::DataSetTreeView::DataSetTreeView
DataSetTreeView(QWidget *parent=0)
te::qt::widgets::DataSetTreeView::toggled
void toggled(DataSetGroupItem *item)
te::qt::widgets::DataSetTreeView::pressed
void pressed(DataSetCategoryGroupItem *item)
te::qt::widgets::DataSetItem
Definition: DataSetItem.h:44
te::qt::widgets::DataSetTreeView::pressed
void pressed(DataSetGroupItem *item)
te::qt::widgets::DataSetTreeView::onItemDoubleClicked
void onItemDoubleClicked(const QModelIndex &index)
te::qt::widgets::DataSetTreeView::onItemPressed
void onItemPressed(const QModelIndex &index)
te::qt::widgets::DataSetTreeView::set
void set(const te::da::DataSourceInfoPtr &ds, bool useCheckableItems=false)
te::qt::widgets::DataSetTreeView::hasSelectedDataSets
bool hasSelectedDataSets() const
te::qt::widgets::DataSetTreeView::getSelectedDataSets
std::list< DataSetItem * > getSelectedDataSets() const
te::qt::widgets::DataSetTreeView::activated
void activated(DataSetGroupItem *item)
te::qt::widgets::DataSetTreeView::m_treeModel
std::unique_ptr< DataSetTreeModel > m_treeModel
Definition: DataSetTreeView.h:136
te::qt::widgets::DataSetCategoryGroupItem
Definition: DataSetCategoryGroupItem.h:40
te::qt::widgets::DataSetTreeView::clicked
void clicked(DataSetGroupItem *item)
te::qt::widgets::DataSetTreeView::entered
void entered(DataSetItem *item)
te::qt::widgets::DataSetTreeView::onModelToggled
void onModelToggled(bool checked)
te::qt::widgets::DataSetTreeView::onItemActivated
void onItemActivated(const QModelIndex &index)
te::qt::widgets::DataSetTreeView::m_ds
te::da::DataSourceInfoPtr m_ds
Definition: DataSetTreeView.h:137
te::qt::widgets::DataSetTreeView::toggled
void toggled(DataSetCategoryGroupItem *item)
te::qt::widgets::DataSetTreeView::pressed
void pressed(DataSetItem *item)
te::qt::widgets::DataSetTreeView::toggled
void toggled(DataSetItem *item)
te::qt::widgets::DataSetTreeView::clicked
void clicked(DataSetItem *item)