Plasma Engine  2.0
Loading...
Searching...
No Matches
CommandHistoryActions.h
1#pragma once
2
3#include <GuiFoundation/Action/BaseActions.h>
4#include <GuiFoundation/GuiFoundationDLL.h>
5#include <ToolsFoundation/CommandHistory/CommandHistory.h>
6
8class PL_GUIFOUNDATION_DLL plCommandHistoryActions
9{
10public:
11 static void RegisterActions();
12 static void UnregisterActions();
13
14 static void MapActions(plStringView sMapping, plStringView sTargetMenu = "G.Edit");
15
16 static plActionDescriptorHandle s_hCommandHistoryCategory;
17 static plActionDescriptorHandle s_hUndo;
18 static plActionDescriptorHandle s_hRedo;
19};
20
21
23class PL_GUIFOUNDATION_DLL plCommandHistoryAction : public plDynamicActionAndMenuAction
24{
25 PL_ADD_DYNAMIC_REFLECTION(plCommandHistoryAction, plDynamicActionAndMenuAction);
26
27public:
28 enum class ButtonType
29 {
30 Undo,
31 Redo,
32 };
33
34 plCommandHistoryAction(const plActionContext& context, const char* szName, ButtonType button);
36
37 virtual void Execute(const plVariant& value) override;
38 virtual void GetEntries(plHybridArray<plDynamicMenuAction::Item, 16>& out_entries) override;
39
40private:
41 void UpdateState();
42 void CommandHistoryEventHandler(const plCommandHistoryEvent& e);
43
44 ButtonType m_ButtonType;
45};
Handle for a plAction.
Definition Action.h:27
Definition CommandHistoryActions.h:24
Definition CommandHistoryActions.h:9
Definition BaseActions.h:115
A hybrid array uses in-place storage to handle the first few elements without any allocation....
Definition HybridArray.h:12
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
plVariant is a class that can store different types of variables, which is useful in situations where...
Definition Variant.h:44
Definition Action.h:67
Definition CommandHistory.h:31