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
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/numericformats/qgsnumericformat.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsNumericFormatContext
{
%Docstring(signature="appended")
A context for numeric formats
.. versionadded:: 3.12
%End
%TypeHeaderCode
#include "qgsnumericformat.h"
%End
public:
static const QMetaObject staticMetaObject;
public:
QgsNumericFormatContext();
%Docstring
Constructor for QgsNumericFormatContext.
The context will be populated based on the user's current locale
settings.
%End
QChar thousandsSeparator() const;
%Docstring
Returns the thousands separator character.
.. seealso:: :py:func:`setThousandsSeparator`
%End
void setThousandsSeparator( const QChar &separator );
%Docstring
Sets the thousands ``separator`` character.
.. seealso:: :py:func:`thousandsSeparator`
%End
QChar decimalSeparator() const;
%Docstring
Returns the decimal separator character.
.. seealso:: :py:func:`setDecimalSeparator`
%End
void setDecimalSeparator( const QChar &separator );
%Docstring
Returns the decimal separator character.
.. seealso:: :py:func:`setDecimalSeparator`
%End
QChar percent() const;
%Docstring
Returns the percent character.
.. seealso:: :py:func:`setPercent`
%End
void setPercent( const QChar &character );
%Docstring
Sets the percent ``character``.
.. seealso:: :py:func:`percent`
%End
QChar zeroDigit() const;
%Docstring
Returns the zero digit character.
.. seealso:: :py:func:`setZeroDigit`
%End
void setZeroDigit( const QChar &character );
%Docstring
Returns the zero digit ``character``.
.. seealso:: :py:func:`zeroDigit`
%End
QChar negativeSign() const;
%Docstring
Returns the negative sign character.
.. seealso:: :py:func:`setNegativeSign`
%End
void setNegativeSign( const QChar &character );
%Docstring
Sets the negative sign ``character``.
.. seealso:: :py:func:`negativeSign`
%End
QChar positiveSign() const;
%Docstring
Returns the positive sign character.
.. seealso:: :py:func:`setPositiveSign`
%End
void setPositiveSign( const QChar &character );
%Docstring
Sets the positive sign ``character``.
.. seealso:: :py:func:`positiveSign`
%End
QChar exponential() const;
%Docstring
Returns the exponential character.
.. seealso:: :py:func:`setExponential`
%End
void setExponential( const QChar &character );
%Docstring
Sets the exponential ``character``.
.. seealso:: :py:func:`exponential`
%End
enum class Interpretation
{
Generic,
Latitude,
Longitude,
};
Interpretation interpretation() const;
%Docstring
Returns the interpretation of the numbers being converted.
.. seealso:: :py:func:`setInterpretation`
.. versionadded:: 3.26
%End
void setInterpretation( Interpretation interpretation );
%Docstring
Sets the ``interpretation`` of the numbers being converted.
.. seealso:: :py:func:`interpretation`
.. versionadded:: 3.26
%End
QgsExpressionContext expressionContext() const;
%Docstring
Returns the expression context to use when evaluating
:py:class:`QgsExpressions`.
.. seealso:: :py:func:`setExpressionContext`
.. versionadded:: 3.40
%End
void setExpressionContext( const QgsExpressionContext &context );
%Docstring
Sets the expression ``context`` to use when evaluating
:py:class:`QgsExpressions`.
.. seealso:: :py:func:`expressionContext`
.. versionadded:: 3.40
%End
};
%ModuleHeaderCode
#include <qgsbasicnumericformat.h>
#include <qgsbearingnumericformat.h>
#include <qgscurrencynumericformat.h>
#include <qgsfallbacknumericformat.h>
#include <qgspercentagenumericformat.h>
#include <qgsscientificnumericformat.h>
#include <qgscoordinatenumericformat.h>
#include <qgsexpressionbasednumericformat.h>
%End
class QgsNumericFormat
{
%Docstring(signature="appended")
A numeric formatter allows for formatting a numeric value for display,
using a variety of different formatting techniques (e.g. as scientific
notation, currency values, percentage values, etc)
This is an abstract base class and will always need to be subclassed.
.. versionadded:: 3.12
%End
%TypeHeaderCode
#include "qgsnumericformat.h"
%End
%ConvertToSubClassCode
if ( dynamic_cast< QgsBearingNumericFormat * >( sipCpp ) )
sipType = sipType_QgsBearingNumericFormat;
else if ( dynamic_cast< QgsGeographicCoordinateNumericFormat * >( sipCpp ) )
sipType = sipType_QgsGeographicCoordinateNumericFormat;
else if ( dynamic_cast< QgsFallbackNumericFormat * >( sipCpp ) )
sipType = sipType_QgsFallbackNumericFormat;
else if ( dynamic_cast< QgsPercentageNumericFormat * >( sipCpp ) )
sipType = sipType_QgsPercentageNumericFormat;
else if ( dynamic_cast< QgsScientificNumericFormat * >( sipCpp ) )
sipType = sipType_QgsScientificNumericFormat;
else if ( dynamic_cast< QgsCurrencyNumericFormat * >( sipCpp ) )
sipType = sipType_QgsCurrencyNumericFormat;
else if ( dynamic_cast< QgsBasicNumericFormat * >( sipCpp ) )
sipType = sipType_QgsBasicNumericFormat;
else if ( dynamic_cast< QgsFractionNumericFormat * >( sipCpp ) )
sipType = sipType_QgsFractionNumericFormat;
else if ( dynamic_cast< QgsExpressionBasedNumericFormat * >( sipCpp ) )
sipType = sipType_QgsExpressionBasedNumericFormat;
else
sipType = NULL;
%End
public:
QgsNumericFormat();
virtual ~QgsNumericFormat();
virtual QString id() const = 0;
%Docstring
Returns a unique id for this numeric format.
This id is used to identify this numeric format in the registry with
:py:func:`QgsNumericFormatRegistry.format()`.
%End
virtual QString visibleName() const = 0;
%Docstring
Returns the translated, user-visible name for this format.
%End
virtual int sortKey();
%Docstring
Returns a sorting key value, where formats with a lower sort key will be
shown earlier in lists.
Generally, subclasses should return
:py:func:`QgsNumericFormat.sortKey()` as their sorting key.
%End
virtual double suggestSampleValue() const;
%Docstring
Returns a suggested sample value which nicely represents the current
format configuration.
%End
virtual QString formatDouble( double value, const QgsNumericFormatContext &context ) const = 0;
%Docstring
Returns a formatted string representation of a numeric double value.
%End
virtual QgsNumericFormat *clone() const = 0 /Factory/;
%Docstring
Clones the format, returning a new object.
The caller takes ownership of the returned object.
%End
virtual QgsNumericFormat *create( const QVariantMap &configuration, const QgsReadWriteContext &context ) const = 0 /Factory/;
%Docstring
Creates a new copy of the format, using the supplied ``configuration``.
The caller takes ownership of the returned object.
%End
virtual QVariantMap configuration( const QgsReadWriteContext &context ) const = 0;
%Docstring
Returns the current configuration of the formatter. This value can be
used in a call to :py:func:`~QgsNumericFormat.create` in order to
recreate this formatter in its current state.
%End
void writeXml( QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context ) const;
%Docstring
Writes the format to an XML ``element``.
.. seealso:: :py:func:`QgsNumericFormatRegistry.createFromXml`
%End
bool operator==( const QgsNumericFormat &other ) const;
bool operator!=( const QgsNumericFormat &other ) const;
protected:
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/numericformats/qgsnumericformat.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|