tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / sc / source / ui / inc / undomanager.hxx
blobe36ae179f04ed04a73895222db35c99891c31820
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9 #pragma once
11 #include <svx/sdrundomanager.hxx>
13 class SfxViewShell;
14 class ScSimpleUndo;
16 class SC_DLLPUBLIC ScUndoManager : public SdrUndoManager
18 public:
19 ~ScUndoManager();
21 /**
22 * Checks if the topmost undo action owned by pView is independent from the topmost action undo
23 * action. Sets rOffset to the offset of that independent undo action on success.
25 bool IsViewUndoActionIndependent(const SfxViewShell* pView, sal_uInt16& rOffset) const;
27 /// Make these public
28 using SdrUndoManager::UndoWithContext;
29 using SdrUndoManager::RedoWithContext;
30 using SdrUndoManager::UndoMark;
32 private:
33 static std::optional<ScRange> getAffectedRangeFromUndo(const SfxUndoAction*);
34 static const ScSimpleUndo* getScSimpleUndo(const SfxUndoAction*);
37 class ScUndoRedoContext final : public SfxUndoContext
39 public:
40 void SetUndoOffset(size_t nUndoOffset) { m_nUndoOffset = nUndoOffset; }
42 size_t GetUndoOffset() override { return m_nUndoOffset; }
44 private:
45 size_t m_nUndoOffset = 0;
48 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */