1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
4 * This file is part of the LibreOffice project.
6 * This Source Code Form is subject to the terms of the Mozilla Public
7 * License, v. 2.0. If a copy of the MPL was not distributed with this
8 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 * This file incorporates work covered by the following license notice:
12 * Licensed to the Apache Software Foundation (ASF) under one or more
13 * contributor license agreements. See the NOTICE file distributed
14 * with this work for additional information regarding copyright
15 * ownership. The ASF licenses this file to you under the Apache
16 * License, Version 2.0 (the "License"); you may not use this file
17 * except in compliance with the License. You may obtain a copy of
18 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
23 #include <com/sun/star/document/XEventListener.hpp>
24 #include <com/sun/star/document/XDocumentEventListener.hpp>
26 #include <rtl/ref.hxx>
36 class DocumentEventNotifier_Impl
;
37 // DocumentEventNotifier
38 class DocumentEventNotifier
41 DocumentEventNotifier( ::cppu::OWeakObject
& _rBroadcasterDocument
, ::osl::Mutex
& _rMutex
);
42 ~DocumentEventNotifier();
44 void addLegacyEventListener( const css::uno::Reference
< css::document::XEventListener
>& Listener
);
45 void removeLegacyEventListener( const css::uno::Reference
< css::document::XEventListener
>& Listener
);
46 void addDocumentEventListener( const css::uno::Reference
< css::document::XDocumentEventListener
>& Listener
);
47 void removeDocumentEventListener( const css::uno::Reference
< css::document::XDocumentEventListener
>& Listener
);
49 /** disposes the instance
51 the mutex is not locked
55 /** tells the instance that its document is completely initialized now.
57 Before you call this method, no notification will actually happen
62 void onDocumentInitialized();
64 /** notifies a document event described by the given parameters
67 the mutex is not locked
69 ->onDocumentInitialized has been called
71 void notifyDocumentEvent(
72 const OUString
& EventName
,
73 const css::uno::Reference
< css::frame::XController2
>& _rxViewController
,
74 const css::uno::Any
& Supplement
77 /** notifies a document event, described by the given parameters, asynchronously
79 Note that no event is actually notified before you called ->onDocumentInitialized.
84 void notifyDocumentEventAsync(
85 const OUString
& EventName
,
86 const css::uno::Reference
< css::frame::XController2
>& ViewController
,
87 const css::uno::Any
& Supplement
91 ::rtl::Reference
< DocumentEventNotifier_Impl
> m_pImpl
;
94 } // namespace dbaccess
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */