File: qgsfielddomain.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 (533 lines) | stat: -rw-r--r-- 13,689 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/vector/qgsfielddomain.h                                     *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/



class QgsFieldDomain
{
%Docstring(signature="appended")
Base class for field domains.

A field domain is a set of constraints that apply to one or several
fields.

.. versionadded:: 3.26
%End

%TypeHeaderCode
#include "qgsfielddomain.h"
%End
%ConvertToSubClassCode
    if ( sipCpp->type() == Qgis::FieldDomainType::Coded )
    {
      sipType = sipType_QgsCodedFieldDomain;
    }
    else if ( sipCpp->type() == Qgis::FieldDomainType::Range )
    {
      sipType = sipType_QgsRangeFieldDomain;
    }
    else if ( sipCpp->type() == Qgis::FieldDomainType::Glob )
    {
      sipType = sipType_QgsGlobFieldDomain;
    }
    else
    {
      sipType = 0;
    }
%End
  public:

    QgsFieldDomain( const QString &name,
                    const QString &description,
                    QMetaType::Type fieldType );
%Docstring
Constructor for QgsFieldDomain, with the specified ``name``,
``description`` and ``fieldType``.
%End

 QgsFieldDomain( const QString &name,
                                      const QString &description,
                                      QVariant::Type fieldType ) /Deprecated/;
%Docstring
Constructor for QgsFieldDomain, with the specified ``name``,
``description`` and ``fieldType``.

.. deprecated:: 3.38

   Use the method with a QMetaType.Type argument instead.
%End

    virtual ~QgsFieldDomain();

    virtual QgsFieldDomain *clone() const = 0 /Factory/;
%Docstring
Clones the field domain.
%End

    virtual Qgis::FieldDomainType type() const = 0;
%Docstring
Returns the type of field domain.
%End

    virtual QString typeName() const = 0;
%Docstring
Returns a translated name of the field domain type.
%End

    QString name() const;
%Docstring
Returns the name of the field domain.

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

    void setName( const QString &name );
%Docstring
Sets the ``name`` of the field domain.

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

    QString description() const;
%Docstring
Returns the description of the field domain.

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

    void setDescription( const QString &description );
%Docstring
Sets the ``description`` of the field domain.

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

    QMetaType::Type fieldType() const;
%Docstring
Returns the associated field type.

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

    void setFieldType( QMetaType::Type type );
%Docstring
Sets the associated field ``type``.

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

 void setFieldType( QVariant::Type type ) /Deprecated/;
%Docstring
Sets the associated field ``type``.

.. seealso:: :py:func:`fieldType`

.. deprecated:: 3.38

   Use the method with a QMetaType.Type argument instead.
%End

    Qgis::FieldDomainSplitPolicy splitPolicy() const;
%Docstring
Returns the split policy.

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

    void setSplitPolicy( Qgis::FieldDomainSplitPolicy policy );
%Docstring
Sets the split ``policy``.

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

    Qgis::FieldDomainMergePolicy mergePolicy() const;
%Docstring
Returns the merge policy.

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

    void setMergePolicy( Qgis::FieldDomainMergePolicy policy );
%Docstring
Sets the merge ``policy``.

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

  protected:



};

class QgsCodedValue
{
%Docstring(signature="appended")
Associates a code and a value.

.. versionadded:: 3.26
%End

%TypeHeaderCode
#include "qgsfielddomain.h"
%End
  public:

    QgsCodedValue( const QVariant &code, const QString &value );
%Docstring
Constructor for QgsCodedValue, with the associated ``code`` and
``value``.

The ``code`` is the underlying value stored in feature attributes, while
the ``value`` is the user-facing string representation.
%End

    QVariant code() const;
%Docstring
Returns the associated code, which is the underlying value stored in
fields.
%End

    QString value() const;
%Docstring
Returns the associated value, which is the user-friendly string
representation.
%End

    SIP_PYOBJECT __repr__();
%MethodCode
    QString str = QStringLiteral( "<QgsCodedValue: %1 (%2)>" ).arg( sipCpp->code().toString(), sipCpp->value() );
    sipRes = PyUnicode_FromString( str.toUtf8().constData() );
%End

    bool operator==( const QgsCodedValue &other ) const;
    bool operator!=( const QgsCodedValue &other ) const;

};


class QgsCodedFieldDomain : QgsFieldDomain
{
%Docstring(signature="appended")
Definition of a coded / enumerated field domain.

A code field domain is a domain for which only a limited set of codes,
associated with their expanded value, are allowed. The type of the code
should be the one of the field domain.

.. versionadded:: 3.26
%End

%TypeHeaderCode
#include "qgsfielddomain.h"
%End
  public:

    QgsCodedFieldDomain( const QString &name,
                         const QString &description,
                         QMetaType::Type fieldType,
                         const QList<QgsCodedValue> &values );
%Docstring
Constructor for QgsCodedFieldDomain, with the associated ``name``,
``description`` and ``fieldType``.

The ``values`` list details the coded field values as
:py:class:`QgsCodedValue` objects. Each code should appear only once,
but it is the responsibility of the user to check this.
%End

 QgsCodedFieldDomain( const QString &name,
                                           const QString &description,
                                           QVariant::Type fieldType,
                                           const QList<QgsCodedValue> &values ) /Deprecated/;
%Docstring
Constructor for QgsCodedFieldDomain, with the associated ``name``,
``description`` and ``fieldType``.

The ``values`` list details the coded field values as
:py:class:`QgsCodedValue` objects. Each code should appear only once,
but it is the responsibility of the user to check this.

.. deprecated:: 3.38

   Use the method with a QMetaType.Type argument instead.
%End


    virtual Qgis::FieldDomainType type() const;

    virtual QString typeName() const;

    virtual QgsCodedFieldDomain *clone() const /Factory/;


    QList< QgsCodedValue> values() const;
%Docstring
Returns the enumeration as :py:class:`QgsCodedValue` values.

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

    void setValues( const QList< QgsCodedValue> &values );
%Docstring
Sets the enumeration as :py:class:`QgsCodedValue` ``values``.

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

    SIP_PYOBJECT __repr__();
%MethodCode
    QString str = QStringLiteral( "<QgsCodedFieldDomain: %1>" ).arg( sipCpp->name() );
    sipRes = PyUnicode_FromString( str.toUtf8().constData() );
%End

  private:
    QgsCodedFieldDomain( const QgsCodedFieldDomain & );
};


class QgsRangeFieldDomain : QgsFieldDomain
{
%Docstring(signature="appended")
Definition of a numeric field domain with a range of validity for
values.

.. versionadded:: 3.26
%End

%TypeHeaderCode
#include "qgsfielddomain.h"
%End
  public:

    QgsRangeFieldDomain( const QString &name,
                         const QString &description,
                         QMetaType::Type fieldType,
                         const QVariant &minimum,
                         bool minimumIsInclusive,
                         const QVariant &maximum,
                         bool maximumIsInclusive );
%Docstring
Constructor for QgsRangeFieldDomain, with the specified ``name``,
``description`` and ``fieldType``.

Set an invalid QVariant for ``minimum`` or ``maximum`` respectively if
no minimum or maximum value is desired.
%End

 QgsRangeFieldDomain( const QString &name,
                                           const QString &description,
                                           QVariant::Type fieldType,
                                           const QVariant &minimum,
                                           bool minimumIsInclusive,
                                           const QVariant &maximum,
                                           bool maximumIsInclusive ) /Deprecated/;
%Docstring
Constructor for QgsRangeFieldDomain, with the specified ``name``,
``description`` and ``fieldType``.

Set an invalid QVariant for ``minimum`` or ``maximum`` respectively if
no minimum or maximum value is desired.

.. deprecated:: 3.38

   Use the method with a QMetaType.Type argument instead.
%End



    virtual Qgis::FieldDomainType type() const;

    virtual QString typeName() const;

    virtual QgsRangeFieldDomain *clone() const /Factory/;


    QVariant minimum() const;
%Docstring
Returns the minimum value.

If no minimum value is set then an invalid variant will be returned.

.. seealso:: :py:func:`minimumIsInclusive`

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

    void setMinimum( const QVariant &minimum );
%Docstring
Sets the ``minimum`` allowed value.

If no minimum value is desired then an invalid variant should be set.

.. seealso:: :py:func:`setMinimumIsInclusive`

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

    bool minimumIsInclusive() const;
%Docstring
Returns ``True`` if the minimum value is inclusive.

.. seealso:: :py:func:`minimum`

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

    void setMinimumIsInclusive( bool inclusive );
%Docstring
Sets whether the minimum value is ``inclusive``.

.. seealso:: :py:func:`setMinimum`

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

    QVariant maximum() const;
%Docstring
Returns the maximum value.

If no maximum value is set then an invalid variant will be returned.

.. seealso:: :py:func:`maximumIsInclusive`

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

    void setMaximum( const QVariant &maximum );
%Docstring
Sets the ``maximum`` allowed value.

If no maximum value is desired then an invalid variant should be set.

.. seealso:: :py:func:`setMaximumIsInclusive`

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

    bool maximumIsInclusive() const;
%Docstring
Returns ``True`` if the maximum value is inclusive.

.. seealso:: :py:func:`maximum`

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

    void setMaximumIsInclusive( bool inclusive );
%Docstring
Sets whether the maximum value is ``inclusive``.

.. seealso:: :py:func:`setMaximum`

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

    SIP_PYOBJECT __repr__();
%MethodCode
    QString str = QStringLiteral( "<QgsRangeFieldDomain: %1 %2%3, %4%5>" ).arg( sipCpp->name(),
                  sipCpp->minimumIsInclusive() ? QStringLiteral( "[" ) : QStringLiteral( "(" ),
                  sipCpp->minimum().toString(),
                  sipCpp->maximum().toString(),
                  sipCpp->maximumIsInclusive() ? QStringLiteral( "]" ) : QStringLiteral( ")" ) );
    sipRes = PyUnicode_FromString( str.toUtf8().constData() );
%End

  private:
    QgsRangeFieldDomain( const QgsRangeFieldDomain & );
};


class QgsGlobFieldDomain : QgsFieldDomain
{
%Docstring(signature="appended")
Definition of a field domain for field content validated by a glob.

Globs are matching expression like ``*[a-z][0-1]?``

.. versionadded:: 3.26
%End

%TypeHeaderCode
#include "qgsfielddomain.h"
%End
  public:

    QgsGlobFieldDomain( const QString &name,
                        const QString &description,
                        QMetaType::Type fieldType,
                        const QString &glob );
%Docstring
Constructor for QgsGlobFieldDomain, with the specified ``name``,
``description`` and ``fieldType``.

The ``glob`` argument specifies the content validation glob, e.g.
``*[a-z][0-1]?``.
%End

 QgsGlobFieldDomain( const QString &name,
                                          const QString &description,
                                          QVariant::Type fieldType,
                                          const QString &glob ) /Deprecated/;
%Docstring
Constructor for QgsGlobFieldDomain, with the specified ``name``,
``description`` and ``fieldType``.

The ``glob`` argument specifies the content validation glob, e.g.
``*[a-z][0-1]?``.

.. deprecated:: 3.38

   Use the method with a QMetaType.Type argument instead.
%End



    virtual Qgis::FieldDomainType type() const;

    virtual QString typeName() const;

    virtual QgsGlobFieldDomain *clone() const /Factory/;


    QString glob() const;
%Docstring
Returns the glob expression.

Globs are matching expression like ``*[a-z][0-1]?``

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

    void setGlob( const QString &glob );
%Docstring
Sets the ``glob`` expression.

Globs are matching expression like ``*[a-z][0-1]?``

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

    SIP_PYOBJECT __repr__();
%MethodCode
    QString str = QStringLiteral( "<QgsGlobFieldDomain: %1 '%2'>" ).arg( sipCpp->name(), sipCpp->glob() );
    sipRes = PyUnicode_FromString( str.toUtf8().constData() );
%End

  private:
    QgsGlobFieldDomain( const QgsGlobFieldDomain & );
};

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