LibreOffice Module chart2 (master) 1
UndoManager.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21
22#include <com/sun/star/document/XUndoManager.hpp>
23#include <com/sun/star/util/XModifyBroadcaster.hpp>
24
26
27#include <memory>
28
29namespace chart
30{
31class ChartModel;
32
33 namespace impl
34 {
35 class UndoManager_Impl;
36 typedef ::cppu::ImplHelper2 < css::document::XUndoManager
37 , css::util::XModifyBroadcaster
39 }
40
42 {
43 public:
44 UndoManager( ::chart::ChartModel& i_parent, ::osl::Mutex& i_mutex );
45 virtual ~UndoManager();
46
47 // XInterface
48 virtual void SAL_CALL acquire( ) noexcept override;
49 virtual void SAL_CALL release( ) noexcept override;
50
51 // XComponent equivalents
52 void disposing();
53
54 // XUndoManager
55 virtual void SAL_CALL enterUndoContext( const OUString& i_title ) override;
56 virtual void SAL_CALL enterHiddenUndoContext( ) override;
57 virtual void SAL_CALL leaveUndoContext( ) override;
58 virtual void SAL_CALL addUndoAction( const css::uno::Reference< css::document::XUndoAction >& i_action ) override;
59 virtual void SAL_CALL undo( ) override;
60 virtual void SAL_CALL redo( ) override;
61 virtual sal_Bool SAL_CALL isUndoPossible( ) override;
62 virtual sal_Bool SAL_CALL isRedoPossible( ) override;
63 virtual OUString SAL_CALL getCurrentUndoActionTitle( ) override;
64 virtual OUString SAL_CALL getCurrentRedoActionTitle( ) override;
65 virtual css::uno::Sequence< OUString > SAL_CALL getAllUndoActionTitles( ) override;
66 virtual css::uno::Sequence< OUString > SAL_CALL getAllRedoActionTitles( ) override;
67 virtual void SAL_CALL clear( ) override;
68 virtual void SAL_CALL clearRedo( ) override;
69 virtual void SAL_CALL reset( ) override;
70 virtual void SAL_CALL addUndoManagerListener( const css::uno::Reference< css::document::XUndoManagerListener >& i_listener ) override;
71 virtual void SAL_CALL removeUndoManagerListener( const css::uno::Reference< css::document::XUndoManagerListener >& i_listener ) override;
72
73 // XLockable (base of XUndoManager)
74 virtual void SAL_CALL lock( ) override;
75 virtual void SAL_CALL unlock( ) override;
76 virtual sal_Bool SAL_CALL isLocked( ) override;
77
78 // XChild (base of XUndoManager)
79 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent( ) override;
80 virtual void SAL_CALL setParent( const css::uno::Reference< css::uno::XInterface >& Parent ) override;
81
82 // XModifyBroadcaster
83 virtual void SAL_CALL addModifyListener( const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
84 virtual void SAL_CALL removeModifyListener( const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
85
86 private:
87 std::unique_ptr< impl::UndoManager_Impl > m_pImpl;
88 };
89
90} // namespace chart
91
92/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL redo() override
virtual css::uno::Sequence< OUString > SAL_CALL getAllUndoActionTitles() override
virtual void SAL_CALL release() noexcept override
virtual void SAL_CALL addModifyListener(const css::uno::Reference< css::util::XModifyListener > &aListener) override
virtual void SAL_CALL removeModifyListener(const css::uno::Reference< css::util::XModifyListener > &aListener) override
virtual void SAL_CALL lock() override
virtual void SAL_CALL setParent(const css::uno::Reference< css::uno::XInterface > &Parent) override
virtual sal_Bool SAL_CALL isLocked() override
virtual void SAL_CALL unlock() override
virtual sal_Bool SAL_CALL isUndoPossible() override
virtual void SAL_CALL addUndoAction(const css::uno::Reference< css::document::XUndoAction > &i_action) override
virtual sal_Bool SAL_CALL isRedoPossible() override
virtual OUString SAL_CALL getCurrentUndoActionTitle() override
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent() override
virtual ~UndoManager()
virtual void SAL_CALL clearRedo() override
virtual void SAL_CALL addUndoManagerListener(const css::uno::Reference< css::document::XUndoManagerListener > &i_listener) override
virtual OUString SAL_CALL getCurrentRedoActionTitle() override
virtual void SAL_CALL enterHiddenUndoContext() override
virtual void SAL_CALL leaveUndoContext() override
virtual void SAL_CALL removeUndoManagerListener(const css::uno::Reference< css::document::XUndoManagerListener > &i_listener) override
virtual void SAL_CALL reset() override
virtual void SAL_CALL acquire() noexcept override
virtual void SAL_CALL enterUndoContext(const OUString &i_title) override
UndoManager(::chart::ChartModel &i_parent, ::osl::Mutex &i_mutex)
virtual void SAL_CALL clear() override
virtual void SAL_CALL undo() override
virtual css::uno::Sequence< OUString > SAL_CALL getAllRedoActionTitles() override
std::unique_ptr< impl::UndoManager_Impl > m_pImpl
Definition: UndoManager.hxx:87
::cppu::ImplHelper2< css::document::XUndoManager, css::util::XModifyBroadcaster > UndoManager_Base
Definition: UndoManager.hxx:35
unsigned char sal_Bool