LibreOffice Module dbaccess (master) 1
dbaundomanager.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#ifndef INCLUDED_DBACCESS_DBAUNDOMANAGER_HXX
21#define INCLUDED_DBACCESS_DBAUNDOMANAGER_HXX
22
23#include <memory>
24
25#include <com/sun/star/document/XUndoManager.hpp>
26#include <com/sun/star/uno/Reference.hxx>
27#include <com/sun/star/uno/Sequence.hxx>
30#include <rtl/ustring.hxx>
31#include <sal/types.h>
32
33namespace com::sun::star {
34 namespace document { class XUndoAction; }
35 namespace document { class XUndoManagerListener; }
36 namespace uno { class XInterface; }
37}
38
39namespace cppu {
40 class OWeakObject;
41}
42
43namespace osl {
44 class Mutex;
45}
46
47class SfxUndoManager;
48
49
50namespace dbaui
51{
52
53
54 //= UndoManager
55
56 struct UndoManager_Impl;
57 typedef ::cppu::ImplHelper1< css::document::XUndoManager > UndoManager_Base;
59 {
60 public:
61 UndoManager( ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex );
62 virtual ~UndoManager();
63
64 SfxUndoManager& GetSfxUndoManager() const;
65
66 // XInterface
67 virtual void SAL_CALL acquire( ) noexcept override;
68 virtual void SAL_CALL release( ) noexcept override;
69
70 // XComponent equivalents
71 void disposing();
72
73 // XUndoManager
74 virtual void SAL_CALL enterUndoContext( const OUString& i_title ) override;
75 virtual void SAL_CALL enterHiddenUndoContext( ) override;
76 virtual void SAL_CALL leaveUndoContext( ) override;
77 virtual void SAL_CALL addUndoAction( const css::uno::Reference< css::document::XUndoAction >& i_action ) override;
78 virtual void SAL_CALL undo( ) override;
79 virtual void SAL_CALL redo( ) override;
80 virtual sal_Bool SAL_CALL isUndoPossible( ) override;
81 virtual sal_Bool SAL_CALL isRedoPossible( ) override;
82 virtual OUString SAL_CALL getCurrentUndoActionTitle( ) override;
83 virtual OUString SAL_CALL getCurrentRedoActionTitle( ) override;
84 virtual css::uno::Sequence< OUString > SAL_CALL getAllUndoActionTitles( ) override;
85 virtual css::uno::Sequence< OUString > SAL_CALL getAllRedoActionTitles( ) override;
86 virtual void SAL_CALL clear( ) override;
87 virtual void SAL_CALL clearRedo( ) override;
88 virtual void SAL_CALL reset( ) override;
89 virtual void SAL_CALL addUndoManagerListener( const css::uno::Reference< css::document::XUndoManagerListener >& i_listener ) override;
90 virtual void SAL_CALL removeUndoManagerListener( const css::uno::Reference< css::document::XUndoManagerListener >& i_listener ) override;
91
92 // XLockable (base of XUndoManager)
93 virtual void SAL_CALL lock( ) override;
94 virtual void SAL_CALL unlock( ) override;
95 virtual sal_Bool SAL_CALL isLocked( ) override;
96
97 // XChild (base of XUndoManager)
98 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent( ) override;
99 virtual void SAL_CALL setParent( const css::uno::Reference< css::uno::XInterface >& Parent ) override;
100
101 private:
102 std::unique_ptr< UndoManager_Impl > m_xImpl;
103 };
104
105
106} // namespace dbaui
107
108
109#endif // INCLUDED_DBACCESS_DBAUNDOMANAGER_HXX
110
111/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL addUndoManagerListener(const css::uno::Reference< css::document::XUndoManagerListener > &i_listener) override
virtual void SAL_CALL setParent(const css::uno::Reference< css::uno::XInterface > &Parent) override
virtual void SAL_CALL addUndoAction(const css::uno::Reference< css::document::XUndoAction > &i_action) override
virtual void SAL_CALL removeUndoManagerListener(const css::uno::Reference< css::document::XUndoManagerListener > &i_listener) override
std::unique_ptr< UndoManager_Impl > m_xImpl
#define DBACCESS_DLLPUBLIC
std::shared_ptr< osl::Mutex > const & lock()
::cppu::ImplHelper1< css::document::XUndoManager > UndoManager_Base
unsigned char sal_Bool