QGIS/python/core/composer/qgscomposermultiframecommand.sip

63 lines
1.6 KiB
Plaintext
Raw Normal View History

class QgsComposerMultiFrameCommand : QUndoCommand
{
%TypeHeaderCode
#include <qgscomposermultiframecommand.h>
%End
public:
QgsComposerMultiFrameCommand( QgsComposerMultiFrame* multiFrame, const QString& text, QUndoCommand* parent = 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;
/**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
/**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
{
%TypeHeaderCode
#include <qgscomposermultiframecommand.h>
%End
public:
enum Context
{
Unknown = 0,
//composer html
HtmlSource,
HtmlStylesheet,
HtmlBreakDistance,
//attribute table
TableMaximumFeatures,
TableMargin,
TableGridStrokeWidth
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;
};