/************************************************************************ * This file has been generated automatically from * * * * src/core/scalebar/qgsscalebarrenderer.h * * * * Do not edit manually ! Edit header and run scripts/sipify.py again * ************************************************************************/ class QgsScaleBarRenderer { %Docstring(signature="appended") Abstract base class for scale bar renderers. Scalebar renderer subclasses implement custom drawing logic, with the possibility to implement custom labeling. %End %TypeHeaderCode #include "qgsscalebarrenderer.h" %End public: enum class Flag { FlagUsesLineSymbol, FlagUsesFillSymbol, FlagUsesAlternateFillSymbol, FlagRespectsUnits, FlagRespectsMapUnitsPerScaleBarUnit, FlagUsesUnitLabel, FlagUsesSegments, FlagUsesLabelBarSpace, FlagUsesLabelVerticalPlacement, FlagUsesLabelHorizontalPlacement, FlagUsesAlignment, FlagUsesSubdivisions, FlagUsesDivisionSymbol, FlagUsesSubdivisionSymbol, FlagUsesSubdivisionsHeight, }; typedef QFlags Flags; struct ScaleBarContext { double segmentWidth; QSizeF size; double scale; QgsScaleBarRenderer::Flags flags; bool isValid() const; %Docstring Returns ``True`` if the context has valid settings. .. versionadded:: 3.40 %End }; QgsScaleBarRenderer(); virtual ~QgsScaleBarRenderer(); QString name() const /Deprecated="Since 3.40. Use id() instead."/; %Docstring Returns the unique name for this style. .. deprecated:: 3.40 Use :py:func:`~QgsScaleBarRenderer.id` instead. %End virtual QString id() const = 0; %Docstring Returns the unique ID for this renderer. .. versionadded:: 3.14 %End virtual QString visibleName() const = 0; %Docstring Returns the user friendly, translated name for the renderer. .. versionadded:: 3.14 %End virtual Flags flags() const; %Docstring Returns the scalebar rendering flags, which dictates the renderer's behavior. .. versionadded:: 3.14 %End virtual int sortKey() const; %Docstring Returns a sorting key value, where renderers with a lower sort key will be shown earlier in lists. Generally, subclasses should return :py:func:`QgsScaleBarRenderer.sortKey()` as their sorting key. %End virtual QgsScaleBarRenderer *clone() const = 0 /Factory/; %Docstring Returns a clone of the renderer. The caller takes ownership of the returned value. %End virtual void draw( QgsRenderContext &context, const QgsScaleBarSettings &settings, const QgsScaleBarRenderer::ScaleBarContext &scaleContext ) const = 0; %Docstring Draws the scalebar using the specified ``settings`` and ``scaleContext`` to a destination render ``context``. %End virtual QSizeF calculateBoxSize( const QgsScaleBarSettings &settings, const QgsScaleBarRenderer::ScaleBarContext &scaleContext ) const /Deprecated="Since 3.40. Use the version with a QgsRenderContext instead."/; %Docstring Calculates the required box size (in millimeters) for a scalebar using the specified ``settings`` and ``scaleContext``. .. deprecated:: 3.40 Use the version with a :py:class:`QgsRenderContext` instead. %End virtual QSizeF calculateBoxSize( QgsRenderContext &context, const QgsScaleBarSettings &settings, const QgsScaleBarRenderer::ScaleBarContext &scaleContext ) const; %Docstring Calculates the required box size (in millimeters) for a scalebar using the specified ``settings`` and ``scaleContext``. .. versionadded:: 3.14 %End virtual bool applyDefaultSettings( QgsScaleBarSettings &settings ) const; %Docstring Applies any default settings relating to the scalebar to the passed ``settings`` object. Returns ``True`` if settings were applied. .. versionadded:: 3.14 %End protected: void drawDefaultLabels( QgsRenderContext &context, const QgsScaleBarSettings &settings, const QgsScaleBarRenderer::ScaleBarContext &scaleContext ) const; %Docstring Draws default scalebar labels using the specified ``settings`` and ``scaleContext`` to a destination render ``context``. %End QString firstLabelString( const QgsScaleBarSettings &settings ) const; %Docstring Returns the text used for the first label in the scalebar. %End double firstLabelXOffset( const QgsScaleBarSettings &settings ) const /Deprecated="Since 3.40. Use the version with QgsRenderContext instead."/; %Docstring Returns the x-offset (in millimeters) used for the first label in the scalebar. .. deprecated:: 3.40 Use the version with :py:class:`QgsRenderContext` instead. %End double firstLabelXOffset( const QgsScaleBarSettings &settings, const QgsRenderContext &context, const ScaleBarContext &scaleContext ) const; %Docstring Returns the x-offset (in render context painter units) used for the first label in the scalebar. .. versionadded:: 3.2 %End QList segmentPositions( const QgsScaleBarRenderer::ScaleBarContext &scaleContext, const QgsScaleBarSettings &settings ) const /Deprecated="Since 3.40. Use the version with a QgsRenderContext instead."/; %Docstring Returns a list of positions for each segment within the scalebar. .. deprecated:: 3.40 Use the version with a :py:class:`QgsRenderContext` instead. %End QList segmentPositions( QgsRenderContext &context, const QgsScaleBarRenderer::ScaleBarContext &scaleContext, const QgsScaleBarSettings &settings ) const; %Docstring Returns a list of positions for each segment within the scalebar. .. versionadded:: 3.14 %End QList segmentWidths( const QgsScaleBarRenderer::ScaleBarContext &scaleContext, const QgsScaleBarSettings &settings ) const; %Docstring Returns a list of widths of each segment of the scalebar. %End }; QFlags operator|(QgsScaleBarRenderer::Flag f1, QFlags f2); /************************************************************************ * This file has been generated automatically from * * * * src/core/scalebar/qgsscalebarrenderer.h * * * * Do not edit manually ! Edit header and run scripts/sipify.py again * ************************************************************************/