LMMS
Loading...
Searching...
No Matches
juce_UndoManager.h
Go to the documentation of this file.
1/*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 Agreement and JUCE Privacy Policy.
12
13 End User License Agreement: www.juce.com/juce-7-licence
14 Privacy Policy: www.juce.com/juce-privacy-policy
15
16 Or: You may also use this code under the terms of the GPL v3 (see
17 www.gnu.org/licenses).
18
19 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 DISCLAIMED.
22
23 ==============================================================================
24*/
25
26namespace juce
27{
28
29//==============================================================================
52{
53public:
54 //==============================================================================
68 UndoManager (int maxNumberOfUnitsToKeep = 30000,
70
72 ~UndoManager() override;
73
74 //==============================================================================
76 void clearUndoHistory();
77
82
97 void setMaxNumberOfStoredUnits (int maxNumberOfUnitsToKeep,
99
100 //==============================================================================
108 bool perform (UndoableAction* action);
109
120 bool perform (UndoableAction* action, const String& actionName);
121
128 void beginNewTransaction();
129
139 void beginNewTransaction (const String& actionName);
140
147 void setCurrentTransactionName (const String& newName);
148
153
154 //==============================================================================
158 bool canUndo() const;
159
165 bool undo();
166
181
186
193
198
208
214
215 //==============================================================================
219 bool canRedo() const;
220
225 bool redo();
226
231
238
244
246 bool isPerformingUndoRedo() const;
247
248private:
249 //==============================================================================
250 struct ActionSet;
255 ActionSet* getCurrentSet() const;
256 ActionSet* getNextSet() const;
260
262};
263
264} // namespace juce
Definition juce_Array.h:56
ChangeBroadcaster() noexcept
Definition juce_ChangeBroadcaster.cpp:26
Definition juce_OwnedArray.h:51
Definition juce_StringArray.h:35
Definition juce_String.h:53
Definition juce_Time.h:37
void beginNewTransaction()
Definition juce_UndoManager.cpp:209
Time getTimeOfUndoTransaction() const
Definition juce_UndoManager.cpp:325
String getCurrentTransactionName() const
Definition juce_UndoManager.cpp:228
void setMaxNumberOfStoredUnits(int maxNumberOfUnitsToKeep, int minimumTransactionsToKeep)
Definition juce_UndoManager.cpp:91
bool redo()
Definition juce_UndoManager.cpp:264
String getRedoDescription() const
Definition juce_UndoManager.cpp:291
int maxNumUnitsToKeep
Definition juce_UndoManager.h:253
StringArray getRedoDescriptions() const
Definition juce_UndoManager.cpp:312
bool undo()
Definition juce_UndoManager.cpp:245
int nextIndex
Definition juce_UndoManager.h:253
ActionSet * getNextSet() const
Definition juce_UndoManager.cpp:238
bool isInsideUndoRedoCall
Definition juce_UndoManager.h:254
OwnedArray< ActionSet > stashedFutureTransactions
Definition juce_UndoManager.h:251
bool isPerformingUndoRedo() const
Definition juce_UndoManager.cpp:240
ActionSet * getCurrentSet() const
Definition juce_UndoManager.cpp:237
OwnedArray< ActionSet > transactions
Definition juce_UndoManager.h:251
void clearUndoHistory()
Definition juce_UndoManager.cpp:78
void restoreStashedFutureTransactions()
Definition juce_UndoManager.cpp:176
String newTransactionName
Definition juce_UndoManager.h:252
bool canUndo() const
Definition juce_UndoManager.cpp:242
void dropOldTransactionsIfTooLarge()
Definition juce_UndoManager.cpp:193
bool undoCurrentTransactionOnly()
Definition juce_UndoManager.cpp:341
int getNumberOfUnitsTakenUpByStoredCommands() const
Definition juce_UndoManager.cpp:86
bool perform(UndoableAction *action)
Definition juce_UndoManager.cpp:111
Time getTimeOfRedoTransaction() const
Definition juce_UndoManager.cpp:333
bool canRedo() const
Definition juce_UndoManager.cpp:243
int minimumTransactionsToKeep
Definition juce_UndoManager.h:253
int totalUnitsStored
Definition juce_UndoManager.h:253
StringArray getUndoDescriptions() const
Definition juce_UndoManager.cpp:299
String getUndoDescription() const
Definition juce_UndoManager.cpp:283
UndoManager(int maxNumberOfUnitsToKeep=30000, int minimumTransactionsToKeep=30)
Definition juce_UndoManager.cpp:68
bool newTransaction
Definition juce_UndoManager.h:254
void getActionsInCurrentTransaction(Array< const UndoableAction * > &actionsFound) const
Definition juce_UndoManager.cpp:352
void moveFutureTransactionsToStash()
Definition juce_UndoManager.cpp:161
int getNumActionsInCurrentTransaction() const
Definition juce_UndoManager.cpp:360
void setCurrentTransactionName(const String &newName)
Definition juce_UndoManager.cpp:220
Definition juce_UndoableAction.h:39
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
#define JUCE_API
Definition juce_StandardHeader.h:152
Definition carla_juce.cpp:31
Definition juce_UndoManager.cpp:30