LibreOffice Module dbaccess (master) 1
documenteventnotifier.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 * This file is part of the LibreOffice project.
5 *
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/.
9 *
10 * This file incorporates work covered by the following license notice:
11 *
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 .
19 */
20
21#pragma once
22
23#include <com/sun/star/document/XEventListener.hpp>
24#include <com/sun/star/document/XDocumentEventListener.hpp>
25
26#include <rtl/ref.hxx>
27
28namespace cppu
29{
30 class OWeakObject;
31}
32
33namespace dbaccess
34{
35
36 class DocumentEventNotifier_Impl;
37 // DocumentEventNotifier
39 {
40 public:
41 DocumentEventNotifier( ::cppu::OWeakObject& _rBroadcasterDocument, ::osl::Mutex& _rMutex );
43
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 );
48
53 void disposing();
54
63
72 const OUString& EventName,
73 const css::uno::Reference< css::frame::XController2 >& _rxViewController,
74 const css::uno::Any& Supplement
75 );
76
85 const OUString& EventName,
86 const css::uno::Reference< css::frame::XController2 >& ViewController,
87 const css::uno::Any& Supplement
88 );
89
98 const char* _pAsciiEventName,
99 const css::uno::Reference< css::frame::XController2 >& _rxViewController = nullptr,
100 const css::uno::Any& _rSupplement = css::uno::Any()
101 )
102 {
103 notifyDocumentEvent( OUString::createFromAscii( _pAsciiEventName ), _rxViewController, _rSupplement );
104 }
105
114 const char* _pAsciiEventName,
115 const css::uno::Reference< css::frame::XController2 >& _rxViewController = nullptr,
116 const css::uno::Any& _rSupplement = css::uno::Any()
117 )
118 {
119 notifyDocumentEventAsync( OUString::createFromAscii( _pAsciiEventName ), _rxViewController, _rSupplement );
120 }
121
122 private:
124 };
125
126} // namespace dbaccess
127
128/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void notifyDocumentEventAsync(const char *_pAsciiEventName, const css::uno::Reference< css::frame::XController2 > &_rxViewController=nullptr, const css::uno::Any &_rSupplement=css::uno::Any())
notifies a document event to all registered listeners, asynchronously
DocumentEventNotifier(::cppu::OWeakObject &_rBroadcasterDocument, ::osl::Mutex &_rMutex)
void addDocumentEventListener(const css::uno::Reference< css::document::XDocumentEventListener > &Listener)
void onDocumentInitialized()
tells the instance that its document is completely initialized now.
void disposing()
disposes the instance @precond the mutex is not locked
void addLegacyEventListener(const css::uno::Reference< css::document::XEventListener > &Listener)
void notifyDocumentEvent(const char *_pAsciiEventName, const css::uno::Reference< css::frame::XController2 > &_rxViewController=nullptr, const css::uno::Any &_rSupplement=css::uno::Any())
notifies a document event to all registered listeners
void notifyDocumentEvent(const OUString &EventName, const css::uno::Reference< css::frame::XController2 > &_rxViewController, const css::uno::Any &Supplement)
notifies a document event described by the given parameters
::rtl::Reference< DocumentEventNotifier_Impl > m_pImpl
void removeDocumentEventListener(const css::uno::Reference< css::document::XDocumentEventListener > &Listener)
void notifyDocumentEventAsync(const OUString &EventName, const css::uno::Reference< css::frame::XController2 > &ViewController, const css::uno::Any &Supplement)
notifies a document event, described by the given parameters, asynchronously
void removeLegacyEventListener(const css::uno::Reference< css::document::XEventListener > &Listener)