~ubuntu-branches/ubuntu/precise/gwenview/precise-proposed

« back to all changes in this revision

Viewing changes to lib/abstractimageoperation.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2011-12-15 14:17:54 UTC
  • mto: This revision was merged to the branch mainline in revision 12.
  • Revision ID: package-import@ubuntu.com-20111215141754-z043hyx69dulbggf
Tags: upstream-4.7.90
Import upstream version 4.7.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// vim: set tabstop=4 shiftwidth=4 noexpandtab:
 
1
// vim: set tabstop=4 shiftwidth=4 expandtab:
2
2
/*
3
3
Gwenview: an image viewer
4
4
Copyright 2007 Aurélien Gâteau <agateau@kde.org>
33
33
 
34
34
class KJob;
35
35
 
36
 
namespace Gwenview {
37
 
 
 
36
namespace Gwenview
 
37
{
38
38
 
39
39
struct AbstractImageOperationPrivate;
40
40
 
48
48
 * - Implement undo()
49
49
 * - Define the operation/command text with setText()
50
50
 */
51
 
class GWENVIEWLIB_EXPORT AbstractImageOperation : public QObject {
52
 
        Q_OBJECT
 
51
class GWENVIEWLIB_EXPORT AbstractImageOperation : public QObject
 
52
{
 
53
    Q_OBJECT
53
54
public:
54
 
        AbstractImageOperation();
55
 
        virtual ~AbstractImageOperation();
 
55
    AbstractImageOperation();
 
56
    virtual ~AbstractImageOperation();
56
57
 
57
 
        void applyToDocument(Document::Ptr);
58
 
        Document::Ptr document() const;
 
58
    void applyToDocument(Document::Ptr);
 
59
    Document::Ptr document() const;
59
60
 
60
61
protected:
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&);
64
65
 
65
 
        /**
66
 
         * Convenience method which can be called from redo() if the operation is
67
 
         * implemented as a job
68
 
         */
69
 
        void redoAsDocumentJob(DocumentJob* job);
 
66
    /**
 
67
     * Convenience method which can be called from redo() if the operation is
 
68
     * implemented as a job
 
69
     */
 
70
    void redoAsDocumentJob(DocumentJob* job);
70
71
 
71
72
protected Q_SLOTS:
72
 
        void finish(bool ok);
 
73
    void finish(bool ok);
73
74
 
74
 
        /**
75
 
         * Convenience slot which call finish() correctly if job succeeded
76
 
         */
77
 
        void finishFromKJob(KJob* job);
 
75
    /**
 
76
     * Convenience slot which call finish() correctly if job succeeded
 
77
     */
 
78
    void finishFromKJob(KJob* job);
78
79
 
79
80
private:
80
 
        AbstractImageOperationPrivate* const d;
 
81
    AbstractImageOperationPrivate* const d;
81
82
 
82
 
        friend class ImageOperationCommand;
 
83
    friend class ImageOperationCommand;
83
84
};
84
85
 
85
 
 
86
86
} // namespace
87
87
 
88
88
#endif /* ABSTRACTIMAGEOPERATION_H */