Skip to content
Permalink
Browse files

Follow up 3f0d094

  • Loading branch information
nyalldawson committed Jul 29, 2014
1 parent 3f0d094 commit 950c9b89f10babe9f5cf55ed8ff0ecd51ea691ee
Showing with 41 additions and 1 deletion.
  1. +40 −0 python/core/composer/qgscomposermultiframecommand.sip
  2. +1 −1 python/core/composer/qgscomposition.sip
@@ -12,7 +12,47 @@ class QgsComposerMultiFrameCommand : QUndoCommand

void savePreviousState();
void saveAfterState();

QDomDocument previousState() const;
QDomDocument afterState() const;

/**Returns true if previous state and after state are valid and different*/
bool containsChange() const;

const QgsComposerMultiFrame* multiFrame() const;

protected:

QgsComposerMultiFrameCommand(); //forbidden
void saveState( QDomDocument& stateDoc );
void restoreState( QDomDocument& stateDoc );
bool checkFirstRun();
};


/**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
};

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

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

};

@@ -368,7 +368,7 @@ class QgsComposition : QGraphicsScene
/**Deletes current command*/
void cancelCommand();

void beginMultiFrameCommand( QgsComposerMultiFrame* multiFrame, const QString& text );
void beginMultiFrameCommand( QgsComposerMultiFrame* multiFrame, const QString& text, const QgsComposerMultiFrameMergeCommand::Context c = QgsComposerMultiFrameMergeCommand::Unknown );
void endMultiFrameCommand();

/**Adds multiframe. The object is owned by QgsComposition until removeMultiFrame is called*/

0 comments on commit 950c9b8

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