QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
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"
23#include "qgsguiutils.h"
24#include "qgsproviderregistry.h"
25
26class QString;
27class QWidget;
28
34{
35 Q_GADGET
36
37 public:
47
52 enum class Capability : int SIP_ENUM_BASETYPE( IntFlag )
53 {
54 NoCapabilities = 0,
55 ConfigureFromUri = 1
56 };
57 Q_ENUM( Capability )
59 Q_DECLARE_FLAGS( Capabilities, Capability )
60 Q_FLAG( Capabilities )
61
63 = default;
64
66 virtual QString providerKey() const = 0;
67
75 virtual QString name() const { return providerKey(); }
76
78 virtual QString text() const = 0;
79
85 virtual QString toolTip() const { return QString(); }
86
88 virtual QIcon icon() const = 0;
89
94 virtual int ordering() const { return OrderOtherProvider; }
95
100 virtual QgsAbstractDataSourceWidget *createDataSourceWidget( QWidget *parent = nullptr, Qt::WindowFlags fl = Qt::Widget, QgsProviderRegistry::WidgetMode widgetMode = QgsProviderRegistry::WidgetMode::Embedded ) const = 0 SIP_FACTORY;
101
108 {
110 }
111};
112
114
115#endif // QGSSOURCESELECTPROVIDER_H
Abstract base class for Data Source widgets to create connections and add layers.
WidgetMode
Different ways a source select dialog can be used.
@ Embedded
Used for the data source manager dialog where the widget is embedded as the main content for a partic...
An interface for pages shown in a QgsDataSourceManagerDialog.
virtual QString providerKey() const =0
Data Provider key.
virtual int ordering() const
Ordering: the source select provider registry will be able to sort the source selects (ascending) usi...
virtual QgsAbstractDataSourceWidget * createDataSourceWidget(QWidget *parent=nullptr, Qt::WindowFlags fl=Qt::Widget, QgsProviderRegistry::WidgetMode widgetMode=QgsProviderRegistry::WidgetMode::Embedded) const =0
Create a new instance of QgsAbstractDataSourceWidget (or nullptr).
virtual QString name() const
Source select provider name, this is useful to retrieve a particular source select in case the provid...
virtual QIcon icon() const =0
Creates a new instance of an QIcon for the menu item entry.
virtual QString text() const =0
Text for the menu item entry, it will be visible to the user so make sure it's translatable.
Capability
The Capability enum describes the capabilities of the source select implementation.
virtual Capabilities capabilities()
Returns the source select provider capabilities.
virtual QString toolTip() const
Text for the tooltip menu item entry, it will be visible to the user so make sure it's translatable.
QFlags< Capability > Capabilities
Ordering
Provider ordering groups.
@ OrderDatabaseProvider
Starting point for database providers (e.g. Postgres).
@ OrderRemoteProvider
Starting point for remote (online) providers (e.g. WMS).
@ OrderSearchProvider
Starting point for search providers (e.g. Layer Metadata).
@ OrderOtherProvider
Starting point for other providers (e.g. plugin based providers).
@ OrderLocalProvider
Starting point for local file providers (e.g. OGR).
#define SIP_ENUM_BASETYPE(type)
Definition qgis_sip.h:275
#define SIP_FACTORY
Definition qgis_sip.h:84
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsProjectionSelectionWidget::CrsOptions)