bump product version to 5.0.4.1
[LibreOffice.git] / configmgr / source / broadcaster.hxx
blob46b7f64ee934b41ec10ba13904635b00dedcc959
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_CONFIGMGR_SOURCE_BROADCASTER_HXX
21 #define INCLUDED_CONFIGMGR_SOURCE_BROADCASTER_HXX
23 #include <sal/config.h>
25 #include <vector>
27 #include <com/sun/star/beans/PropertyChangeEvent.hpp>
28 #include <com/sun/star/container/ContainerEvent.hpp>
29 #include <com/sun/star/lang/EventObject.hpp>
30 #include <com/sun/star/uno/Reference.hxx>
31 #include <com/sun/star/uno/Sequence.hxx>
32 #include <com/sun/star/util/ChangesEvent.hpp>
34 namespace com { namespace sun { namespace star {
35 namespace beans {
36 class XPropertiesChangeListener;
37 class XPropertyChangeListener;
39 namespace container { class XContainerListener; }
40 namespace lang { class XEventListener; }
41 namespace util { class XChangesListener; }
42 } } }
44 namespace configmgr {
46 class Broadcaster {
47 public:
48 Broadcaster() {}
50 void addDisposeNotification(
51 com::sun::star::uno::Reference< com::sun::star::lang::XEventListener >
52 const & listener,
53 com::sun::star::lang::EventObject const & event);
55 void addContainerElementInsertedNotification(
56 com::sun::star::uno::Reference<
57 com::sun::star::container::XContainerListener > const & listener,
58 com::sun::star::container::ContainerEvent const & event);
60 void addContainerElementRemovedNotification(
61 com::sun::star::uno::Reference<
62 com::sun::star::container::XContainerListener > const & listener,
63 com::sun::star::container::ContainerEvent const & event);
65 void addContainerElementReplacedNotification(
66 com::sun::star::uno::Reference<
67 com::sun::star::container::XContainerListener > const & listener,
68 com::sun::star::container::ContainerEvent const & event);
70 void addPropertyChangeNotification(
71 com::sun::star::uno::Reference<
72 com::sun::star::beans::XPropertyChangeListener > const & listener,
73 com::sun::star::beans::PropertyChangeEvent const & event);
75 void addPropertiesChangeNotification(
76 com::sun::star::uno::Reference<
77 com::sun::star::beans::XPropertiesChangeListener > const & listener,
78 com::sun::star::uno::Sequence<
79 com::sun::star::beans::PropertyChangeEvent > const & event);
81 void addChangesNotification(
82 com::sun::star::uno::Reference< com::sun::star::util::XChangesListener >
83 const & listener,
84 com::sun::star::util::ChangesEvent const & event);
86 void send();
88 private:
89 Broadcaster(const Broadcaster&) SAL_DELETED_FUNCTION;
90 Broadcaster& operator=(const Broadcaster&) SAL_DELETED_FUNCTION;
92 struct DisposeNotification {
93 com::sun::star::uno::Reference< com::sun::star::lang::XEventListener >
94 listener;
95 com::sun::star::lang::EventObject event;
97 DisposeNotification(
98 com::sun::star::uno::Reference<
99 com::sun::star::lang::XEventListener > const & theListener,
100 com::sun::star::lang::EventObject const & theEvent);
103 struct ContainerNotification {
104 com::sun::star::uno::Reference<
105 com::sun::star::container::XContainerListener > listener;
106 com::sun::star::container::ContainerEvent event;
108 ContainerNotification(
109 com::sun::star::uno::Reference<
110 com::sun::star::container::XContainerListener > const &
111 theListener,
112 com::sun::star::container::ContainerEvent const & theEvent);
115 struct PropertyChangeNotification {
116 com::sun::star::uno::Reference<
117 com::sun::star::beans::XPropertyChangeListener > listener;
118 com::sun::star::beans::PropertyChangeEvent event;
120 PropertyChangeNotification(
121 com::sun::star::uno::Reference<
122 com::sun::star::beans::XPropertyChangeListener > const &
123 theListener,
124 com::sun::star::beans::PropertyChangeEvent const & theEvent);
127 struct PropertiesChangeNotification {
128 com::sun::star::uno::Reference<
129 com::sun::star::beans::XPropertiesChangeListener > listener;
130 com::sun::star::uno::Sequence<
131 com::sun::star::beans::PropertyChangeEvent > event;
133 PropertiesChangeNotification(
134 com::sun::star::uno::Reference<
135 com::sun::star::beans::XPropertiesChangeListener > const &
136 theListener,
137 com::sun::star::uno::Sequence<
138 com::sun::star::beans::PropertyChangeEvent > const & theEvent);
141 struct ChangesNotification {
142 com::sun::star::uno::Reference< com::sun::star::util::XChangesListener >
143 listener;
144 com::sun::star::util::ChangesEvent event;
146 ChangesNotification(
147 com::sun::star::uno::Reference<
148 com::sun::star::util::XChangesListener > const & theListener,
149 com::sun::star::util::ChangesEvent const & theEvent);
152 typedef std::vector< DisposeNotification > DisposeNotifications;
154 typedef std::vector< ContainerNotification > ContainerNotifications;
156 typedef std::vector< PropertyChangeNotification >
157 PropertyChangeNotifications;
159 typedef std::vector< PropertiesChangeNotification >
160 PropertiesChangeNotifications;
162 typedef std::vector< ChangesNotification > ChangesNotifications;
164 DisposeNotifications disposeNotifications_;
165 ContainerNotifications containerElementInsertedNotifications_;
166 ContainerNotifications containerElementRemovedNotifications_;
167 ContainerNotifications containerElementReplacedNotifications_;
168 PropertyChangeNotifications propertyChangeNotifications_;
169 PropertiesChangeNotifications propertiesChangeNotifications_;
170 ChangesNotifications changesNotifications_;
175 #endif
177 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */