48
48
* - Implement undo()
49
49
* - Define the operation/command text with setText()
51
class GWENVIEWLIB_EXPORT AbstractImageOperation : public QObject {
51
class GWENVIEWLIB_EXPORT AbstractImageOperation : public QObject
54
AbstractImageOperation();
55
virtual ~AbstractImageOperation();
55
AbstractImageOperation();
56
virtual ~AbstractImageOperation();
57
void applyToDocument(Document::Ptr);
58
Document::Ptr document() const;
58
void applyToDocument(Document::Ptr);
59
Document::Ptr document() const;
61
virtual void redo() = 0;
62
virtual void undo() {}
63
void setText(const QString&);
62
virtual void redo() = 0;
63
virtual void undo() {}
64
void setText(const QString&);
66
* Convenience method which can be called from redo() if the operation is
67
* implemented as a job
69
void redoAsDocumentJob(DocumentJob* job);
67
* Convenience method which can be called from redo() if the operation is
68
* implemented as a job
70
void redoAsDocumentJob(DocumentJob* job);
75
* Convenience slot which call finish() correctly if job succeeded
77
void finishFromKJob(KJob* job);
76
* Convenience slot which call finish() correctly if job succeeded
78
void finishFromKJob(KJob* job);
80
AbstractImageOperationPrivate* const d;
81
AbstractImageOperationPrivate* const d;
82
friend class ImageOperationCommand;
83
friend class ImageOperationCommand;
88
88
#endif /* ABSTRACTIMAGEOPERATION_H */