Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
More sipify blacklist removal
  • Loading branch information
nyalldawson committed Apr 2, 2017
1 parent f1162f7 commit 0c08fb3
Show file tree
Hide file tree
Showing 13 changed files with 254 additions and 51 deletions.
4 changes: 0 additions & 4 deletions python/auto_sip.blacklist
Expand Up @@ -159,10 +159,6 @@ core/qgsvirtuallayerdefinitionutils.sip
core/qgsmapthemecollection.sip
core/qgsxmlutils.sip
core/annotations/qgsannotation.sip
core/annotations/qgsannotationmanager.sip
core/annotations/qgshtmlannotation.sip
core/annotations/qgssvgannotation.sip
core/annotations/qgstextannotation.sip
core/auth/qgsauthcertutils.sip
core/auth/qgsauthconfig.sip
core/auth/qgsauthmanager.sip
Expand Down
104 changes: 95 additions & 9 deletions python/core/annotations/qgsannotationmanager.sip
@@ -1,24 +1,110 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/annotations/qgsannotationmanager.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/





class QgsAnnotationManager : QObject
{
%Docstring
.. versionadded:: 3.0

\brief Manages storage of a set of QgsAnnotation annotation objects.

QgsAnnotationManager handles the storage, serializing and deserializing
of QgsAnnotations. Usually this class is not constructed directly, but
rather accessed through a QgsProject via QgsProject::annotationManager().

QgsAnnotationManager retains ownership of all the annotations contained
in the manager.
%End

%TypeHeaderCode
#include <qgsannotationmanager.h>
#include "qgsannotationmanager.h"
%End

public:

explicit QgsAnnotationManager( QgsProject* project = nullptr );
explicit QgsAnnotationManager( QgsProject *project /TransferThis/ = 0 );
%Docstring
Constructor for QgsAnnotationManager. The project will become the parent object for this
manager.
%End

~QgsAnnotationManager();

bool addAnnotation( QgsAnnotation* annotation /Transfer/ );
bool removeAnnotation( QgsAnnotation* annotation );
bool addAnnotation( QgsAnnotation *annotation /Transfer/ );
%Docstring
Adds an annotation to the manager. Ownership of the annotation is transferred to the manager.
Returns true if the addition was successful, or false if the annotation could not be added.
@see removeAnnotation()
@see annotationAdded()
%End

bool removeAnnotation( QgsAnnotation *annotation );
%Docstring
Removes an annotation from the manager. The annotation is deleted.
Returns true if the removal was successful, or false if the removal failed (eg as a result
of removing an annotation which is not contained in the manager).
@see addAnnotation()
@see compositionRemoved()
@see compositionAboutToBeRemoved()
@see clear()
%End

void clear();
QList< QgsAnnotation* > annotations() const;
bool readXml( const QDomElement& element, const QDomDocument& doc );
QDomElement writeXml( QDomDocument& doc ) const;
%Docstring
Removes and deletes all annotations from the manager.
@see removeAnnotation()
%End

QList< QgsAnnotation * > annotations() const;
%Docstring
Returns a list of all annotations contained in the manager.
%End

bool readXml( const QDomElement &element, const QDomDocument &doc );
%Docstring
Reads the manager's state from a DOM element, restoring all annotations
present in the XML document.
@see writeXml()
%End

QDomElement writeXml( QDomDocument &doc ) const;
%Docstring
Returns a DOM element representing the state of the manager.
@see readXml()
%End

signals:

void annotationAdded( QgsAnnotation* annotation );
void annotationAdded( QgsAnnotation *annotation );
%Docstring
Emitted when a annotation has been added to the manager
%End

void annotationRemoved();
void annotationAboutToBeRemoved( QgsAnnotation* annotation );
%Docstring
Emitted when an annotation was removed from the manager
%End

void annotationAboutToBeRemoved( QgsAnnotation *annotation );
%Docstring
Emitted when an annotation is about to be removed from the manager
%End

};

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/annotations/qgsannotationmanager.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
56 changes: 47 additions & 9 deletions python/core/annotations/qgshtmlannotation.sip
@@ -1,28 +1,66 @@
class QgsHtmlAnnotation : QgsAnnotation
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/annotations/qgshtmlannotation.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/







class QgsHtmlAnnotation: QgsAnnotation
{

%TypeHeaderCode
#include <qgshtmlannotation.h>
#include "qgshtmlannotation.h"
%End
public:

QgsHtmlAnnotation( QObject* parent /TransferThis/ = nullptr );
QgsHtmlAnnotation( QObject *parent /TransferThis/ = 0 );
%Docstring
Constructor for QgsHtmlAnnotation.
%End

~QgsHtmlAnnotation();

QSizeF minimumFrameSize() const;

void setSourceFile( const QString& htmlFile );
void setSourceFile( const QString &htmlFile );
%Docstring
Sets the file path for the source HTML file.
@see sourceFile()
%End

QString sourceFile() const;
%Docstring
Returns the file path for the source HTML file.
@see setSourceFile()
%End

virtual void writeXml( QDomElement& elem, QDomDocument & doc ) const;
virtual void readXml( const QDomElement& itemElem, const QDomDocument& doc );
virtual void writeXml( QDomElement &elem, QDomDocument &doc ) const;
virtual void readXml( const QDomElement &itemElem, const QDomDocument &doc );

virtual void setAssociatedFeature( const QgsFeature& feature );
void setAssociatedFeature( const QgsFeature &feature );

static QgsHtmlAnnotation* create() /Factory/;
static QgsHtmlAnnotation *create() /Factory/;
%Docstring
Returns a new QgsHtmlAnnotation object.
%End

protected:

void renderAnnotation( QgsRenderContext& context, QSizeF size ) const;
void renderAnnotation( QgsRenderContext &context, QSizeF size ) const;

};

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/annotations/qgshtmlannotation.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
56 changes: 48 additions & 8 deletions python/core/annotations/qgssvgannotation.sip
@@ -1,22 +1,62 @@
class QgsSvgAnnotation : QgsAnnotation
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/annotations/qgssvgannotation.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/




class QgsSvgAnnotation: QgsAnnotation
{
%Docstring
An annotation which renders the contents of an SVG file.
.. versionadded:: 3.0
%End

%TypeHeaderCode
#include <qgssvgannotation.h>
#include "qgssvgannotation.h"
%End

public:

QgsSvgAnnotation( QObject* parent /TransferThis/ = nullptr );
QgsSvgAnnotation( QObject *parent /TransferThis/ = 0 );
%Docstring
Constructor for QgsSvgAnnotation.
%End

virtual void writeXml( QDomElement &elem, QDomDocument &doc ) const;
virtual void readXml( const QDomElement &itemElem, const QDomDocument &doc );

virtual void writeXml( QDomElement& elem, QDomDocument & doc ) const;
virtual void readXml( const QDomElement& itemElem, const QDomDocument& doc );
void setFilePath( const QString &file );
%Docstring
Sets the file path for the source SVG file.
@see filePath()
%End

void setFilePath( const QString& file );
QString filePath() const;
%Docstring
Returns the file path for the source SVG file.
@see setFilePath()
%End

static QgsSvgAnnotation* create() /Factory/;
static QgsSvgAnnotation *create() /Factory/;
%Docstring
Returns a new QgsSvgAnnotation object.
%End

protected:

void renderAnnotation( QgsRenderContext& context, QSizeF size ) const;
void renderAnnotation( QgsRenderContext &context, QSizeF size ) const;

};

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/annotations/qgssvgannotation.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
60 changes: 51 additions & 9 deletions python/core/annotations/qgstextannotation.sip
@@ -1,22 +1,64 @@
class QgsTextAnnotation : QgsAnnotation
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/annotations/qgstextannotation.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/




class QgsTextAnnotation: QgsAnnotation
{
%Docstring
An annotation item that displays formatted text from a QTextDocument document.
.. versionadded:: 3.0
%End

%TypeHeaderCode
#include <qgstextannotation.h>
#include "qgstextannotation.h"
%End

public:

QgsTextAnnotation( QObject* parent /TransferThis/ = nullptr );
QgsTextAnnotation( QObject *parent /TransferThis/ = 0 );
%Docstring
Constructor for QgsTextAnnotation.
%End

const QTextDocument *document() const;
%Docstring
Returns the text document which will be rendered
within the annotation.
@see setDocument()
%End

const QTextDocument* document() const;
void setDocument( const QTextDocument* doc );
void setDocument( const QTextDocument *doc );
%Docstring
Sets the text document which will be rendered
within the annotation. Ownership is not transferred.
@see document()
%End

virtual void writeXml( QDomElement& elem, QDomDocument & doc ) const;
virtual void readXml( const QDomElement& itemElem, const QDomDocument& doc );
virtual void writeXml( QDomElement &elem, QDomDocument &doc ) const;
virtual void readXml( const QDomElement &itemElem, const QDomDocument &doc );

static QgsTextAnnotation* create() /Factory/;
static QgsTextAnnotation *create() /Factory/;
%Docstring
Returns a new QgsTextAnnotation object.
%End

protected:

void renderAnnotation( QgsRenderContext& context, QSizeF size ) const;
void renderAnnotation( QgsRenderContext &context, QSizeF size ) const;

};

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/annotations/qgstextannotation.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
2 changes: 1 addition & 1 deletion src/core/annotations/qgsannotationmanager.cpp
Expand Up @@ -18,7 +18,7 @@
#include "qgsannotation.h"
#include "qgsannotationregistry.h"

QgsAnnotationManager::QgsAnnotationManager( QgsProject *project )
QgsAnnotationManager::QgsAnnotationManager( QgsProject *project SIP_TRANSFERTHIS )
: QObject( project )
, mProject( project )
{
Expand Down
5 changes: 3 additions & 2 deletions src/core/annotations/qgsannotationmanager.h
Expand Up @@ -17,6 +17,7 @@
#define QGSANNOTATIONMANAGER_H

#include "qgis_core.h"
#include "qgis.h"
#include <QObject>
#include <QDomElement>

Expand Down Expand Up @@ -47,7 +48,7 @@ class CORE_EXPORT QgsAnnotationManager : public QObject
* Constructor for QgsAnnotationManager. The project will become the parent object for this
* manager.
*/
explicit QgsAnnotationManager( QgsProject *project = nullptr );
explicit QgsAnnotationManager( QgsProject *project SIP_TRANSFERTHIS = nullptr );

~QgsAnnotationManager();

Expand All @@ -57,7 +58,7 @@ class CORE_EXPORT QgsAnnotationManager : public QObject
* @see removeAnnotation()
* @see annotationAdded()
*/
bool addAnnotation( QgsAnnotation *annotation );
bool addAnnotation( QgsAnnotation *annotation SIP_TRANSFER );

/**
* Removes an annotation from the manager. The annotation is deleted.
Expand Down
2 changes: 1 addition & 1 deletion src/core/annotations/qgshtmlannotation.cpp
Expand Up @@ -36,7 +36,7 @@
#include <QWidget>


QgsHtmlAnnotation::QgsHtmlAnnotation( QObject *parent )
QgsHtmlAnnotation::QgsHtmlAnnotation( QObject *parent SIP_TRANSFERTHIS )
: QgsAnnotation( parent )
{
mWebPage = new QgsWebPage();
Expand Down

0 comments on commit 0c08fb3

Please sign in to comment.