1/************************************************************************
2 * This file has been generated automatically from                      *
3 *                                                                      *
4 * src/core/qgsmaplayerproxymodel.h                                     *
5 *                                                                      *
6 * Do not edit manually ! Edit header and run scripts/sipify.pl again   *
7 ************************************************************************/
8
9
10
11
12
13class QgsMapLayerProxyModel : QSortFilterProxyModel
14{
15%Docstring
16The QgsMapLayerProxyModel class provides an easy to use model to display the list of layers in widgets.
17
18.. versionadded:: 2.3
19%End
20
21%TypeHeaderCode
22#include "qgsmaplayerproxymodel.h"
23%End
24  public:
25    enum Filter
26    {
27      RasterLayer,
28      NoGeometry,
29      PointLayer,
30      LineLayer,
31      PolygonLayer,
32      HasGeometry,
33      VectorLayer,
34      PluginLayer,
35      WritableLayer,
36      MeshLayer,
37      VectorTileLayer,
38      All
39    };
40    typedef QFlags<QgsMapLayerProxyModel::Filter> Filters;
41
42
43    explicit QgsMapLayerProxyModel( QObject *parent /TransferThis/ = 0 );
44%Docstring
45QgsMapLayerProxModel creates a proxy model with a QgsMapLayerModel as source model.
46It can be used to filter the layers list in a widget.
47%End
48
49    QgsMapLayerModel *sourceLayerModel() const;
50%Docstring
51layerModel returns the QgsMapLayerModel used in this QSortFilterProxyModel
52%End
53
54    QgsMapLayerProxyModel *setFilters( QgsMapLayerProxyModel::Filters filters );
55%Docstring
56Sets ``filter`` flags which affect how layers are filtered within the model.
57
58.. seealso:: :py:func:`filters`
59
60.. versionadded:: 2.3
61%End
62
63    const Filters &filters() const;
64%Docstring
65Returns the filter flags which affect how layers are filtered within the model.
66
67.. seealso:: :py:func:`setFilters`
68
69.. versionadded:: 2.3
70%End
71
72    static bool layerMatchesFilters( const QgsMapLayer *layer, const Filters &filters );
73%Docstring
74Returns if the ``layer`` matches the given ``filters``
75
76.. versionadded:: 3.14
77%End
78
79 void setLayerWhitelist( const QList<QgsMapLayer *> &layers ) /Deprecated/;
80%Docstring
81Sets an allowlist of ``layers`` to include within the model. Only layers
82from this list will be shown.
83
84An empty list indicates that no filter by allowlist should be performed.
85
86.. seealso:: :py:func:`layerAllowlist`
87
88.. seealso:: :py:func:`setExceptedLayerList`
89
90.. deprecated::
91   use setLayerAllowList()
92%End
93
94    void setLayerAllowlist( const QList<QgsMapLayer *> &layers );
95%Docstring
96Sets an allowlist of ``layers`` to include within the model. Only layers
97from this list will be shown.
98
99An empty list indicates that no filter by allowlist should be performed.
100
101.. seealso:: :py:func:`layerAllowlist`
102
103.. seealso:: :py:func:`setExceptedLayerList`
104
105.. versionadded:: 3.14
106%End
107
108 QList<QgsMapLayer *> layerWhitelist() /Deprecated/;
109%Docstring
110Returns the list of layers which are excluded from the model.
111
112An empty list indicates that no filtering by allowlist should be performed.
113
114.. seealso:: :py:func:`setLayerAllowlist`
115
116.. seealso:: :py:func:`exceptedLayerList`
117
118.. deprecated::
119   use layerAllowlist() instead
120%End
121
122    QList<QgsMapLayer *> layerAllowlist();
123%Docstring
124Returns the list of layers which are excluded from the model.
125
126An empty list indicates that no filtering by allowlist should be performed.
127
128.. seealso:: :py:func:`setLayerAllowlist`
129
130.. seealso:: :py:func:`exceptedLayerList`
131
132.. versionadded:: 3.14
133%End
134
135    void setExceptedLayerList( const QList<QgsMapLayer *> &exceptList );
136%Docstring
137Sets a blocklist of layers to exclude from the model.
138
139.. seealso:: :py:func:`exceptedLayerList`
140
141.. seealso:: :py:func:`setExceptedLayerIds`
142
143.. seealso:: :py:func:`setLayerAllowlist`
144%End
145
146    QList<QgsMapLayer *> exceptedLayerList();
147%Docstring
148Returns the blocklist of layers which are excluded from the model.
149
150.. seealso:: :py:func:`setExceptedLayerList`
151
152.. seealso:: :py:func:`exceptedLayerIds`
153
154.. seealso:: :py:func:`layerAllowlist`
155%End
156
157    void setExceptedLayerIds( const QStringList &ids );
158%Docstring
159Sets a blocklist of layers (by layer ID) to exclude from the model.
160
161.. seealso:: :py:func:`exceptedLayerIds`
162
163.. seealso:: :py:func:`setExceptedLayerList`
164%End
165
166    QStringList exceptedLayerIds() const;
167%Docstring
168Returns the blocklist of layer IDs which are excluded from the model.
169
170.. seealso:: :py:func:`setExceptedLayerIds`
171
172.. seealso:: :py:func:`exceptedLayerList`
173%End
174
175    void setExcludedProviders( const QStringList &providers );
176%Docstring
177Sets a blocklist of data providers which should be excluded from the model.
178
179.. seealso:: :py:func:`excludedProviders`
180
181.. versionadded:: 3.0
182%End
183
184    QStringList excludedProviders() const;
185%Docstring
186Returns the blocklist of data providers which are excluded from the model.
187
188.. seealso:: :py:func:`setExcludedProviders`
189
190.. versionadded:: 3.0
191%End
192
193    QString filterString() const;
194%Docstring
195Returns the current filter string, if set.
196
197.. seealso:: :py:func:`setFilterString`
198
199.. versionadded:: 3.4
200%End
201
202    bool acceptsLayer( QgsMapLayer *layer ) const;
203%Docstring
204Returns ``True`` if the proxy model accepts the specified map ``layer``.
205
206.. versionadded:: 3.8
207%End
208
209    virtual bool filterAcceptsRow( int source_row, const QModelIndex &source_parent ) const;
210
211    virtual bool lessThan( const QModelIndex &left, const QModelIndex &right ) const;
212
213
214  public slots:
215
216    void setFilterString( const QString &filter );
217%Docstring
218Sets a ``filter`` string, such that only layers with names matching the
219specified string will be shown.
220
221.. seealso:: :py:func:`filterString`
222
223.. versionadded:: 3.4
224%End
225
226};
227
228QFlags<QgsMapLayerProxyModel::Filter> operator|(QgsMapLayerProxyModel::Filter f1, QFlags<QgsMapLayerProxyModel::Filter> f2);
229
230
231/************************************************************************
232 * This file has been generated automatically from                      *
233 *                                                                      *
234 * src/core/qgsmaplayerproxymodel.h                                     *
235 *                                                                      *
236 * Do not edit manually ! Edit header and run scripts/sipify.pl again   *
237 ************************************************************************/
238