Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Python bindings
- Loading branch information
Showing
10 changed files
with
276 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/*************************************************************************** | ||
qgsdatetimefieldkit.sip - QgsDateTimeFieldKit | ||
|
||
--------------------- | ||
begin : 2.12.2016 | ||
copyright : (C) 2016 by Matthias Kuhn | ||
email : matthias@opengis.ch | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
class QgsDateTimeFieldKit : QgsFieldKit | ||
{ | ||
%TypeHeaderCode | ||
#include "qgsdatetimefieldkit.h" | ||
%End | ||
public: | ||
QgsDateTimeFieldKit(); | ||
|
||
QString id() const; | ||
|
||
virtual QString representValue( QgsVectorLayer* layer, int fieldIndex, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const; | ||
|
||
static QString defaultFormat( const QVariant::Type type ); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class QgsFallbackFieldKit : QgsFieldKit | ||
{ | ||
%TypeHeaderCode | ||
#include "qgsfallbackfieldkit.h" | ||
%End | ||
public: | ||
QgsFallbackFieldKit(); | ||
QString id() const; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/*************************************************************************** | ||
qgskeyvaluefieldkit.sip - QgsKeyValueFieldKit | ||
|
||
--------------------- | ||
begin : 3.12.2016 | ||
copyright : (C) 2016 by Matthias Kuhn | ||
email : matthias@opengis.ch | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
class QgsKeyValueFieldKit : QgsFieldKit | ||
{ | ||
%TypeHeaderCode | ||
#include "qgskeyvaluefieldkit" | ||
%End | ||
public: | ||
QgsKeyValueFieldKit(); | ||
QString id() const; | ||
QString representValue( QgsVectorLayer* vl, int fieldIdx, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/*************************************************************************** | ||
qgslistfieldkit.sip - QgsListFieldKit | ||
|
||
--------------------- | ||
begin : 3.12.2016 | ||
copyright : (C) 2016 by Matthias Kuhn | ||
email : matthias@opengis.ch | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
class QgsListFieldKit : QgsFieldKit | ||
{ | ||
%TypeHeaderCode | ||
#include "qgslistfieldkit.h" | ||
%End | ||
|
||
public: | ||
QgsListFieldKit(); | ||
|
||
QString id() const; | ||
|
||
QString representValue( QgsVectorLayer* vl, int fieldIdx, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/*************************************************************************** | ||
qgsrelationreferencefieldkit.sip - QgsRelationReferenceFieldKit | ||
|
||
--------------------- | ||
begin : 3.12.2016 | ||
copyright : (C) 2016 by Matthias Kuhn | ||
email : matthias@opengis.ch | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
class QgsRelationReferenceFieldKit : QgsFieldKit | ||
{ | ||
%TypeHeaderCode | ||
#include "qgsrelationreferencefieldkit" | ||
%End | ||
public: | ||
QgsRelationReferenceFieldKit(); | ||
|
||
QString id() const; | ||
|
||
virtual QString representValue( QgsVectorLayer* vl, int fieldIdx, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const override; | ||
|
||
virtual QVariant sortValue( QgsVectorLayer *vl, int fieldIdx, const QVariantMap&config, const QVariant& cache, const QVariant& value ) const override; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/*************************************************************************** | ||
qgsvaluemapfieldkit.sip - QgsValueMapFieldKit | ||
|
||
--------------------- | ||
begin : 3.12.2016 | ||
copyright : (C) 2016 by Matthias Kuhn | ||
email : matthias@opengis.ch | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
class QgsValueMapFieldKit : QgsFieldKit | ||
{ | ||
%TypeHeaderCode | ||
#include "qgsvaluemapfieldkit.h" | ||
%End | ||
public: | ||
QgsValueMapFieldKit(); | ||
|
||
QString id() const; | ||
|
||
QString representValue( QgsVectorLayer* vl, int fieldIdx, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const; | ||
|
||
QVariant sortValue( QgsVectorLayer* vl, int fieldIdx, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/*************************************************************************** | ||
qgsvaluerelationfieldkit.sip - QgsValueRelationFieldKit | ||
|
||
--------------------- | ||
begin : 3.12.2016 | ||
copyright : (C) 2016 by Matthias Kuhn | ||
email : matthias@opengis.ch | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
class QgsValueRelationFieldKit : QgsFieldKit | ||
{ | ||
%TypeHeaderCode | ||
#include "qgsvaluerelationfieldkit" | ||
%End | ||
|
||
public: | ||
struct ValueRelationItem | ||
{ | ||
ValueRelationItem( const QVariant& key, const QString& value ); | ||
|
||
ValueRelationItem(); | ||
|
||
QVariant key; | ||
QString value; | ||
}; | ||
|
||
typedef QVector < ValueRelationItem > ValueRelationCache; | ||
|
||
QgsValueRelationFieldKit(); | ||
|
||
QString id() const; | ||
QString representValue( QgsVectorLayer *layer, int fieldIdx, const QVariantMap &config, const QVariant &cache, const QVariant &value ) const; | ||
|
||
QVariant sortValue( QgsVectorLayer *vl, int fieldIdx, const QVariantMap &config, const QVariant &cache, const QVariant &value ) const; | ||
|
||
QVariant createCache( QgsVectorLayer *vl, int fieldIdx, const QVariantMap &config ) const; | ||
|
||
static ValueRelationCache createCache( const QVariantMap& config ); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/*************************************************************************** | ||
qgsfieldkit.sip - QgsFieldKit | ||
|
||
--------------------- | ||
begin : 2.12.2016 | ||
copyright : (C) 2016 by Matthias Kuhn | ||
email : matthias@opengis.ch | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
class QgsFieldKit | ||
{ | ||
%TypeHeaderCode | ||
#include "qgsfieldkit.h" | ||
%End | ||
public: | ||
QgsFieldKit(); | ||
|
||
virtual ~QgsFieldKit(); | ||
|
||
virtual QString id() const = 0; | ||
|
||
virtual QString representValue( QgsVectorLayer* layer, int fieldIdx, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const; | ||
|
||
virtual QVariant sortValue( QgsVectorLayer* vl, int fieldIdx, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const; | ||
|
||
virtual Qt::AlignmentFlag alignmentFlag( QgsVectorLayer* vl, int fieldIdx, const QVariantMap& config ) const; | ||
|
||
virtual QVariant createCache( QgsVectorLayer* vl, int fieldIdx, const QVariantMap& config ) const; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/*************************************************************************** | ||
qgsfieldkitregistry.sip - QgsFieldKitRegistry | ||
|
||
--------------------- | ||
begin : 2.12.2016 | ||
copyright : (C) 2016 by Matthias Kuhn | ||
email : matthias@opengis.ch | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
class QgsFieldKitRegistry : QObject | ||
{ | ||
%TypeHeaderCode | ||
#include "qgsfieldkitregistry.h" | ||
%End | ||
public: | ||
|
||
QgsFieldKitRegistry(); | ||
~QgsFieldKitRegistry(); | ||
|
||
void addFieldKit( QgsFieldKit* kit /Transfer/ ); | ||
|
||
void removeFieldKit( QgsFieldKit* kit ); | ||
|
||
QgsFieldKit* fieldKit( const QString& id ) const; | ||
|
||
signals: | ||
void fieldKitAdded( QgsFieldKit* kit ); | ||
|
||
void fieldKitRemoved( QgsFieldKit* kit ); | ||
}; |