1
/* ============================================================
3
* This file is a part of digiKam project
4
* http://www.digikam.org
7
* Description : undo actions manager for image editor.
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>
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)
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.
24
* ============================================================ */
35
#include "digikam_export.h"
36
#include "dimagehistory.h"
38
#include "dimgbuiltinfilter.h"
45
class DIGIKAM_EXPORT UndoMetadataContainer
49
/** Fill a container from the DImg
51
static UndoMetadataContainer fromImage(const DImg& img);
53
/** Write this container's values to the DImg
55
void toImage(DImg& img) const;
57
bool changesIccProfile(const DImg& target) const;
61
DImageHistory history;
65
// -------------------------------------------------------------------
67
class DIGIKAM_EXPORT UndoAction
72
explicit UndoAction(EditorCore* const core);
73
virtual ~UndoAction();
75
void setTitle(const QString& title);
76
QString getTitle() const;
78
void setMetadata(const UndoMetadataContainer&);
79
UndoMetadataContainer getMetadata() const;
81
void setFileOriginData(const QVariant& data, const DImageHistory& resolvedInitialHistory);
82
bool hasFileOriginData() const;
83
QVariant fileOriginData() const;
84
DImageHistory fileOriginResolvedHistory() const;
92
// --------------------------------------------------------------------
94
class DIGIKAM_EXPORT UndoActionReversible : public UndoAction
99
UndoActionReversible(EditorCore* const core, const DImgBuiltinFilter& reversibleFilter);
101
DImgBuiltinFilter getFilter() const;
102
DImgBuiltinFilter getReverseFilter() const;
106
DImgBuiltinFilter m_filter;
109
// --------------------------------------------------------------------
111
class DIGIKAM_EXPORT UndoActionIrreversible : public UndoAction
116
explicit UndoActionIrreversible(EditorCore* const core, const QString& caller = i18n("Unknown"));
117
~UndoActionIrreversible();
120
} // namespace Digikam
122
#endif /* UNDOACTION_H */