DataSourceSelectorWidget.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/datasource/selector/DataSourceSelectorWidget.h
22 
23  \brief A dialog for selecting a data source.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_DATASOURCE_SELECTOR_INTERNAL_DATASOURCESELECTORWIDGET_H
27 #define __TERRALIB_QT_WIDGETS_DATASOURCE_SELECTOR_INTERNAL_DATASOURCESELECTORWIDGET_H
28 
29 // TerraLib
30 #include "../../../../dataaccess/datasource/DataSourceInfo.h"
31 #include "../../Config.h"
32 
33 // STL
34 #include <list>
35 #include <memory>
36 
37 // Qt
38 #include <QAbstractItemView>
39 #include <QWidget>
40 
41 namespace Ui { class DataSourceSelectorWidgetForm; }
42 
43 class QListWidgetItem;
44 
45 namespace te
46 {
47  namespace qt
48  {
49  namespace widgets
50  {
51  /*!
52  \class DataSourceSelectorWidget
53 
54  \brief A dialog for selecting a data source.
55 
56  \ingroup widgets
57  */
59  {
60  Q_OBJECT
61 
62  public:
63 
64  enum
65  {
69  BUTTON_CREATE_DATASOURCE
70  };
71 
72  DataSourceSelectorWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
73 
75 
76  Ui::DataSourceSelectorWidgetForm* getForm() const;
77 
78  void setSelectionMode(QAbstractItemView::SelectionMode mode);
79 
80  void setButtonsEnabled(bool enabled);
81 
82  void setButtonEnabled(int button, bool enabled);
83 
84  //void selectDataSourceType(int row);
85 
86  std::list<te::da::DataSourceInfoPtr> getSelecteds() const;
87 
88  void setDataSource(const QString& dsType);
89 
90  void showDataSourceWithDatabaseSupport(bool visible);
91 
92  void showDataSourceWithFileSupport(bool visible);
93 
94  void showDataSourceWithRasterSupport(bool visible);
95 
96  void showDataSourceWithVectorialSupport(bool visible);
97 
98  //signals:
99 
100  //void hasSelectedDataSource(bool selected);
101 
102  //void created(const DataSourcePtr& ds);
103 
104  //void updated(const DataSourcePtr& ds);
105 
106  //void removing(const DataSourcePtr& ds);
107 
108  //void selected(const DataSourcePtr& ds);
109 
110  protected slots:
111 
112  void addDataSourcePushButtonPressed();
113 
114  void removeDataSourcePushButtonPressed();
115 
116  void editDataSourcePushButtonPressed();
117 
118  void createDataSourcePushButtonPressed();
119 
120  void dataSourceTypePressed(QListWidgetItem* item);
121 
122  void dataSourcePressed(QListWidgetItem* item);
123 
124  void dataSourceDoubleClicked(QListWidgetItem * item);
125 
126  private:
127 
128  std::auto_ptr<Ui::DataSourceSelectorWidgetForm> m_ui;
133  };
134  } // end namespace widgets
135  } // end namespace qt
136 } // end namespace te
137 
138 #endif // __TERRALIB_QT_WIDGETS_DATASOURCE_SELECTOR_INTERNAL_DATASOURCESELECTORWIDGET_H
139 
A dialog for selecting a data source.
URI C++ Library.
std::auto_ptr< Ui::DataSourceSelectorWidgetForm > m_ui
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63