tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / sc / source / ui / inc / undo / UndoGroupSparklines.hxx
blobe67778c21309abb201bcae900ef9bbf78d24d2b3
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
9 */
11 #pragma once
13 #include <undobase.hxx>
14 #include <memory>
15 #include <utility>
17 namespace sc
19 /** Previous sparkline group data, which is restored at Undo grouping */
20 struct UndoGroupSparklinesData
22 UndoGroupSparklinesData(ScAddress const& rAddress, ScRangeList aDataRangeList,
23 std::shared_ptr<sc::SparklineGroup> pGroup)
24 : m_aAddress(rAddress)
25 , m_aDataRangeList(std::move(aDataRangeList))
26 , m_pSparklineGroup(std::move(pGroup))
30 ScAddress m_aAddress;
31 ScRangeList m_aDataRangeList;
32 std::shared_ptr<sc::SparklineGroup> m_pSparklineGroup;
35 /** Undo action for grouping sparklines */
36 class UndoGroupSparklines : public ScSimpleUndo
38 private:
39 ScRange m_aRange;
40 std::shared_ptr<sc::SparklineGroup> m_pSparklineGroup;
41 std::vector<UndoGroupSparklinesData> m_aUndoData;
43 public:
44 UndoGroupSparklines(ScDocShell& rDocShell, ScRange const& rRange,
45 std::shared_ptr<sc::SparklineGroup> pSparklineGroup);
46 virtual ~UndoGroupSparklines() override;
48 void Undo() override;
49 void Redo() override;
50 bool CanRepeat(SfxRepeatTarget& rTarget) const override;
51 void Repeat(SfxRepeatTarget& rTarget) override;
52 OUString GetComment() const override;
55 } // namespace sc
57 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */