2012-09-24 02:28:15 +02:00
|
|
|
class QgsComposerMultiFrameCommand : QUndoCommand
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgscomposermultiframecommand.h>
|
|
|
|
%End
|
|
|
|
public:
|
2014-09-21 21:05:29 +10:00
|
|
|
QgsComposerMultiFrameCommand( QgsComposerMultiFrame* multiFrame, const QString& text, QUndoCommand* parent /TransferThis/ = 0 );
|
2012-09-24 02:28:15 +02:00
|
|
|
~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;
|
2012-09-24 02:28:15 +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();
|
2012-09-24 02:28:15 +02:00
|
|
|
};
|
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,
|
2014-09-17 21:52:19 +10:00
|
|
|
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;
|
|
|
|
|
|
|
|
};
|
|
|
|
|