Skip to content
Permalink
Browse files

Add python bindings for composerhtml

  • Loading branch information
mhugent committed Aug 9, 2012
1 parent f7ef19e commit f5ff7c222b539b108be99d5e8ebfb9eb56f367ff
@@ -14,11 +14,14 @@
%Include qgsaddremoveitemcommand.sip
%Include qgsapplication.sip
%Include qgscomposerattributetable.sip
%Include qgscomposerframe.sip
%Include qgscomposerhtml.sip
%Include qgscomposeritem.sip
%Include qgscomposeritemcommand.sip
%Include qgscomposerlabel.sip
%Include qgscomposerlegend.sip
%Include qgscomposermap.sip
%Include qgscomposermultiframe.sip
%Include qgscomposerpicture.sip
%Include qgscomposerscalebar.sip
%Include qgscomposershape.sip
@@ -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();
};
@@ -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 );
};
@@ -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;
};

0 comments on commit f5ff7c2

Please sign in to comment.
You can’t perform that action at this time.