QGIS/python/core/auto_generated/settings/qgssettingsentry.sip.in

638 lines
20 KiB
Plaintext

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/settings/qgssettingsentry.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsSettingsEntryBase
{
%Docstring(signature="appended")
Represent settings entry and provides methods for reading and writing settings values.
Different subclasses are provided for different settings types with metainformations
to validate set values and provide more accurate settings description for the gui.
.. versionadded:: 3.20
%End
%TypeHeaderCode
#include "qgssettingsentry.h"
%End
%ConvertToSubClassCode
if ( dynamic_cast< QgsSettingsEntryVariant * >( sipCpp ) )
sipType = sipType_QgsSettingsEntryVariant;
else if ( dynamic_cast< QgsSettingsEntryString * >( sipCpp ) )
sipType = sipType_QgsSettingsEntryString;
else if ( dynamic_cast< QgsSettingsEntryStringList * >( sipCpp ) )
sipType = sipType_QgsSettingsEntryStringList;
else if ( dynamic_cast< QgsSettingsEntryVariantMap * >( sipCpp ) )
sipType = sipType_QgsSettingsEntryVariantMap;
else if ( dynamic_cast< QgsSettingsEntryBool * >( sipCpp ) )
sipType = sipType_QgsSettingsEntryBool;
else if ( dynamic_cast< QgsSettingsEntryInteger * >( sipCpp ) )
sipType = sipType_QgsSettingsEntryInteger;
else if ( dynamic_cast< QgsSettingsEntryDouble * >( sipCpp ) )
sipType = sipType_QgsSettingsEntryDouble;
else if ( dynamic_cast< QgsSettingsEntryColor * >( sipCpp ) )
sipType = sipType_QgsSettingsEntryColor;
else if ( dynamic_cast< QgsSettingsEntryBase * >( sipCpp ) )
sipType = sipType_QgsSettingsEntryBase;
else
sipType = NULL;
%End
public:
static QStringList dynamicKeyPartToList( const QString &dynamicKeyPart );
%Docstring
Transforms a dynamic key part string to list
.. versionadded:: 3.26
%End
QgsSettingsEntryBase( const QString &key,
const QString &section,
const QVariant &defaultValue = QVariant(),
const QString &description = QString(),
Qgis::SettingsOptions options = Qgis::SettingsOptions() );
%Docstring
Constructor for QgsSettingsEntryBase.
\arg key specifies the key of the settings.
\arg section specifies the section.
\arg defaultValue specifies the default value for the settings entry.
\arg description specifies a description for the settings entry.
\arg options specifies the options for the settings entry.
%End
QgsSettingsEntryBase( const QString &key,
QgsSettingsTreeNode *parentTreeElement,
const QVariant &defaultValue = QVariant(),
const QString &description = QString(),
Qgis::SettingsOptions options = Qgis::SettingsOptions() ) throw( QgsSettingsException );
%Docstring
Constructor for QgsSettingsEntryBase.
\arg key specifies the key of the settings.
\arg parent specifies the parent in the tree of settings.
\arg defaultValue specifies the default value for the settings entry.
\arg description specifies a description for the settings entry.
\arg options specifies the options for the settings entry.
:raises QgsSettingsException: if the number of given parent named items doesn't match the complete key definition
%End
virtual ~QgsSettingsEntryBase();
QString key( const QString &dynamicKeyPart = QString() ) const;
%Docstring
Returns settings entry key.
\arg dynamicKeyPart specifies the dynamic part of the settings key.
%End
QString key( const QStringList &dynamicKeyPartList ) const;
%Docstring
Returns settings entry key.
\arg dynamicKeyParts specifies the list of dynamic parts of the settings key.
%End
bool keyIsValid( const QString &key ) const;
%Docstring
Returns ``True`` if the provided key match the settings entry.
This is useful for settings with dynamic keys. For example this permits one to check that
the settings key "NewsFeed/httpsfeedqgisorg/27/content" is valid for the settings entry
defined with the key "NewsFeed/%1/%2/content"
\arg key to check
%End
QString definitionKey() const;
%Docstring
Returns settings entry defining key.
For dynamic settings it return the key with the placeholder for dynamic part
included. For non-dynamic settings returns the same as :py:func:`~QgsSettingsEntryBase.key`.
%End
bool hasDynamicKey() const;
%Docstring
Returns ``True`` if a part of the settings key is built dynamically.
%End
Qgis::SettingsOptions options() const;
%Docstring
Returns the settings options
.. versionadded:: 3.26
%End
bool exists( const QString &dynamicKeyPart = QString() ) const;
%Docstring
Returns ``True`` if the settings is contained in the underlying QSettings.
\arg dynamicKeyPart specifies the dynamic part of the settings key.
%End
bool exists( const QStringList &dynamicKeyPartList ) const;
%Docstring
Returns ``True`` if the settings is contained in the underlying QSettings.
\arg dynamicKeyParts specifies the list of dynamic parts of the settings key.
%End
Qgis::SettingsOrigin origin( const QStringList &dynamicKeyPartList ) const;
%Docstring
Returns the origin of the setting if it exists
.. note::
it will return Qgis.SettingsOrigin.Any if the key doesn't exist
.. versionadded:: 3.30
%End
void remove( const QString &dynamicKeyPart = QString() ) const;
%Docstring
Removes the settings from the underlying QSettings.
\arg dynamicKeyPart specifies the dynamic part of the settings key.
%End
void remove( const QStringList &dynamicKeyPartList ) const;
%Docstring
Removes the settings from the underlying QSettings.
\arg dynamicKeyParts specifies the list of dynamic parts of the settings key.
%End
QgsSettings::Section section() const;
%Docstring
Returns settings section. The settings section of the parent group is returned if available.
.. deprecated:: QGIS 3.26
the key is entirely self-defined
%End
virtual bool setVariantValue( const QVariant &value, const QString &dynamicKeyPart = QString() ) const /Deprecated/;
%Docstring
Set settings value.
The ``value`` to set.
\arg dynamicKeyPart specifies the dynamic part of the settings key.
.. deprecated:: QGIS 3.26
use setVariantValuePrivate or an implementation setValue instead
%End
virtual bool setVariantValue( const QVariant &value, const QStringList &dynamicKeyPartList ) const /Deprecated/;
%Docstring
Set settings value.
The ``value`` to set.
\arg dynamicKeyParts specifies the list of dynamic parts of the settings key.
.. deprecated:: QGIS 3.26
use setVariantValuePrivate or an implementation setValue instead
%End
QVariant valueAsVariant( const QString &dynamicKeyPart = QString() ) const;
%Docstring
Returns settings value with \arg dynamicKeyPart specifying the dynamic part of the settings key.
%End
QVariant valueAsVariant( const QStringList &dynamicKeyPartList ) const;
%Docstring
Returns settings value with \arg dynamicKeyPart specifying the dynamic part of the settings key.
%End
QVariant valueAsVariantWithDefaultOverride( const QVariant &defaultValueOverride, const QString &dynamicKeyPart = QString() ) const;
%Docstring
Returns settings value with a ``defaultValueOverride``
.. versionadded:: 3.26
%End
QVariant valueAsVariantWithDefaultOverride( const QVariant &defaultValueOverride, const QStringList &dynamicKeyPartList ) const;
%Docstring
Returns settings value.
\arg dynamicKeyPartList specifies the list of dynamic parts of the settings key.
\arg defaultValueOverride if valid is used instead of the normal default value.
.. versionadded:: 3.26
%End
QVariant valueAsVariant( const QString &dynamicKeyPart, bool useDefaultValueOverride, const QVariant &defaultValueOverride ) const /Deprecated/;
%Docstring
Returns settings value with an optional default value override
.. deprecated:: QGIS 3.26
use valueAsVariantWithDefaultOverride instead
%End
QVariant valueAsVariant( const QStringList &dynamicKeyPartList, bool useDefaultValueOverride, const QVariant &defaultValueOverride ) const /Deprecated/;
%Docstring
Returns settings value with an optional default value override
.. deprecated:: QGIS 3.26
use valueAsVariantWithDefaultOverride instead
%End
QVariant defaultValueAsVariant() const;
%Docstring
Returns settings default value.
%End
virtual Qgis::SettingsType settingsType() const;
%Docstring
Returns the settings entry type.
%End
QString description() const;
%Docstring
Returns the settings entry description.
%End
QVariant formerValueAsVariant( const QString &dynamicKeyPart ) const;
%Docstring
Returns the former value of the settings if it has been enabled in the options.
Returns the current value (or default) if there is no former value.
.. versionadded:: 3.26
%End
QVariant formerValueAsVariant( const QStringList &dynamicKeyPartList ) const;
%Docstring
Returns the former value of the settings if it has been enabled in the options
Returns the current value (or default) if there is no former value.
.. versionadded:: 3.26
%End
bool copyValueFromKey( const QString &key, bool removeSettingAtKey = false ) const;
%Docstring
Copies the value from a given key if it exists.
:param key: the key to copy the setting value from.
:param removeSettingAtKey: if ``True``, the setting at the old key will be removed.
:return: ``True`` if the key exists and the setting value could be copied.
.. versionadded:: 3.30
%End
bool copyValueFromKey( const QString &key, const QStringList &dynamicKeyPartList, bool removeSettingAtKey = false ) const;
%Docstring
Copies the value from a given key if it exists.
:param key: the key to copy the setting value from.
:param dynamicKeyPartList: is the optional dynamic key part to determine the key. It must be the same for origin and destination keys.
:param removeSettingAtKey: if ``True``, the setting at the old key will be removed.
:return: ``True`` if the key exists and the setting value could be copied.
.. versionadded:: 3.30
%End
void copyValueToKey( const QString &key, const QStringList &dynamicKeyPartList = QStringList() ) const;
%Docstring
Copies the settings to the given key.
:param key: the key to copy the setting value to.
:param dynamicKeyPartList: is the optional dynamic key part to determine the key. It must be the same for origin and destination keys.
.. versionadded:: 3.30
%End
QgsSettingsTreeNode *parent() const;
%Docstring
Returns the parent tree element
.. versionadded:: 3.30
%End
protected:
bool setVariantValuePrivate( const QVariant &value, const QStringList &dynamicKeyPartList = QStringList() ) const;
%Docstring
Sets the settings value with a variant value.
This should be called from any implementation as it takes care of actually calling QSettings
.. versionadded:: 3.26
%End
};
template<T>
class QgsSettingsEntryByReference : QgsSettingsEntryBase
{
%Docstring(signature="appended")
Base abstract class for settings entry which are passed by reference
.. seealso:: :py:class:`QgsSettingsEntryBase`
.. seealso:: :py:class:`QgsSettingsEntryByValue`
.. versionadded:: 3.26
%End
%TypeHeaderCode
#include "qgssettingsentry.h"
%End
public:
QgsSettingsEntryByReference( const QString &key,
QgsSettingsTreeNode *parent,
const T &defaultValue,
const QString &description = QString(),
Qgis::SettingsOptions options = Qgis::SettingsOptions() );
%Docstring
Constructor for QgsSettingsEntryByReference.
\arg key specifies the key of the settings.
\arg parent specifies the parent in the tree of settings.
\arg defaultValue specifies the default value for the settings entry.
\arg description specifies a description for the settings entry.
\arg optionss specifies the options for the settings entry.
:raises QgsSettingsException: if the number of given parent named items doesn't match the complete key definition
%End
QgsSettingsEntryByReference( const QString &key,
const QString &section,
const T &defaultValue,
const QString &description = QString(),
Qgis::SettingsOptions options = Qgis::SettingsOptions() );
%Docstring
Constructor for QgsSettingsEntryByReference.
\arg key specifies the key of the settings.
\arg section specifies the section.
\arg defaultValue specifies the default value for the settings entry.
\arg description specifies a description for the settings entry.
\arg optionss specifies the options for the settings entry.
%End
virtual Qgis::SettingsType settingsType() const = 0;
T value( const QString &dynamicKeyPart = QString() ) const;
%Docstring
Returns settings value.
:param dynamicKeyPart: specifies the dynamic part of the settings key.
%End
T value( const QStringList &dynamicKeyPartList ) const;
%Docstring
Returns settings value.
:param dynamicKeyPartList: specifies the list of dynamic parts of the settings key.
%End
T valueWithDefaultOverride( const T &defaultValueOverride, const QString &dynamicKeyPart = QString() ) const;
%Docstring
Returns the settings value with a ``defaultValueOverride`` and with an optional ``dynamicKeyPart``
%End
T valueWithDefaultOverride( const T &defaultValueOverride, const QStringList &dynamicKeyPartList ) const;
%Docstring
Returns the settings value with a ``defaultValueOverride`` for the ``dynamicKeyPartList``
%End
T value( const QString &dynamicKeyPart, bool useDefaultValueOverride, const T &defaultValueOverride ) const /Deprecated/;
%Docstring
Returns the settings value for the ``dynamicKeyPart`` and with a ``defaultValueOverride``
.. deprecated:: QGIS 3.26
use valueAsVariantWithDefaultOverride instead
%End
T value( const QStringList &dynamicKeyPartList, bool useDefaultValueOverride, const T &defaultValueOverride ) const /Deprecated/;
%Docstring
Returns the settings value for the ``dynamicKeyPartList`` and with a ``defaultValueOverride``
.. deprecated:: QGIS 3.26
use valueAsVariantWithDefaultOverride instead
%End
bool setValue( const T &value, const QString &dynamicKeyPart = QString() ) const;
%Docstring
Set settings value.
The ``value`` to set.
\arg dynamicKeyPart specifies the dynamic part of the settings key.
%End
bool setValue( const T &value, const QStringList &dynamicKeyPartList ) const;
%Docstring
Set settings value.
The ``value`` to set.
\arg dynamicKeyParts specifies the list of dynamic parts of the settings key.
%End
T defaultValue() const;
%Docstring
Returns settings default value.
%End
T formerValue( const QString &dynamicKeyPart = QString() ) const;
%Docstring
Returns the former value.
Returns the current value (or default) if there is no former value.
%End
T formerValue( const QStringList &dynamicKeyPartList ) const;
%Docstring
Returns the former value
Returns the current value (or default) if there is no former value.
%End
protected:
bool setValuePrivate( const T &value, const QStringList &dynamicKeyPartList ) const;
%Docstring
Sets the settings value with an optional list of dynamic parts
%End
virtual T convertFromVariant( const QVariant &value ) const = 0;
%Docstring
Converts the variant value to the value type of the setting
%End
virtual QVariant convertToVariant( const T &value ) const;
%Docstring
Converts the value to a variant
%End
virtual bool checkValue( const T &value ) const;
%Docstring
Check if the value is valid
%End
};
template<T>
class QgsSettingsEntryByValue : QgsSettingsEntryBase
{
%Docstring(signature="appended")
Base abstract class for settings entry which are passed by value
.. seealso:: :py:class:`QgsSettingsEntryBase`
.. seealso:: :py:class:`QgsSettingsEntryByReference`
.. versionadded:: 3.26
%End
%TypeHeaderCode
#include "qgssettingsentry.h"
%End
public:
QgsSettingsEntryByValue( const QString &key, QgsSettingsTreeNode *parent, QVariant defaultValue, const QString &description = QString(), Qgis::SettingsOptions options = Qgis::SettingsOptions() );
%Docstring
Constructor for QgsSettingsEntryByValue.
\arg key specifies the key of the settings.
\arg parent specifies the parent in the tree of settings.
\arg section specifies the section.
\arg defaultValue specifies the default value for the settings entry.
\arg description specifies a description for the settings entry.
\arg optionss specifies the options for the settings entry.
:raises QgsSettingsException: if the number of given parent named items doesn't match the complete key definition
%End
QgsSettingsEntryByValue( const QString &key, const QString &section, QVariant defaultValue, const QString &description = QString(), Qgis::SettingsOptions options = Qgis::SettingsOptions() );
%Docstring
Constructor for QgsSettingsEntryByValue.
\arg key specifies the key of the settings.
\arg section specifies the section.
\arg defaultValue specifies the default value for the settings entry.
\arg description specifies a description for the settings entry.
\arg optionss specifies the options for the settings entry.
%End
virtual Qgis::SettingsType settingsType() const = 0;
T value( const QString &dynamicKeyPart = QString() ) const;
%Docstring
Returns settings value.
\arg dynamicKeyPart specifies the dynamic part of the settings key.
\arg defaultValueOverride if valid is used instead of the normal default value.
%End
T value( const QStringList &dynamicKeyPartList ) const;
%Docstring
Returns settings value.
\arg dynamicKeyPartList specifies the list of dynamic parts of the settings key.
\arg defaultValueOverride if valid is used instead of the normal default value.
%End
T valueWithDefaultOverride( T defaultValueOverride, const QString &dynamicKeyPart = QString() ) const;
%Docstring
Returns the settings value with a ``defaultValueOverride`` and with an optional ``dynamicKeyPart``
%End
T valueWithDefaultOverride( T defaultValueOverride, const QStringList &dynamicKeyPartList ) const;
%Docstring
Returns the settings value with a ``defaultValueOverride`` for the ``dynamicKeyPartList``
%End
T value( const QString &dynamicKeyPart, bool useDefaultValueOverride, T defaultValueOverride ) const /Deprecated/;
%Docstring
Returns the settings value for the ``dynamicKeyPart`` and with a ``defaultValueOverride``
.. deprecated:: QGIS 3.26
use valueWithDefaultOverride instead
%End
T value( const QStringList &dynamicKeyPartList, bool useDefaultValueOverride, T defaultValueOverride ) const /Deprecated/;
%Docstring
Returns the settings value for the ``dynamicKeyPartList`` and with a ``defaultValueOverride``
.. deprecated:: QGIS 3.26
use valueWithDefaultOverride instead
%End
bool setValue( T value, const QString &dynamicKeyPart = QString() ) const;
%Docstring
Set settings value.
The ``value`` to set.
\arg dynamicKeyPart specifies the dynamic part of the settings key.
%End
bool setValue( T value, const QStringList &dynamicKeyPartList ) const;
%Docstring
Set settings value.
The ``value`` to set.
\arg dynamicKeyParts specifies the list of dynamic parts of the settings key.
%End
T defaultValue() const;
%Docstring
Returns settings default value.
%End
T formerValue( const QString &dynamicKeyPart = QString() ) const;
%Docstring
Returns the former value
Returns the current value (or default) if there is no former value.
%End
T formerValue( const QStringList &dynamicKeyPartList ) const;
%Docstring
Returns the former value
Returns the current value (or default) if there is no former value.
%End
protected:
virtual bool setValuePrivate( T value, const QStringList &dynamicKeyPartList ) const;
%Docstring
Sets the settings value with an optional list of dynamic parts
%End
virtual T convertFromVariant( const QVariant &value ) const = 0;
%Docstring
Converts the variant value to the value type of the setting
%End
virtual QVariant convertToVariant( T value ) const;
%Docstring
Converts the value to a variant
%End
virtual bool checkValue( T value ) const;
%Docstring
Check if the value is valid
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/settings/qgssettingsentry.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/