File: qgsabstractproviderconnection.sip.in

package info (click to toggle)
qgis 3.40.11%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,183,800 kB
  • sloc: cpp: 1,595,841; python: 372,637; xml: 23,474; sh: 3,761; perl: 3,664; ansic: 2,257; sql: 2,137; yacc: 1,068; lex: 577; javascript: 540; lisp: 411; makefile: 154
file content (113 lines) | stat: -rw-r--r-- 3,589 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/providers/qgsabstractproviderconnection.h                   *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/



class QgsAbstractProviderConnection
{
%Docstring(signature="appended")
The :py:class:`QgsAbstractProviderConnection` provides an interface for
data provider connections.

Connections objects can be constructed loading them from the connections
stored in the settings by passing the connection name. A new connection
object can also be created by passing a data source URI in the
constructor.

Provider metadata keep a cache of the existing connections, to manage
stored connections it is recommendend to call metadata methods instead
of loading and storing the connections directly.

Concrete classes must implement methods to retrieve, save and remove
connections from the settings.

.. versionadded:: 3.10
%End

%TypeHeaderCode
#include "qgsabstractproviderconnection.h"
%End
%ConvertToSubClassCode
    if ( dynamic_cast<QgsAbstractDatabaseProviderConnection *>( sipCpp ) != NULL )
    {
      sipType = sipType_QgsAbstractDatabaseProviderConnection;
    }
    else if ( dynamic_cast<QgsAbstractProviderConnection *>( sipCpp ) != NULL )
    {
      sipType = sipType_QgsAbstractProviderConnection;
    }
    else
    {
      sipType = 0;
    }
%End
  public:

    QgsAbstractProviderConnection( const QString &name );
%Docstring
Creates a new connection with ``name`` by reading its configuration from
the settings. If a connection with this name cannot be found, an empty
connection will be returned.
%End

    QgsAbstractProviderConnection( const QString &uri, const QVariantMap &configuration );
%Docstring
Creates a new connection from the given ``uri`` and ``configuration``.
The connection is not automatically stored in the settings.

.. seealso:: :py:func:`store`
%End

    virtual ~QgsAbstractProviderConnection();

    virtual void store( const QString &name ) const = 0;
%Docstring
Stores the connection in the settings.

:param name: the name under which the connection will be stored
%End

    virtual void remove( const QString &name ) const = 0;
%Docstring
Deletes the connection from the settings.
%End

    virtual QIcon icon() const;
%Docstring
Returns an icon representing the connection.
%End

    QString uri() const;
%Docstring
Returns the connection data source URI string representation
%End

    void setUri( const QString &uri );
%Docstring
Sets the connection data source URI to ``uri``
%End

    QVariantMap configuration() const;
%Docstring
Returns the connection configuration parameters
%End

    void setConfiguration( const QVariantMap &configuration );
%Docstring
Sets the connection ``configuration``
%End

};

/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/providers/qgsabstractproviderconnection.h                   *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/