QGIS API Documentation  3.14.0-Pi (9f7028fd23)
qgssourceselectprovider.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgssourceselectprovider.h - QgsSourceSelectProvider
3 
4  ---------------------
5  begin : 1.9.2017
6  copyright : (C) 2017 by Alessandro Pasotti
7  email : apasotti at boundlessgeo dot com
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 #ifndef QGSSOURCESELECTPROVIDER_H
17 #define QGSSOURCESELECTPROVIDER_H
18 
19 
20 #include "qgis_gui.h"
21 #include "qgis_sip.h"
22 #include "qgsguiutils.h"
23 #include "qgsproviderregistry.h"
25 
26 class QString;
27 class QWidget;
28 
35 class GUI_EXPORT QgsSourceSelectProvider
36 {
37  public:
38 
40  enum Ordering
41  {
42  OrderLocalProvider = 0,
43  OrderDatabaseProvider = 1000,
44  OrderRemoteProvider = 2000,
45  OrderGeoCmsProvider = 3000,
46  OrderOtherProvider = 4000,
47  };
48 
49  virtual ~QgsSourceSelectProvider() = default;
50 
52  virtual QString providerKey() const = 0;
53 
61  virtual QString name() const { return providerKey(); }
62 
64  virtual QString text() const = 0;
65 
71  virtual QString toolTip() const { return QString(); }
72 
74  virtual QIcon icon() const = 0;
75 
80  virtual int ordering( ) const { return OrderOtherProvider; }
81 
86  virtual QgsAbstractDataSourceWidget *createDataSourceWidget( QWidget *parent = nullptr, Qt::WindowFlags fl = Qt::Widget, QgsProviderRegistry::WidgetMode widgetMode = QgsProviderRegistry::WidgetMode::Embedded ) const = 0 SIP_FACTORY;
87 };
88 
89 
90 #endif // QGSSOURCESELECTPROVIDER_H
QgsSourceSelectProvider::ordering
virtual int ordering() const
Ordering: the source select provider registry will be able to sort the source selects (ascending) usi...
Definition: qgssourceselectprovider.h:80
QgsAbstractDataSourceWidget
Abstract base Data Source Widget to create connections and add layers This class provides common func...
Definition: qgsabstractdatasourcewidget.h:42
QgsSourceSelectProvider::toolTip
virtual QString toolTip() const
Text for the tooltip menu item entry, it will be visible to the user so make sure it's translatable.
Definition: qgssourceselectprovider.h:71
QgsSourceSelectProvider::Ordering
Ordering
Provider ordering groups.
Definition: qgssourceselectprovider.h:40
QgsSourceSelectProvider
Definition: qgssourceselectprovider.h:35
QgsSourceSelectProvider::name
virtual QString name() const
Source select provider name, this is useful to retrieve a particular source select in case the provid...
Definition: qgssourceselectprovider.h:61
qgsabstractdatasourcewidget.h
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
QgsProviderRegistry::WidgetMode
WidgetMode
Different ways a source select dialog can be used.
Definition: qgsproviderregistry.h:63
qgsproviderregistry.h
qgis_sip.h
qgsguiutils.h