~ubuntu-branches/ubuntu/trusty/digikam/trusty

« back to all changes in this revision

Viewing changes to core/utilities/imageeditor/core/undoaction.h

  • Committer: Package Import Robot
  • Author(s): Rohan Garg
  • Date: 2012-11-26 18:24:20 UTC
  • mfrom: (1.9.1) (3.1.23 experimental)
  • Revision ID: package-import@ubuntu.com-20121126182420-qoy6z0nx4ai0wzcl
Tags: 4:3.0.0~beta3-0ubuntu1
* New upstream release
  - Add build-deps :  libhupnp-dev, libqtgstreamer-dev, libmagickcore-dev
* Merge from debian, remaining changes:
  - Make sure libqt4-opengl-dev, libgl1-mesa-dev and libglu1-mesa-dev only
    install on i386,amd64 and powerpc
  - Depend on libtiff-dev instead of libtiff4-dev
  - Drop digikam breaks/replaces kipi-plugins-common since we're past the
    LTS release now
  - digikam to recommend mplayerthumbs | ffmpegthumbs. We currently only
    have latter in the archives, even though former is also supposed to
    be part of kdemultimedia. (LP: #890059)
  - kipi-plugins to recommend www-browser rather than konqueror directly
    since 2.8 no direct usage of konqueror is present in the flickr
    plugin anymore (LP: #1011211)
  - Keep kubuntu_mysqld_executable_name.diff
  - Don't install libkipi translations
  - Keep deps on libcv-dev, libcvaux-dev
  - Keep split packaging of libraries
  - Replace icons from KDE 3 time in debian/xpm.d/*.xpm with the new
    versions (LP: #658047)
* Update debian/not-installed

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 dot raju at gmail dot com>
 
10
 * Copyright (C) 2005      by Joern Ahrens <joern dot ahrens at kdemail dot net>
 
11
 * Copyright (C) 2006-2012 by Gilles Caulier <caulier dot gilles at gmail dot com>
 
12
 *
 
13
 * This program is free software; you can redistribute it
 
14
 * and/or modify it under the terms of the GNU General
 
15
 * Public License as published by the Free Software Foundation;
 
16
 * either version 2, or (at your option)
 
17
 * any later version.
 
18
 *
 
19
 * This program is distributed in the hope that it will be useful,
 
20
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
21
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
22
 * GNU General Public License for more details.
 
23
 *
 
24
 * ============================================================ */
 
25
 
 
26
#ifndef UNDOACTION_H
 
27
#define UNDOACTION_H
 
28
 
 
29
// KDE includes
 
30
 
 
31
#include <klocale.h>
 
32
 
 
33
// Local includes
 
34
 
 
35
#include "digikam_export.h"
 
36
#include "dimagehistory.h"
 
37
#include "dimg.h"
 
38
#include "dimgbuiltinfilter.h"
 
39
 
 
40
namespace Digikam
 
41
{
 
42
 
 
43
class EditorCore;
 
44
 
 
45
class DIGIKAM_EXPORT UndoMetadataContainer
 
46
{
 
47
public:
 
48
 
 
49
    /** Fill a container from the DImg
 
50
     */
 
51
    static UndoMetadataContainer fromImage(const DImg& img);
 
52
 
 
53
    /** Write this container's values to the DImg
 
54
     */
 
55
    void toImage(DImg& img) const;
 
56
 
 
57
    bool changesIccProfile(const DImg& target) const;
 
58
 
 
59
public:
 
60
 
 
61
    DImageHistory  history;
 
62
    IccProfile     profile;
 
63
};
 
64
 
 
65
// -------------------------------------------------------------------
 
66
 
 
67
class DIGIKAM_EXPORT UndoAction
 
68
{
 
69
 
 
70
public:
 
71
 
 
72
    explicit UndoAction(EditorCore* const core);
 
73
    virtual ~UndoAction();
 
74
 
 
75
    void                  setTitle(const QString& title);
 
76
    QString               getTitle()                  const;
 
77
 
 
78
    void                  setMetadata(const UndoMetadataContainer&);
 
79
    UndoMetadataContainer getMetadata()               const;
 
80
 
 
81
    void                  setFileOriginData(const QVariant& data, const DImageHistory& resolvedInitialHistory);
 
82
    bool                  hasFileOriginData()         const;
 
83
    QVariant              fileOriginData()            const;
 
84
    DImageHistory         fileOriginResolvedHistory() const;
 
85
 
 
86
private:
 
87
 
 
88
    class Private;
 
89
    Private* const d;
 
90
};
 
91
 
 
92
// --------------------------------------------------------------------
 
93
 
 
94
class DIGIKAM_EXPORT UndoActionReversible : public UndoAction
 
95
{
 
96
 
 
97
public:
 
98
 
 
99
    UndoActionReversible(EditorCore* const core, const DImgBuiltinFilter& reversibleFilter);
 
100
 
 
101
    DImgBuiltinFilter getFilter()        const;
 
102
    DImgBuiltinFilter getReverseFilter() const;
 
103
 
 
104
protected:
 
105
 
 
106
    DImgBuiltinFilter m_filter;
 
107
};
 
108
 
 
109
// --------------------------------------------------------------------
 
110
 
 
111
class DIGIKAM_EXPORT UndoActionIrreversible : public UndoAction
 
112
{
 
113
 
 
114
public:
 
115
 
 
116
    explicit UndoActionIrreversible(EditorCore* const core, const QString& caller = i18n("Unknown"));
 
117
    ~UndoActionIrreversible();
 
118
};
 
119
 
 
120
}  // namespace Digikam
 
121
 
 
122
#endif /* UNDOACTION_H */