QGIS/python/core/auto_generated/symbology/qgssvgcache.sip.in

159 lines
6.7 KiB
Plaintext
Raw Normal View History

2017-06-06 11:03:05 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
2017-08-06 13:39:03 +02:00
* src/core/symbology/qgssvgcache.h *
2017-06-06 11:03:05 +02:00
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsSvgCache : QObject
{
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
A cache for images / pictures derived from svg files. This class supports parameter replacement in svg files
2017-06-06 11:03:05 +02:00
according to the svg params specification (http://www.w3.org/TR/2009/WD-SVGParamPrimer-20090616/). Supported are
the parameters 'fill-color', 'pen-color', 'outline-width', 'stroke-width'. E.g. <circle fill="param(fill-color red)" stroke="param(pen-color black)" stroke-width="param(outline-width 1)"
2017-12-15 10:36:55 -04:00
QgsSvgCache is not usually directly created, but rather accessed through
2017-12-19 11:43:52 -04:00
:py:func:`QgsApplication.svgCache()`
%End
2017-06-06 11:03:05 +02:00
%TypeHeaderCode
#include "qgssvgcache.h"
%End
public:
QgsSvgCache( QObject *parent /TransferThis/ = 0 );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsSvgCache.
2017-06-06 11:03:05 +02:00
%End
~QgsSvgCache();
2017-06-06 11:03:05 +02:00
QImage svgAsImage( const QString &path, double size, const QColor &fill, const QColor &stroke, double strokeWidth,
double widthScaleFactor, bool &fitsInCache, double fixedAspectRatio = 0 );
2017-06-06 11:03:05 +02:00
%Docstring
Gets SVG as QImage.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param path: Absolute path to SVG file.
:param size: size of cached image
:param fill: color of fill
:param stroke: color of stroke
:param strokeWidth: width of stroke
:param widthScaleFactor: width scale factor
:param fitsInCache:
:param fixedAspectRatio: fixed aspect ratio (optional)
2017-06-06 11:03:05 +02:00
%End
2017-06-06 11:03:05 +02:00
QPicture svgAsPicture( const QString &path, double size, const QColor &fill, const QColor &stroke, double strokeWidth,
double widthScaleFactor, bool forceVectorOutput = false, double fixedAspectRatio = 0 );
2017-06-06 11:03:05 +02:00
%Docstring
Gets SVG as QPicture&.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param path: Absolute path to SVG file.
:param size: size of cached image
:param fill: color of fill
:param stroke: color of stroke
:param strokeWidth: width of stroke
:param widthScaleFactor: width scale factor
:param forceVectorOutput:
:param fixedAspectRatio: fixed aspect ratio (optional)
2017-06-06 11:03:05 +02:00
%End
2017-06-06 11:03:05 +02:00
QSizeF svgViewboxSize( const QString &path, double size, const QColor &fill, const QColor &stroke, double strokeWidth,
double widthScaleFactor, double fixedAspectRatio = 0 );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Calculates the viewbox size of a (possibly cached) SVG file.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param path: Absolute path to SVG file.
:param size: size of cached image
:param fill: color of fill
:param stroke: color of stroke
:param strokeWidth: width of stroke
:param widthScaleFactor: width scale factor
:param fixedAspectRatio: fixed aspect ratio (optional)
:return: viewbox size set in SVG file
2017-06-06 11:03:05 +02:00
.. versionadded:: 2.14
%End
2017-06-06 11:03:05 +02:00
void containsParams( const QString &path, bool &hasFillParam, QColor &defaultFillColor, bool &hasStrokeParam, QColor &defaultStrokeColor, bool &hasStrokeWidthParam,
double &defaultStrokeWidth ) const;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Tests if an svg file contains parameters for fill, stroke color, stroke width. If yes, possible default values are returned. If there are several
2017-06-06 11:03:05 +02:00
default values in the svg file, only the first one is considered*
%End
2017-06-06 11:03:05 +02:00
void containsParams( const QString &path, bool &hasFillParam, bool &hasDefaultFillParam, QColor &defaultFillColor,
bool &hasFillOpacityParam, bool &hasDefaultFillOpacity, double &defaultFillOpacity,
bool &hasStrokeParam, bool &hasDefaultStrokeColor, QColor &defaultStrokeColor,
bool &hasStrokeWidthParam, bool &hasDefaultStrokeWidth, double &defaultStrokeWidth,
bool &hasStrokeOpacityParam, bool &hasDefaultStrokeOpacity, double &defaultStrokeOpacity ) const /PyName=containsParamsV3/;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Tests if an svg file contains parameters for fill, stroke color, stroke width. If yes, possible default values are returned. If there are several
default values in the svg file, only the first one is considered.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param path: path to SVG file
:param hasFillParam: will be true if fill param present in SVG
:param hasDefaultFillParam: will be true if fill param has a default value specified
:param defaultFillColor: will be set to default fill color specified in SVG, if present
:param hasFillOpacityParam: will be true if fill opacity param present in SVG
:param hasDefaultFillOpacity: will be true if fill opacity param has a default value specified
:param defaultFillOpacity: will be set to default fill opacity specified in SVG, if present
:param hasStrokeParam: will be true if stroke param present in SVG
:param hasDefaultStrokeColor: will be true if stroke param has a default value specified
:param defaultStrokeColor: will be set to default stroke color specified in SVG, if present
:param hasStrokeWidthParam: will be true if stroke width param present in SVG
:param hasDefaultStrokeWidth: will be true if stroke width param has a default value specified
:param defaultStrokeWidth: will be set to default stroke width specified in SVG, if present
:param hasStrokeOpacityParam: will be true if stroke opacity param present in SVG
:param hasDefaultStrokeOpacity: will be true if stroke opacity param has a default value specified
:param defaultStrokeOpacity: will be set to default stroke opacity specified in SVG, if present
2017-06-06 11:03:05 +02:00
.. note::
available in Python bindings as containsParamsV3
2017-12-15 10:36:55 -04:00
2017-06-06 11:03:05 +02:00
.. versionadded:: 2.14
%End
2014-01-26 18:35:21 +01:00
QByteArray getImageData( const QString &path ) const;
2017-06-06 11:03:05 +02:00
%Docstring
Gets image data
2017-06-06 11:03:05 +02:00
%End
2014-01-26 18:35:21 +01:00
2017-06-06 11:03:05 +02:00
QByteArray svgContent( const QString &path, double size, const QColor &fill, const QColor &stroke, double strokeWidth,
double widthScaleFactor, double fixedAspectRatio = 0 );
2017-06-06 11:03:05 +02:00
%Docstring
Gets SVG content
2017-06-06 11:03:05 +02:00
%End
2014-01-26 18:35:21 +01:00
signals:
2017-06-06 11:03:05 +02:00
void statusChanged( const QString &statusQString );
%Docstring
Emit a signal to be caught by qgisapp and display a msg on status bar
%End
void remoteSvgFetched( const QString &url );
%Docstring
Emitted when the cache has finished retrieving an SVG file from a remote ``url``.
.. versionadded:: 3.2
2017-06-06 11:03:05 +02:00
%End
2014-01-26 18:35:21 +01:00
};
2017-06-06 11:03:05 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
2017-08-06 13:39:03 +02:00
* src/core/symbology/qgssvgcache.h *
2017-06-06 11:03:05 +02:00
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/