digiKam
Loading...
Searching...
No Matches
undomanager.h
Go to the documentation of this file.
1
/* ============================================================
2
*
3
* This file is a part of digiKam project
4
* https://www.digikam.org
5
*
6
* Date : 2005-02-06
7
* Description : an image editor actions undo/redo manager
8
*
9
* SPDX-FileCopyrightText: 2005-2006 by Renchi Raju <renchi dot raju at gmail dot com>
10
* SPDX-FileCopyrightText: 2005-2006 by Joern Ahrens <joern dot ahrens at kdemail dot net>
11
* SPDX-FileCopyrightText: 2006-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
12
*
13
* SPDX-License-Identifier: GPL-2.0-or-later
14
*
15
* ============================================================ */
16
17
#pragma once
18
19
// Qt includes
20
21
#include <QStringList>
22
23
// Local includes
24
25
#include "
digikam_export.h
"
26
27
namespace
Digikam
28
{
29
30
class
DImageHistory;
31
class
DImg;
32
class
EditorCore;
33
class
UndoAction;
34
class
UndoMetadataContainer;
35
36
class
DIGIKAM_EXPORT
UndoManager
37
{
38
39
public
:
40
41
explicit
UndoManager
(
EditorCore
*
const
core);
42
~UndoManager
();
43
44
void
addAction(
UndoAction
*
const
action);
45
void
undo();
46
void
redo();
47
void
rollbackToOrigin();
48
bool
putImageDataAndHistory(
DImg
*
const
img,
int
stepsBack)
const
;
49
50
void
clear(
bool
clearCache =
true
);
51
52
bool
anyMoreUndo()
const
;
53
bool
anyMoreRedo()
const
;
54
int
availableUndoSteps()
const
;
55
int
availableRedoSteps()
const
;
56
QStringList getUndoHistory()
const
;
57
QStringList getRedoHistory()
const
;
58
bool
isAtOrigin()
const
;
59
void
setOrigin()
const
;
60
bool
hasChanges()
const
;
61
63
DImageHistory
getImageHistoryOfFullRedo()
const
;
64
65
void
clearPreviousOriginData();
66
67
private
:
68
69
void
clearUndoActions();
70
void
clearRedoActions();
71
void
undoStep(
bool
saveRedo,
bool
execute,
bool
flyingRollback);
72
void
redoStep(
bool
execute,
bool
flyingRollback);
73
void
makeSnapshot(
int
index);
74
void
restoreSnapshot(
int
index,
const
UndoMetadataContainer
& c);
75
void
getSnapshot(
int
index,
DImg
*
const
img)
const
;
76
77
private
:
78
79
// Disable
80
UndoManager
(
const
UndoManager
&) =
delete
;
81
UndoManager
& operator=(
const
UndoManager
&) =
delete
;
82
83
private
:
84
85
class
Private;
86
Private*
const
d =
nullptr
;
87
};
88
89
}
// namespace Digikam
Digikam::DImageHistory
Definition
dimagehistory.h:39
Digikam::DImg
Definition
dimg.h:52
Digikam::EditorCore
Definition
editorcore.h:48
Digikam::UndoAction
Definition
undoaction.h:56
Digikam::UndoManager
Definition
undomanager.h:37
Digikam::UndoMetadataContainer
Definition
undoaction.h:32
digikam_export.h
Digikam
Definition
datefolderview.cpp:34
core
utilities
imageeditor
core
undomanager.h
Generated by
1.9.8