QGIS/python/core/composer/qgscomposeritemcommand.sip
Juergen E. Fischer f3cb57b1eb SIP bindings update:
- update methods of existing classes
- add comment to methods missing in the sip bindings
- split up collective sip files into single files and use
  same directory structure in python/ as in src/
- add a lot of missing classes (some might not make sense because of
  missing python methods in those classes)
- remove some non-existing methods from the header files
- add scripts/sipdiff
- replace some usages of std::vector and std::set with QVector/QSet
2012-09-24 02:42:57 +02:00

95 lines
2.5 KiB
Plaintext

/**\ingroup MapComposer
Undo command to undo/redo all composer item related changes*/
class QgsComposerItemCommand: QUndoCommand
{
%TypeHeaderCode
#include "qgscomposeritemcommand.h"
%End
public:
QgsComposerItemCommand( QgsComposerItem* item, const QString& text, QUndoCommand* parent = 0 );
virtual ~QgsComposerItemCommand();
/**Reverses the command*/
void undo();
/**Replays the command*/
void redo();
/**Saves current item state as previous state*/
void savePreviousState();
/**Saves current item state as after state*/
void saveAfterState();
QDomDocument previousState() const;
QDomDocument afterState() const;
/**Returns true if previous state and after state are valid and different*/
bool containsChange() const;
const QgsComposerItem* item() const;
protected:
void saveState( QDomDocument& stateDoc ) const;
void restoreState( QDomDocument& stateDoc ) const;
};
/**A composer command that merges together with other commands having the same context (=id). Keeps the oldest previous state and uses the
newest after state. The purpose is to avoid too many micro changes in the history*/
class QgsComposerMergeCommand : QgsComposerItemCommand
{
%TypeHeaderCode
#include "qgscomposeritemcommand.h"
%End
public:
enum Context
{
Unknown = 0,
//composer label
ComposerLabelSetText,
ComposerLabelSetId,
ComposerLabelRotation,
//composer map
ComposerMapRotation,
ComposerMapAnnotationDistance,
//composer legend
ComposerLegendText,
LegendSymbolWidth,
LegendSymbolHeight,
LegendGroupSpace,
LegendLayerSpace,
LegendSymbolSpace,
LegendIconSymbolSpace,
LegendBoxSpace,
//composer picture
ComposerPictureRotation,
// composer scalebar
ScaleBarLineWidth,
ScaleBarHeight,
ScaleBarSegmentSize,
ScaleBarSegmentsLeft,
ScaleBarNSegments,
ScaleBarUnitText,
ScaleBarMapUnitsSegment,
ScaleBarLabelBarSize,
ScaleBarBoxContentSpace,
// composer table
TableMaximumFeatures,
TableMargin,
TableGridStrokeWidth,
//composer shape
ShapeRotation,
ShapeOutlineWidth,
//composer arrow
ArrowOutlineWidth,
ArrowHeadWidth,
//item
ItemOutlineWidth,
ItemMove
};
QgsComposerMergeCommand( Context c, QgsComposerItem* item, const QString& text );
~QgsComposerMergeCommand();
bool mergeWith( const QUndoCommand * command );
int id() const;
};