QGIS/python/core/composer/qgscomposermultiframecommand.sip

63 lines
1.7 KiB
Plaintext
Raw Normal View History

class QgsComposerMultiFrameCommand : QUndoCommand
{
%TypeHeaderCode
#include <qgscomposermultiframecommand.h>
%End
public:
QgsComposerMultiFrameCommand( QgsComposerMultiFrame* multiFrame, const QString& text, QUndoCommand* parent /TransferThis/ = 0 );
~QgsComposerMultiFrameCommand();
void undo();
void redo();
void savePreviousState();
void saveAfterState();
2014-08-17 13:37:26 +02:00
2014-07-29 20:48:40 +10:00
QDomDocument previousState() const;
QDomDocument afterState() const;
2015-07-29 11:52:14 +02:00
/** Returns true if previous state and after state are valid and different*/
bool containsChange() const;
2014-08-17 13:37:26 +02:00
2014-07-29 20:48:40 +10:00
const QgsComposerMultiFrame* multiFrame() const;
2014-08-17 13:37:26 +02:00
2014-07-29 20:48:40 +10:00
protected:
QgsComposerMultiFrameCommand(); //forbidden
void saveState( QDomDocument& stateDoc );
void restoreState( QDomDocument& stateDoc );
bool checkFirstRun();
};
2014-07-29 20:48:40 +10:00
2015-07-29 11:52:14 +02:00
/** A composer command that merges together with other commands having the same context (=id)
2014-07-29 20:48:40 +10:00
* 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
{
%TypeHeaderCode
#include <qgscomposermultiframecommand.h>
%End
public:
enum Context
{
Unknown = 0,
//composer html
HtmlSource,
HtmlStylesheet,
HtmlBreakDistance,
//attribute table
TableMaximumFeatures,
TableMargin,
2016-02-14 03:50:23 +01:00
TableGridStrokeWidth,
TableCellStyle
2014-07-29 20:48:40 +10:00
};
QgsComposerMultiFrameMergeCommand( Context c, QgsComposerMultiFrame* multiFrame, const QString& text );
~QgsComposerMultiFrameMergeCommand();
bool mergeWith( const QUndoCommand * command );
int id() const;
};