1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 * This file incorporates work covered by the following license notice:
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 .
22 #include <com/sun/star/document/XUndoManager.hpp>
23 #include <com/sun/star/util/XModifyBroadcaster.hpp>
25 #include <cppuhelper/implbase2.hxx>
35 class UndoManager_Impl
;
36 typedef ::cppu::ImplHelper2
< css::document::XUndoManager
37 , css::util::XModifyBroadcaster
41 class UndoManager
: public impl::UndoManager_Base
44 UndoManager( ::chart::ChartModel
& i_parent
, ::osl::Mutex
& i_mutex
);
45 virtual ~UndoManager();
48 virtual void SAL_CALL
acquire( ) noexcept override
;
49 virtual void SAL_CALL
release( ) noexcept override
;
51 // XComponent equivalents
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
;
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
;
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
;
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
;
87 std::unique_ptr
< impl::UndoManager_Impl
> m_pImpl
;
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */