Skip to content
Permalink
Browse files

sipify core composer part 3

  • Loading branch information
3nids committed Jun 20, 2017
1 parent b52f7c2 commit c9a75090bc8f4895c288337fc572b482c7cef71c
@@ -1,16 +1,5 @@
core/conversions.sip
core/qgsexception.sip
core/composer/qgscomposermultiframecommand.sip
core/composer/qgscomposerobject.sip
core/composer/qgscomposerpicture.sip
core/composer/qgscomposerscalebar.sip
core/composer/qgscomposershape.sip
core/composer/qgscomposernodesitem.sip
core/composer/qgscomposerpolygon.sip
core/composer/qgscomposerpolyline.sip
core/composer/qgscomposertablecolumn.sip
core/composer/qgscomposertablev2.sip
core/composer/qgscomposertexttable.sip
core/composer/qgscomposerutils.sip
core/composer/qgscomposition.sip
core/composer/qgsdoubleboxscalebarstyle.sip
@@ -1,51 +1,86 @@
class QgsComposerMultiFrameCommand : QUndoCommand
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/composer/qgscomposermultiframecommand.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/






class QgsComposerMultiFrameCommand: QUndoCommand
{

%TypeHeaderCode
#include <qgscomposermultiframecommand.h>
#include "qgscomposermultiframecommand.h"
%End
public:
QgsComposerMultiFrameCommand( QgsComposerMultiFrame *multiFrame, const QString &text, QUndoCommand *parent /TransferThis/ = 0 );
~QgsComposerMultiFrameCommand();

void undo();
void redo();
virtual void undo();

virtual void redo();


void savePreviousState();
void saveAfterState();

QDomDocument previousState() const;
%Docstring
:rtype: QDomDocument
%End
QDomDocument afterState() const;
%Docstring
:rtype: QDomDocument
%End

/** Returns true if previous state and after state are valid and different*/
bool containsChange() const;
%Docstring
Returns true if previous state and after state are valid and different
:rtype: bool
%End

const QgsComposerMultiFrame *multiFrame() const;
%Docstring
:rtype: QgsComposerMultiFrame
%End

protected:



QgsComposerMultiFrameCommand(); //forbidden
void saveState( QDomDocument &stateDoc );
void restoreState( QDomDocument &stateDoc );
bool checkFirstRun();
%Docstring
:rtype: bool
%End
};

/** A composer command that merges together with other commands having the same context (=id)
* for multi frame items. Keeps the oldest previous state and uses the newest after state.
* The purpose is to avoid too many micro changes in the history*/
class QgsComposerMultiFrameMergeCommand: QgsComposerMultiFrameCommand
{
%Docstring
A composer command that merges together with other commands having the same context (=id)
for multi frame items. Keeps the oldest previous state and uses the newest after state.
The purpose is to avoid too many micro changes in the history*
%End

%TypeHeaderCode
#include <qgscomposermultiframecommand.h>
#include "qgscomposermultiframecommand.h"
%End
public:
enum Context
{
Unknown = 0,
//composer html
Unknown,
//composer
HtmlSource,
HtmlStylesheet,
HtmlBreakDistance,
//attribute table
//attribute
TableMaximumFeatures,
TableMargin,
TableGridStrokeWidth,
@@ -57,10 +92,17 @@ class QgsComposerMultiFrameMergeCommand: QgsComposerMultiFrameCommand
};

QgsComposerMultiFrameMergeCommand( Context c, QgsComposerMultiFrame *multiFrame, const QString &text );
~QgsComposerMultiFrameMergeCommand();

bool mergeWith( const QUndoCommand *command );
int id() const;
virtual bool mergeWith( const QUndoCommand *command );

virtual int id() const;

};

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/composer/qgscomposermultiframecommand.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
@@ -1,111 +1,196 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/composer/qgscomposernodesitem.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/




class QgsComposerNodesItem: QgsComposerItem
{
%Docstring
An abstract composer item that provides generic methods for nodes based
shapes such as polygon or polylines.
.. versionadded:: 2.16
%End

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

QgsComposerNodesItem( const QString &mTagName, QgsComposition *c );
%Docstring
Constructor
\param mTagName tag used in XML file
\param c parent composition
%End

QgsComposerNodesItem( const QString &mTagName, const QPolygonF &polygon, QgsComposition *c );
~QgsComposerNodesItem();

/** Add a node in current shape.
* @param pt is the location of the new node
* @param checkArea is a flag to indicate if there's a space constraint.
* @param radius is the space contraint and is used only if checkArea is
* true. Typically, if this flag is true, the new node has to be nearest
* than radius to the shape to be added.
*/
%Docstring
Constructor
\param mTagName tag used in XML file
\param polygon nodes of the shape
\param c parent composition
%End

bool addNode( QPointF pt, const bool checkArea = true, const double radius = 10 );
%Docstring
Add a node in current shape.
\param pt is the location of the new node
\param checkArea is a flag to indicate if there's a space constraint.
\param radius is the space contraint and is used only if checkArea is
true. Typically, if this flag is true, the new node has to be nearest
than radius to the shape to be added.
:rtype: bool
%End

/** Set a tag to indicate if we want to draw or not the shape's nodes.
* @param display
*/
void setDisplayNodes( const bool display = true );
%Docstring
Set a tag to indicate if we want to draw or not the shape's nodes.
\param display
%End

/** Move a node to a new position.
* @param index the index of the node to move
* @param node is the new position in scene coordinate
*/
bool moveNode( const int index, QPointF node );
%Docstring
Move a node to a new position.
\param index the index of the node to move
\param node is the new position in scene coordinate
:rtype: bool
%End

/** \brief Reimplementation of QCanvasItem::paint - draw on canvas */
void paint( QPainter *painter, const QStyleOptionGraphicsItem *itemStyle, QWidget *pWidget );
virtual void paint( QPainter *painter, const QStyleOptionGraphicsItem *itemStyle, QWidget *pWidget );

%Docstring
Reimplementation of QCanvasItem.paint - draw on canvas
%End

/** Search the nearest node in shape within a maximal area. Returns the
* index of the nearest node or -1.
* @param node is where a shape's node is searched
* @param searchInRadius is a flag to indicate if the area of research is
* limited in space.
* @param radius is only used if searchInRadius is true
*/
int nodeAtPosition( QPointF node, const bool searchInRadius = true, const double radius = 10 );
%Docstring
Search the nearest node in shape within a maximal area. Returns the
index of the nearest node or -1.
\param node is where a shape's node is searched
\param searchInRadius is a flag to indicate if the area of research is
limited in space.
\param radius is only used if searchInRadius is true
:rtype: int
%End

/** Gets the position of a node in scene coordinate.
* @param index of the node
* @param position the position of the node
* @return true if the index is valid and the position is set, false otherwise
*/
bool nodePosition( const int index, QPointF &position );
%Docstring
Gets the position of a node in scene coordinate.
\param index of the node
\param position the position of the node
:return: true if the index is valid and the position is set, false otherwise
:rtype: bool
%End

/** Sets state from Dom document
* @param itemElem is Dom node corresponding to item tag
* @param doc is Dom document
*/
bool readXml( const QDomElement &itemElem, const QDomDocument &doc );
virtual bool readXml( const QDomElement &itemElem, const QDomDocument &doc );

%Docstring
Sets state from Dom document
\param itemElem is Dom node corresponding to item tag
\param doc is Dom document
:rtype: bool
%End

/** Remove a node from the shape.
* @param index of the node to delete
*/
bool removeNode( const int index );
%Docstring
Remove a node from the shape.
\param index of the node to delete
:rtype: bool
%End

/** Returns the number of nodes in the shape. */
int nodesSize();
%Docstring
Returns the number of nodes in the shape.
:rtype: int
%End

/** Select a node.
* @param index the node to select
*/
bool setSelectedNode( const int index );
%Docstring
Select a node.
\param index the node to select
:rtype: bool
%End

/** Returns the currently selected node.
* @return the index of the selected node, -1 otherwise
*/
int selectedNode();
%Docstring
Returns the currently selected node.
:return: the index of the selected node, -1 otherwise
:rtype: int
%End

/** Deselect a node.
*/
void deselectNode();
%Docstring
Deselect a node.
%End

/** Stores state in Dom element
* @param elem is Dom element corresponding to 'Composer' tag
* @param doc write template file
*/
bool writeXml( QDomElement &elem, QDomDocument &doc ) const;
virtual bool writeXml( QDomElement &elem, QDomDocument &doc ) const;

%Docstring
Stores state in Dom element
\param elem is Dom element corresponding to 'Composer' tag
\param doc write template file
:rtype: bool
%End

protected:

/** Method called in addNode. */
virtual bool _addNode( const int nodeIndex, QPointF newPoint, const double radius ) = 0;

/** Method called in removeNode. */
virtual bool _addNode( const int nodeIndex, QPointF newNode, const double radius ) = 0;
%Docstring
Method called in addNode.
:rtype: bool
%End

virtual bool _removeNode( const int nodeIndex ) = 0;
%Docstring
Method called in removeNode.
:rtype: bool
%End

/** Method called in paint. */
virtual void _draw( QPainter *painter ) = 0;
%Docstring
Method called in paint.
%End

/** Method called in readXML. */
virtual void _readXmlStyle( const QDomElement &elmt ) = 0;
%Docstring
Method called in readXml.
%End

/** Method called in writeXML. */
virtual void _writeXmlStyle( QDomDocument &doc, QDomElement &elmt ) const = 0;
%Docstring
Method called in writeXml.
%End

/** Rescale the current shape according to the boudning box. Useful when
* the shape is resized thanks to the rubber band. */
void rescaleToFitBoundingBox();
%Docstring
Rescale the current shape according to the boudning box. Useful when
the shape is resized thanks to the rubber band. *
%End

/** Compute an euclidian distance between 2 nodes. */
double computeDistance( QPointF pt1, QPointF pt2) const;
double computeDistance( QPointF pt1, QPointF pt2 ) const;
%Docstring
Compute an euclidian distance between 2 nodes.
:rtype: float
%End

/** Update the current scene rectangle for this item. */
void updateSceneRect();
%Docstring
Update the current scene rectangle for this item.
%End

};

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/composer/qgscomposernodesitem.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

0 comments on commit c9a7509

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