QGIS API Documentation  3.2.0-Bonn (bc43194)
qgsdatasourcemanagerdialog.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsdatasourcemanagerdialog.h - datasource manager dialog
3 
4  ---------------------
5  begin : May 19, 2017
6  copyright : (C) 2017 by Alessandro Pasotti
7  email : apasotti at itopen dot it
8  ***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 
17 #ifndef QGSDATASOURCEMANAGERDIALOG_H
18 #define QGSDATASOURCEMANAGERDIALOG_H
19 
20 #include <QList>
21 #include <QDialog>
22 #include "ui_qgsdatasourcemanagerdialog.h"
23 #include "qgsoptionsdialogbase.h"
24 #include "qgsguiutils.h"
25 #include "qgsmimedatautils.h"
26 #include "qgshelp.h"
27 #include "qgis_gui.h"
28 
29 #define SIP_NO_FILE
30 
32 class QgsRasterLayer;
33 class QgsMapCanvas;
35 class QgsBrowserModel;
36 
46 class GUI_EXPORT QgsDataSourceManagerDialog : public QgsOptionsDialogBase, private Ui::QgsDataSourceManagerDialog
47 {
48  Q_OBJECT
49 
50  public:
51 
59  explicit QgsDataSourceManagerDialog( QgsBrowserModel *browserModel, QWidget *parent = nullptr, QgsMapCanvas *canvas = nullptr, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
60  ~QgsDataSourceManagerDialog() override;
61 
67  void openPage( const QString &pageName );
68 
69  public slots:
70 
72  void setCurrentPage( int index );
73 
78  void rasterLayerAdded( QString const &uri, QString const &baseName, QString const &providerKey );
80  void vectorLayerAdded( const QString &vectorLayerPath, const QString &baseName, const QString &providerKey );
82  void vectorLayersAdded( const QStringList &layerQStringList, const QString &enc, const QString &dataSourceType );
84  void setPreviousPage();
86  void refresh();
87 
88  protected:
89  void showEvent( QShowEvent *event ) override;
90 
91  signals:
93  void addRasterLayer( const QString &uri, const QString &baseName, const QString &providerKey );
95  void addRasterLayer();
97  void addVectorLayer( const QString &vectorLayerPath, const QString &baseName, const QString &providerKey );
99  void replaceSelectedVectorLayer( const QString &oldId, const QString &uri, const QString &layerName, const QString &provider );
101  void addVectorLayers( const QStringList &layerQStringList, const QString &enc, const QString &dataSourceType );
103  void showProgress( int progress, int totalSteps );
105  void showStatusMessage( const QString &message );
107  void addDatabaseLayers( const QStringList &layerPathList, const QString &providerKey );
109  void openFile( const QString &fileName, const QString &fileTypeHint = QString() );
111  void handleDropUriList( const QgsMimeDataUtils::UriList & );
113  void updateProjectHome();
114 
120  void connectionsChanged();
121 
126  void providerDialogsRefreshRequested();
127 
128  private:
129  void addProviderDialog( QgsAbstractDataSourceWidget *dlg, const QString &providerKey, const QString &providerName, const QIcon &icon, const QString &toolTip = QString() );
130  void makeConnections( QgsAbstractDataSourceWidget *dlg, const QString &providerKey );
131  Ui::QgsDataSourceManagerDialog *ui = nullptr;
132  QgsBrowserDockWidget *mBrowserWidget = nullptr;
133  int mPreviousRow;
134  QStringList mPageNames;
135  // Map canvas
136  QgsMapCanvas *mMapCanvas = nullptr;
137 
138 
139 };
140 
141 #endif // QGSDATASOURCEMANAGERDIALOG_H
Abstract base Data Source Widget to create connections and add layers This class provides common func...
This class provides qgis with the ability to render raster datasets onto the mapcanvas.
The QgsDataSourceManagerDialog class embeds the browser panel and all the provider dialogs...
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:74
A base dialog for options and properties dialogs that offers vertical tabs.
void showEvent(QShowEvent *e) override
The QgsBrowserDockWidget class.
QList< QgsMimeDataUtils::Uri > UriList
A model for showing available data sources and other items in a structured tree.