sipify core field formatter

This commit is contained in:
Denis Rouzaud 2017-05-23 14:35:48 +02:00
parent 30a7e44d57
commit cf68aed755
9 changed files with 232 additions and 104 deletions

View File

@ -57,13 +57,6 @@ core/gps/qgsgpsdconnection.sip
core/gps/qgsgpsdetector.sip
core/gps/qgsnmeaconnection.sip
core/gps/qgsqtlocationconnection.sip
core/fieldformatter/qgsdatetimefieldformatter.sip
core/fieldformatter/qgsfallbackfieldformatter.sip
core/fieldformatter/qgskeyvaluefieldformatter.sip
core/fieldformatter/qgslistfieldformatter.sip
core/fieldformatter/qgsrelationreferencefieldformatter.sip
core/fieldformatter/qgsvaluemapfieldformatter.sip
core/fieldformatter/qgsvaluerelationfieldformatter.sip
core/raster/qgsbilinearrasterresampler.sip
core/raster/qgsbrightnesscontrastfilter.sip
core/raster/qgscliptominmaxenhancement.sip

View File

@ -1,29 +1,50 @@
/***************************************************************************
qgsdatetimefieldformatter.sip - QgsDateTimeFieldFormatter
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/fieldformatter/qgsdatetimefieldformatter.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
---------------------
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 QgsDateTimeFieldFormatter : QgsFieldFormatter
{
%Docstring
Field formatter for a date time field.
This represents a date, time or datetime value based on
the field configuration.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsdatetimefieldformatter.h"
%End
public:
QgsDateTimeFieldFormatter();
static const QString DEFAULT_DATE_FORMAT;
static const QString DEFAULT_TIME_FORMAT;
static const QString DEFAULT_DATETIME_FORMAT;
QString id() const;
virtual 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 );
static QString defaultFormat( QVariant::Type type );
%Docstring
Get the default format in function of the type.
The type is expected to be one of
- QVariant.DateTime
- QVariant.Date
- QVariant.Time
:rtype: str
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/fieldformatter/qgsdatetimefieldformatter.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,9 +1,32 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/fieldformatter/qgsfallbackfieldformatter.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsFallbackFieldFormatter : QgsFieldFormatter
{
%Docstring
A default fallback field formatter in case no specialized field formatter is defined.
The values will be returned unmodified.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsfallbackfieldformatter.h"
%End
public:
QgsFallbackFieldFormatter();
QString id() const;
virtual QString id() const;
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/fieldformatter/qgsfallbackfieldformatter.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,25 +1,37 @@
/***************************************************************************
qgskeyvaluefieldformatter.sip - QgsKeyValueFieldFormatter
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/fieldformatter/qgskeyvaluefieldformatter.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
---------------------
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 QgsKeyValueFieldFormatter : QgsFieldFormatter
{
%Docstring
Field formatter for a key value field.
This represents a list type value.
Values will be represented as a colon-delimited and
comma-separated list.
E.g. "color: yellow, amount: 5"
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgskeyvaluefieldformatter.h"
%End
public:
QgsKeyValueFieldFormatter();
QString id() const;
QString representValue( QgsVectorLayer *layer, int fieldIndex, const QVariantMap &config, const QVariant &cache, const QVariant &value ) const;
virtual QString id() const;
virtual QString representValue( QgsVectorLayer *layer, int fieldIndex, const QVariantMap &config, const QVariant &cache, const QVariant &value ) const;
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/fieldformatter/qgskeyvaluefieldformatter.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,28 +1,35 @@
/***************************************************************************
qgslistfieldformatter.sip - QgsListFieldFormatter
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/fieldformatter/qgslistfieldformatter.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
---------------------
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 QgsListFieldFormatter : QgsFieldFormatter
{
%Docstring
Field formatter for a list field.
This represents a list type value.
Values will be represented as a comma-separated list.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgslistfieldformatter.h"
%End
public:
QgsListFieldFormatter();
virtual QString id() const;
QString id() const;
QString representValue( QgsVectorLayer *layer, int fieldIndex, const QVariantMap &config, const QVariant &cache, const QVariant &value ) const;
virtual QString representValue( QgsVectorLayer *layer, int fieldIndex, const QVariantMap &config, const QVariant &cache, const QVariant &value ) const;
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/fieldformatter/qgslistfieldformatter.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,12 +1,37 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/fieldformatter/qgsrelationreferencefieldformatter.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsRelationReferenceFieldFormatter : QgsFieldFormatter
{
%Docstring
Field formatter for a relation reference field.
A value relation field formatter looks up the values from
features on another layer.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsrelationreferencefieldformatter.h"
%End
public:
QgsRelationReferenceFieldFormatter();
virtual QString id() const;
QString id() const;
virtual QString representValue( QgsVectorLayer *layer, int fieldIndex, const QVariantMap &config, const QVariant &cache, const QVariant &value ) const;
virtual QVariant sortValue( QgsVectorLayer *layer, int fieldIndex, const QVariantMap&config, const QVariant &cache, const QVariant &value ) const;
virtual QVariant sortValue( QgsVectorLayer *layer, int fieldIndex, const QVariantMap &config, const QVariant &cache, const QVariant &value ) const;
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/fieldformatter/qgsrelationreferencefieldformatter.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,29 +1,53 @@
/***************************************************************************
qgsvaluemapfieldformatter.sip - QgsValueMapFieldFormatter
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/fieldformatter/qgsvaluemapfieldformatter.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
---------------------
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 QgsValueMapFieldFormatter : QgsFieldFormatter
{
%Docstring
Field formatter for a ValueMap field.
A value relation field formatter looks up the values a map.
The map is defined in the configuration as dictionary under the key "map".
{ "map": { 1: "one", 2: "two", 3: "three" } }
Values that are not on the map will be wrapped in parentheses. So with the above
configuration:
- 3 => "three"
- 5 => "(5)"
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsvaluemapfieldformatter.h"
%End
public:
QgsValueMapFieldFormatter();
QString id() const;
static const QString NULL_VALUE;
%Docstring
Will be saved in the configuration when a value is NULL.
It's the magic UUID {2839923C-8B7D-419E-B84B-CA2FE9B80EC7}
%End
QString representValue( QgsVectorLayer *layer, int fieldIndex, const QVariantMap &config, const QVariant &cache, const QVariant &value ) const;
virtual QString id() const;
QVariant sortValue( QgsVectorLayer *layer, int fieldIndex, const QVariantMap &config, const QVariant &cache, const QVariant &value ) const;
virtual QString representValue( QgsVectorLayer *layer, int fieldIndex, const QVariantMap &config, const QVariant &cache, const QVariant &value ) const;
virtual QVariant sortValue( QgsVectorLayer *layer, int fieldIndex, const QVariantMap &config, const QVariant &cache, const QVariant &value ) const;
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/fieldformatter/qgsvaluemapfieldformatter.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,24 +1,26 @@
/***************************************************************************
qgsvaluerelationfieldformatter.sip - QgsValueRelationFieldFormatter
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/fieldformatter/qgsvaluerelationfieldformatter.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
---------------------
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 QgsValueRelationFieldFormatter : QgsFieldFormatter
{
%Docstring
Field formatter for a value relation field.
A value relation field formatter looks up the values from
features on another layer.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsvaluerelationfieldformatter.h"
%End
public:
struct ValueRelationItem
{
@ -34,12 +36,33 @@ class QgsValueRelationFieldFormatter : QgsFieldFormatter
QgsValueRelationFieldFormatter();
QString id() const;
QString representValue( QgsVectorLayer *layer, int fieldIndex, const QVariantMap &config, const QVariant &cache, const QVariant &value ) const;
virtual QString id() const;
QVariant sortValue( QgsVectorLayer *layer, int fieldIndex, const QVariantMap &config, const QVariant &cache, const QVariant &value ) const;
virtual QString representValue( QgsVectorLayer *layer, int fieldIndex, const QVariantMap &config, const QVariant &cache, const QVariant &value ) const;
virtual QVariant sortValue( QgsVectorLayer *layer, int fieldIndex, const QVariantMap &config, const QVariant &cache, const QVariant &value ) const;
virtual QVariant createCache( QgsVectorLayer *layer, int fieldIndex, const QVariantMap &config ) const;
QVariant createCache( QgsVectorLayer *layer, int fieldIndex, const QVariantMap &config ) const;
static QgsValueRelationFieldFormatter::ValueRelationCache createCache( const QVariantMap &config );
%Docstring
Create a cache for a value relation field.
This can be used to keep the value map in the local memory
if doing multiple lookups in a loop.
.. versionadded:: 3.0
:rtype: QgsValueRelationFieldFormatter.ValueRelationCache
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/fieldformatter/qgsvaluerelationfieldformatter.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -47,7 +47,7 @@ class CORE_EXPORT QgsValueRelationFieldFormatter : public QgsFieldFormatter
QString value;
};
typedef QVector < ValueRelationItem > ValueRelationCache;
typedef QVector < QgsValueRelationFieldFormatter::ValueRelationItem > ValueRelationCache;
QgsValueRelationFieldFormatter();
@ -65,7 +65,7 @@ class CORE_EXPORT QgsValueRelationFieldFormatter : public QgsFieldFormatter
*
* \since QGIS 3.0
*/
static ValueRelationCache createCache( const QVariantMap &config );
static QgsValueRelationFieldFormatter::ValueRelationCache createCache( const QVariantMap &config );
};
Q_DECLARE_METATYPE( QgsValueRelationFieldFormatter::ValueRelationCache )