QGIS/python/core/auto_generated/layout/qgslayoutitemhtml.sip.in

272 lines
7.7 KiB
Plaintext
Raw Normal View History

2017-10-27 17:04:17 +10:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/layout/qgslayoutitemhtml.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
2017-11-20 13:38:28 +10:00
class QgsLayoutItemHtml: QgsLayoutMultiFrame
{
%Docstring
2017-12-15 10:36:55 -04:00
A layout multiframe subclass for HTML content.
2017-11-20 13:38:28 +10:00
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgslayoutitemhtml.h"
%End
public:
enum ContentMode
{
Url,
ManualHtml
};
2017-11-22 17:46:13 +10:00
QgsLayoutItemHtml( QgsLayout *layout /TransferThis/ );
2017-11-20 13:38:28 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsLayoutItemHtml, with the specified parent ``layout``.
2017-11-22 17:46:13 +10:00
2017-12-15 10:36:55 -04:00
Ownership is transferred to the layout.
2017-11-20 13:38:28 +10:00
%End
~QgsLayoutItemHtml();
virtual int type() const;
virtual QIcon icon() const;
2017-11-20 13:38:28 +10:00
static QgsLayoutItemHtml *create( QgsLayout *layout ) /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Returns a new QgsLayoutItemHtml for the specified parent ``layout``.
2017-11-20 13:38:28 +10:00
%End
void setContentMode( ContentMode mode );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the source ``mode`` for item's HTML content.
.. seealso:: :py:func:`contentMode`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setUrl`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setHtml`
2017-11-20 13:38:28 +10:00
%End
ContentMode contentMode() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the source mode for item's HTML content.
.. seealso:: :py:func:`setContentMode`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`url`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`html`
2017-11-20 13:38:28 +10:00
%End
void setUrl( const QUrl &url );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the ``url`` for content to display in the item when the item is using
the QgsLayoutItemHtml.Url mode. Content is automatically fetched and the
HTML item refreshed after calling this function.
.. seealso:: :py:func:`url`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`contentMode`
2017-11-20 13:38:28 +10:00
%End
QUrl url() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the URL of the content displayed in the item if the item is using
the QgsLayoutItemHtml.Url mode.
.. seealso:: :py:func:`setUrl`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`contentMode`
2017-11-20 13:38:28 +10:00
%End
void setHtml( const QString &html );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the ``html`` to display in the item when the item is using
the QgsLayoutItemHtml.ManualHtml mode. Setting the HTML using this function
does not automatically refresh the item's contents. Call loadHtml to trigger
a refresh of the item after setting the HTML content.
.. seealso:: :py:func:`html`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`contentMode`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`loadHtml`
2017-11-20 13:38:28 +10:00
%End
QString html() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the HTML source displayed in the item if the item is using
the QgsLayoutItemHtml.ManualHtml mode.
.. seealso:: :py:func:`setHtml`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`contentMode`
2017-11-20 13:38:28 +10:00
%End
bool evaluateExpressions() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns whether html item will evaluate QGIS expressions prior to rendering
the HTML content. If set, any content inside [% %] tags will be
treated as a QGIS expression and evaluated against the current atlas
feature.
.. seealso:: :py:func:`setEvaluateExpressions`
2017-11-20 13:38:28 +10:00
%End
void setEvaluateExpressions( bool evaluateExpressions );
%Docstring
2017-12-15 10:36:55 -04:00
Sets whether the html item will evaluate QGIS expressions prior to rendering
the HTML content. If set, any content inside [% %] tags will be
treated as a QGIS expression and evaluated against the current atlas
feature.
.. seealso:: :py:func:`evaluateExpressions`
2017-11-20 13:38:28 +10:00
%End
bool useSmartBreaks() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns whether html item is using smart breaks. Smart breaks prevent
the html frame contents from breaking mid-way though a line of text.
.. seealso:: :py:func:`setUseSmartBreaks`
2017-11-20 13:38:28 +10:00
%End
void setUseSmartBreaks( bool useSmartBreaks );
%Docstring
2017-12-15 10:36:55 -04:00
Sets whether the html item should use smart breaks. Smart breaks prevent
the html frame contents from breaking mid-way though a line of text.
.. seealso:: :py:func:`useSmartBreaks`
2017-11-20 13:38:28 +10:00
%End
void setMaxBreakDistance( double distance );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the maximum ``distance`` allowed when calculating where to place page breaks
in the html. This distance is the maximum amount of empty space allowed
at the bottom of a frame after calculating the optimum break location. Setting
a larger value will result in better choice of page break location, but more
wasted space at the bottom of frames. This setting is only effective if
2019-02-26 19:54:09 +10:00
useSmartBreaks is ``True``.
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`maxBreakDistance`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setUseSmartBreaks`
2017-11-20 13:38:28 +10:00
%End
double maxBreakDistance() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the maximum distance allowed when calculating where to place page breaks
in the html. This distance is the maximum amount of empty space allowed
at the bottom of a frame after calculating the optimum break location. This setting
2019-02-26 19:54:09 +10:00
is only effective if useSmartBreaks is ``True``.
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setMaxBreakDistance`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`useSmartBreaks`
2017-11-20 13:38:28 +10:00
%End
void setUserStylesheet( const QString &stylesheet );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the user ``stylesheet`` CSS rules to use while rendering the HTML content. These
allow for overriding the styles specified within the HTML source. Setting the stylesheet
using this function does not automatically refresh the item's contents. Call loadHtml
to trigger a refresh of the item after setting the stylesheet rules.
.. seealso:: :py:func:`userStylesheet`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setUserStylesheetEnabled`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`loadHtml`
2017-11-20 13:38:28 +10:00
%End
QString userStylesheet() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the user stylesheet CSS rules used while rendering the HTML content. These
overriding the styles specified within the HTML source.
.. seealso:: :py:func:`setUserStylesheet`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`userStylesheetEnabled`
2017-11-20 13:38:28 +10:00
%End
void setUserStylesheetEnabled( bool enabled );
2017-11-20 13:38:28 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets whether user stylesheets are ``enabled`` for the HTML content.
.. seealso:: :py:func:`userStylesheetEnabled`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setUserStylesheet`
2017-11-20 13:38:28 +10:00
%End
bool userStylesheetEnabled() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns whether user stylesheets are enabled for the HTML content.
.. seealso:: :py:func:`setUserStylesheetEnabled`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`userStylesheet`
2017-11-20 13:38:28 +10:00
%End
virtual QString displayName() const;
virtual QSizeF totalSize() const;
virtual void render( QgsLayoutItemRenderContext &context, const QRectF &renderExtent, int frameIndex );
2017-11-20 13:38:28 +10:00
virtual double findNearbyPageBreak( double yPos );
public slots:
void loadHtml( bool useCache = false, const QgsExpressionContext *context = 0 );
2017-11-20 13:38:28 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Reloads the html source from the url and redraws the item.
2017-12-15 21:36:08 -04:00
2019-02-26 19:54:09 +10:00
:param useCache: set to ``True`` to use a cached copy of remote html
content
2017-12-15 10:36:55 -04:00
:param context: expression context for evaluating data defined urls and expressions in html
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setUrl`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`url`
2017-11-20 13:38:28 +10:00
%End
virtual void recalculateFrameSizes();
%Docstring
Recalculates the frame sizes for the current viewport dimensions
%End
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::AllProperties );
2017-11-24 14:57:39 +10:00
2017-11-20 13:38:28 +10:00
protected:
virtual bool writePropertiesToElement( QDomElement &elem, QDomDocument &doc, const QgsReadWriteContext &context ) const;
virtual bool readPropertiesFromElement( const QDomElement &itemElem, const QDomDocument &doc, const QgsReadWriteContext &context );
};
2017-10-27 17:04:17 +10:00
2017-10-27 17:04:17 +10:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/layout/qgslayoutitemhtml.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/