Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / dbaccess / dbaundomanager.hxx
blob421a01ec28ab526480c67069c89c1f594605f5c5
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 * 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 .
20 #ifndef INCLUDED_DBACCESS_DBAUNDOMANAGER_HXX
21 #define INCLUDED_DBACCESS_DBAUNDOMANAGER_HXX
23 #include <exception>
24 #include <memory>
26 #include <com/sun/star/document/EmptyUndoStackException.hpp>
27 #include <com/sun/star/document/UndoContextNotClosedException.hpp>
28 #include <com/sun/star/document/UndoFailedException.hpp>
29 #include <com/sun/star/document/XUndoManager.hpp>
30 #include <com/sun/star/lang/IllegalArgumentException.hpp>
31 #include <com/sun/star/lang/NoSupportException.hpp>
32 #include <com/sun/star/uno/Reference.hxx>
33 #include <com/sun/star/uno/RuntimeException.hpp>
34 #include <com/sun/star/uno/Sequence.hxx>
35 #include <com/sun/star/util/InvalidStateException.hpp>
36 #include <com/sun/star/util/NotLockedException.hpp>
37 #include <cppuhelper/implbase1.hxx>
38 #include <dbaccess/dbaccessdllapi.h>
39 #include <rtl/ustring.hxx>
40 #include <sal/types.h>
42 namespace com { namespace sun { namespace star {
43 namespace document { class XUndoAction; }
44 namespace document { class XUndoManagerListener; }
45 namespace uno { class XInterface; }
46 } } }
48 namespace cppu {
49 class OWeakObject;
52 namespace osl {
53 class Mutex;
56 class SfxUndoManager;
59 namespace dbaui
63 //= UndoManager
65 struct UndoManager_Impl;
66 typedef ::cppu::ImplHelper1< css::document::XUndoManager > UndoManager_Base;
67 class DBACCESS_DLLPUBLIC UndoManager : public UndoManager_Base
69 public:
70 UndoManager( ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex );
71 virtual ~UndoManager();
73 SfxUndoManager& GetSfxUndoManager() const;
75 // XInterface
76 virtual void SAL_CALL acquire( ) throw () override;
77 virtual void SAL_CALL release( ) throw () override;
79 // XComponent equivalents
80 void disposing();
82 // XUndoManager
83 virtual void SAL_CALL enterUndoContext( const OUString& i_title ) override;
84 virtual void SAL_CALL enterHiddenUndoContext( ) override;
85 virtual void SAL_CALL leaveUndoContext( ) override;
86 virtual void SAL_CALL addUndoAction( const css::uno::Reference< css::document::XUndoAction >& i_action ) override;
87 virtual void SAL_CALL undo( ) override;
88 virtual void SAL_CALL redo( ) override;
89 virtual sal_Bool SAL_CALL isUndoPossible( ) override;
90 virtual sal_Bool SAL_CALL isRedoPossible( ) override;
91 virtual OUString SAL_CALL getCurrentUndoActionTitle( ) override;
92 virtual OUString SAL_CALL getCurrentRedoActionTitle( ) override;
93 virtual css::uno::Sequence< OUString > SAL_CALL getAllUndoActionTitles( ) override;
94 virtual css::uno::Sequence< OUString > SAL_CALL getAllRedoActionTitles( ) override;
95 virtual void SAL_CALL clear( ) override;
96 virtual void SAL_CALL clearRedo( ) override;
97 virtual void SAL_CALL reset( ) override;
98 virtual void SAL_CALL addUndoManagerListener( const css::uno::Reference< css::document::XUndoManagerListener >& i_listener ) override;
99 virtual void SAL_CALL removeUndoManagerListener( const css::uno::Reference< css::document::XUndoManagerListener >& i_listener ) override;
101 // XLockable (base of XUndoManager)
102 virtual void SAL_CALL lock( ) override;
103 virtual void SAL_CALL unlock( ) override;
104 virtual sal_Bool SAL_CALL isLocked( ) override;
106 // XChild (base of XUndoManager)
107 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent( ) override;
108 virtual void SAL_CALL setParent( const css::uno::Reference< css::uno::XInterface >& Parent ) override;
110 private:
111 std::unique_ptr< UndoManager_Impl > m_xImpl;
115 } // namespace dbaui
118 #endif // INCLUDED_DBACCESS_DBAUNDOMANAGER_HXX
120 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */