16 #ifndef QGSCOMPOSERHTML_H 17 #define QGSCOMPOSERHTML_H 74 void setUrl(
const QUrl& url );
82 const QUrl&
url()
const {
return mUrl; }
94 void setHtml(
const QString html );
103 QString
html()
const {
return mHtml; }
123 void setEvaluateExpressions(
bool evaluateExpressions );
138 void setUseSmartBreaks(
bool useSmartBreaks );
152 void setMaxBreakDistance(
double maxBreakDistance );
175 void setUserStylesheet(
const QString stylesheet );
192 void setUserStylesheetEnabled(
const bool stylesheetEnabled );
204 void render( QPainter* p,
const QRectF& renderExtent,
const int frameIndex )
override;
205 bool writeXML( QDomElement& elem, QDomDocument & doc,
bool ignoreFrames =
false )
const override;
206 bool readXML(
const QDomElement& itemElem,
const QDomDocument& doc,
bool ignoreFrames =
false )
override;
219 void loadHtml(
const bool useCache =
false );
223 void refreshExpressionContext();
228 void frameLoaded(
bool ok =
true );
235 QString mFetchedHtml;
236 QString mLastFetchedUrl;
237 QString mActualFetchedUrl;
240 double mHtmlUnitsToMM;
241 QImage* mRenderedPage;
242 bool mEvaluateExpressions;
243 bool mUseSmartBreaks;
244 double mMaxBreakDistance;
250 QString mUserStylesheet;
251 bool mEnableUserStylesheet;
255 double htmlUnitsToMM();
258 void renderCachedImage();
261 QString fetchHtml( QUrl url );
267 double maxFrameWidth()
const;
270 #endif // QGSCOMPOSERHTML_H virtual void recalculateFrameSizes()
Recalculates the portion of the multiframe item which is shown in each of it's component frames...
ContentMode contentMode() const
Returns the source mode for item's HTML content.
virtual QString displayName() const
Get multiframe display name.
virtual double findNearbyPageBreak(double yPos)
Finds the optimal position to break a frame at.
virtual QSizeF totalSize() const =0
Returns the total size of the multiframe's content.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
DataDefinedProperty
Data defined properties for different item types.
QString userStylesheet() const
Returns the user stylesheet CSS rules used while rendering the HTML content.
bool useSmartBreaks() const
Returns whether html item is using smart breaks.
QString html() const
Returns the HTML source displayed in the item if the item is using the QgsComposerHtml::ManualHtml mo...
virtual void addFrame(QgsComposerFrame *frame, bool recalcFrameSizes=true)=0
Adds a frame to the multiframe.
HTTP network content fetcher.
Abstract base class for composer items with the ability to distribute the content to several frames (...
bool evaluateExpressions() const
Returns whether html item will evaluate QGIS expressions prior to rendering the HTML content...
Graphics scene for map printing.
Frame item for a composer multiframe item.
const QUrl & url() const
Returns the URL of the content displayed in the item if the item is using the QgsComposerHtml::Url mo...
void setContentMode(ContentMode mode)
Sets the source mode for item's HTML content.
General purpose distance and area calculator.
bool userStylesheetEnabled() const
Returns whether user stylesheets are enabled for the HTML content.
virtual bool writeXML(QDomElement &elem, QDomDocument &doc, bool ignoreFrames=false) const =0
Stores state information about multiframe in DOM element.
double maxBreakDistance() const
Returns the maximum distance allowed when calculating where to place page breaks in the html...
virtual Q_DECL_DEPRECATED void render(QPainter *p, const QRectF &renderExtent)
Renders a portion of the multiframe's content into a painter.
virtual bool readXML(const QDomElement &itemElem, const QDomDocument &doc, bool ignoreFrames=false)=0
Reads multiframe state information from a DOM element.
Represents a vector layer which manages a vector based data sets.
ContentMode
Source modes for the HTML content to render in the item.
virtual void refreshDataDefinedProperty(const DataDefinedProperty property=AllProperties)
Refreshes a data defined property for the item by reevaluating the property's value and redrawing the...