-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add python bindings for composerhtml
- Loading branch information
Showing
4 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
class QgsComposerFrame: QgsComposerItem | ||
{ | ||
%TypeHeaderCode | ||
#include "qgscomposerframe.h" | ||
%End | ||
|
||
public: | ||
QgsComposerFrame( QgsComposition* c, QgsComposerMultiFrame* mf, qreal x, qreal y, qreal width, qreal height ); | ||
~QgsComposerFrame(); | ||
|
||
/**Sets the part of this frame (relative to the total multiframe extent in mm)*/ | ||
void setContentSection( const QRectF& section ); | ||
|
||
void paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget ); | ||
|
||
void beginItemCommand( const QString& text ); | ||
void endItemCommand(); | ||
|
||
bool writeXML( QDomElement& elem, QDomDocument & doc ) const; | ||
bool readXML( const QDomElement& itemElem, const QDomDocument& doc ); | ||
|
||
int type() const; | ||
|
||
QgsComposerMultiFrame* multiFrame(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
class QgsComposerHtml: QgsComposerMultiFrame | ||
{ | ||
%TypeHeaderCode | ||
#include "qgscomposerhtml.h" | ||
%End | ||
|
||
public: | ||
QgsComposerHtml( QgsComposition* c, bool createUndoCommands ); | ||
QgsComposerHtml(); | ||
~QgsComposerHtml(); | ||
|
||
void setUrl( const QUrl& url ); | ||
const QUrl& url() const; | ||
|
||
QSizeF totalSize() const; | ||
void render( QPainter* p, const QRectF& renderExtent ); | ||
|
||
bool writeXML( QDomElement& elem, QDomDocument & doc, bool ignoreFrames = false ) const; | ||
bool readXML( const QDomElement& itemElem, const QDomDocument& doc, bool ignoreFrames = false ); | ||
|
||
void addFrame( QgsComposerFrame* frame, bool recalcFrameSizes = true ); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
|
||
class QgsComposerMultiFrame: QObject | ||
{ | ||
%TypeHeaderCode | ||
#include "qgscomposermultiframe.h" | ||
%End | ||
public: | ||
|
||
enum ResizeMode | ||
{ | ||
UseExistingFrames = 0, | ||
ExtendToNextPage //duplicates last frame to next page to fit the total size | ||
}; | ||
|
||
QgsComposerMultiFrame( QgsComposition* c, bool createUndoCommands ); | ||
virtual ~QgsComposerMultiFrame(); | ||
virtual QSizeF totalSize() const = 0; | ||
virtual void render( QPainter* p, const QRectF& renderExtent ) = 0; | ||
|
||
virtual void addFrame( QgsComposerFrame* frame, bool recalcFrameSizes = true ) = 0; | ||
|
||
void removeFrame( int i ); | ||
|
||
void update(); | ||
|
||
void setResizeMode( ResizeMode mode ); | ||
ResizeMode resizeMode() const; | ||
|
||
virtual bool writeXML( QDomElement& elem, QDomDocument & doc, bool ignoreFrames = false ) const = 0; | ||
bool _writeXML( QDomElement& elem, QDomDocument& doc, bool ignoreFrames = false ) const; | ||
|
||
virtual bool readXML( const QDomElement& itemElem, const QDomDocument& doc, bool ignoreFrames = false ) = 0; | ||
bool _readXML( const QDomElement& itemElem, const QDomDocument& doc, bool ignoreFrames = false ); | ||
|
||
QgsComposition* composition(); | ||
|
||
bool createUndoCommands() const; | ||
void setCreateUndoCommands( bool enabled ); | ||
|
||
/**Removes and deletes all frames from mComposition*/ | ||
void deleteFrames(); | ||
|
||
int nFrames() const; | ||
}; |