~ubuntu-branches/ubuntu/intrepid/digikam/intrepid

« back to all changes in this revision

Viewing changes to digikam/utilities/imageeditor/canvas/undoaction.h

  • Committer: Bazaar Package Importer
  • Author(s): Mark Purcell
  • Date: 2008-07-17 20:25:39 UTC
  • mfrom: (1.3.2 upstream) (37 hardy)
  • mto: This revision was merged to the branch mainline in revision 39.
  • Revision ID: james.westby@ubuntu.com-20080717202539-1bw3w3nrsso7yj4z
* New upstream release
  - digiKam 0.9.4 Release Plan (KDE3) ~ 13 July 08 (Closes: #490144)
* DEB_CONFIGURE_EXTRA_FLAGS := --without-included-sqlite3
* Debhelper compatibility level V7
* Install pixmaps in debian/*.install
* Add debian/digikam.lintian-overrides

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ============================================================
 
2
 *
 
3
 * This file is a part of digiKam project
 
4
 * http://www.digikam.org
 
5
 *
 
6
 * Date        : 2005-02-06
 
7
 * Description : undo actions manager for image editor.
 
8
 *
 
9
 * Copyright (C) 2005 by Renchi Raju <renchi@pooh.tam.uiuc.edu>
 
10
 * Copyright (C) 2005 by Joern Ahrens <joern.ahrens@kdemail.net>
 
11
 *
 
12
 * This program is free software; you can redistribute it
 
13
 * and/or modify it under the terms of the GNU General
 
14
 * Public License as published by the Free Software Foundation;
 
15
 * either version 2, or (at your option)
 
16
 * any later version.
 
17
 * 
 
18
 * This program is distributed in the hope that it will be useful,
 
19
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
20
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
21
 * GNU General Public License for more details.
 
22
 *
 
23
 * ============================================================ */
 
24
 
 
25
#ifndef UNDOACTION_H
 
26
#define UNDOACTION_H
 
27
 
 
28
// KDE includes.
 
29
 
 
30
#include <klocale.h>
 
31
 
 
32
// Local includes.
 
33
 
 
34
#include "digikam_export.h"
 
35
 
 
36
namespace Digikam
 
37
{
 
38
 
 
39
class DImgInterface;
 
40
 
 
41
class DIGIKAM_EXPORT UndoAction
 
42
{
 
43
 
 
44
public:
 
45
 
 
46
    UndoAction(DImgInterface* iface);
 
47
    virtual ~UndoAction();
 
48
 
 
49
    virtual void rollBack() = 0;
 
50
    virtual void execute()  = 0;
 
51
 
 
52
    QString getTitle() const;
 
53
    
 
54
protected:
 
55
 
 
56
    DImgInterface *m_iface;
 
57
    QString        m_title;
 
58
};
 
59
 
 
60
class DIGIKAM_EXPORT UndoActionRotate : public UndoAction
 
61
{
 
62
 
 
63
public:
 
64
 
 
65
    enum Angle
 
66
    {
 
67
        R90,
 
68
        R180,
 
69
        R270
 
70
    };
 
71
    
 
72
    UndoActionRotate(DImgInterface* iface, Angle angle);
 
73
    ~UndoActionRotate();
 
74
 
 
75
    void rollBack();
 
76
    void execute();
 
77
 
 
78
private:
 
79
 
 
80
    int m_angle;
 
81
};
 
82
 
 
83
class DIGIKAM_EXPORT UndoActionFlip : public UndoAction
 
84
{
 
85
 
 
86
public:
 
87
 
 
88
    enum Direction
 
89
    {
 
90
        Horizontal,
 
91
        Vertical
 
92
    };
 
93
    
 
94
    UndoActionFlip(DImgInterface* iface, Direction dir);
 
95
    ~UndoActionFlip();
 
96
 
 
97
    void rollBack();
 
98
    void execute();
 
99
 
 
100
private:
 
101
 
 
102
    int m_dir;
 
103
};
 
104
 
 
105
class DIGIKAM_EXPORT UndoActionBCG : public UndoAction
 
106
{
 
107
 
 
108
public:
 
109
 
 
110
    UndoActionBCG(DImgInterface* iface,
 
111
                  double oldGamma, double oldBrightness,
 
112
                  double oldContrast, double newGamma,
 
113
                  double newBrightness, double newContrast);
 
114
    ~UndoActionBCG();
 
115
 
 
116
    void rollBack();
 
117
    void execute();    
 
118
 
 
119
private:
 
120
 
 
121
    double m_oldGamma;
 
122
    double m_oldBrightness;
 
123
    double m_oldContrast;
 
124
    double m_newGamma;
 
125
    double m_newBrightness;
 
126
    double m_newContrast;
 
127
};
 
128
 
 
129
class DIGIKAM_EXPORT UndoActionIrreversible : public UndoAction
 
130
{
 
131
 
 
132
public:
 
133
 
 
134
    UndoActionIrreversible(DImgInterface* iface,
 
135
                           const QString &caller=i18n("Unknown"));
 
136
    ~UndoActionIrreversible();
 
137
 
 
138
    void rollBack();
 
139
    void execute();
 
140
};
 
141
 
 
142
}  // namespace Digikam
 
143
 
 
144
#endif /* UNDOACTION_H */