Title block template editor: implemented paste operation

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1560 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
xavier
2012-03-11 16:06:40 +00:00
parent dc2ea1ae80
commit ab3caba9ef
3 changed files with 143 additions and 1 deletions

View File

@@ -250,4 +250,34 @@ class ChangeTemplateInformationsCommand : public QUndoCommand {
/// Informations after they were modified
QString new_information_;
};
/**
This class represents the action of pasting a cells set.
*/
class PasteTemplateCellsCommand : public TitleBlockTemplateCommand {
// constructors, destructor
public:
PasteTemplateCellsCommand(TitleBlockTemplate *, QUndoCommand * = 0);
virtual ~PasteTemplateCellsCommand();
private:
PasteTemplateCellsCommand(const PasteTemplateCellsCommand &);
// methods
public:
virtual void undo();
virtual void redo();
virtual void addPastedCell(TitleBlockCell *, const TitleBlockCell &);
virtual void addErasedCell(TitleBlockCell *, const TitleBlockCell &);
virtual void addCell(TitleBlockCell *, const TitleBlockCell &, const TitleBlockCell &);
protected:
virtual void updateText();
// attributes
public:
/// Pasted cells
QHash<TitleBlockCell *, TitleBlockCell> pasted_cells_;
/// Existing cells impacted by the paste operation
QHash<TitleBlockCell *, TitleBlockCell> erased_cells_;
};
#endif