1 /*
2     This file is part of the Okteta Gui library, made within the KDE community.
3 
4     SPDX-FileCopyrightText: 2019 Friedrich W. H. Kossebau <kossebau@kde.org>
5 
6     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7 */
8 
9 #ifndef OKTETA_UNDOREDOCONTROLLER_HPP
10 #define OKTETA_UNDOREDOCONTROLLER_HPP
11 
12 // lib
13 #include "abstractcontroller.hpp"
14 
15 class QMenu;
16 
17 namespace Okteta {
18 
19 class AbstractByteArrayView;
20 
21 class UndoRedoController : public AbstractController
22 {
23 public:
24     UndoRedoController(AbstractByteArrayView* view, AbstractController* parent);
25     ~UndoRedoController() override;
26 
27 public: // AbstractController API
28     bool handleKeyPress(QKeyEvent* keyEvent) override;
29 
30 public:
31     int addContextMenuActions(QMenu* menu);
32 
33 private:
34     bool undo();
35     bool redo();
36 
37 private:
38     AbstractByteArrayView* const mView;
39 };
40 
41 }
42 
43 #endif
44