Version 6.4.0.3, tag libreoffice-6.4.0.3
[LibreOffice.git] / configmgr / source / broadcaster.hxx
blobe0a5fc4ce9625c8f3d2e84b03c2c318347d7146d
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 css::uno::Reference< css::lang::XEventListener > const & listener,
52 css::lang::EventObject const & event);
54 void addContainerElementInsertedNotification(
55 css::uno::Reference< css::container::XContainerListener > const & listener,
56 css::container::ContainerEvent const & event);
58 void addContainerElementRemovedNotification(
59 css::uno::Reference< css::container::XContainerListener > const & listener,
60 css::container::ContainerEvent const & event);
62 void addContainerElementReplacedNotification(
63 css::uno::Reference< css::container::XContainerListener > const & listener,
64 css::container::ContainerEvent const & event);
66 void addPropertyChangeNotification(
67 css::uno::Reference< css::beans::XPropertyChangeListener > const & listener,
68 css::beans::PropertyChangeEvent const & event);
70 void addPropertiesChangeNotification(
71 css::uno::Reference< css::beans::XPropertiesChangeListener > const & listener,
72 css::uno::Sequence< css::beans::PropertyChangeEvent > const & event);
74 void addChangesNotification(
75 css::uno::Reference< css::util::XChangesListener > const & listener,
76 css::util::ChangesEvent const & event);
78 void send();
80 private:
81 Broadcaster(const Broadcaster&) = delete;
82 Broadcaster& operator=(const Broadcaster&) = delete;
84 struct DisposeNotification {
85 css::uno::Reference< css::lang::XEventListener > listener;
86 css::lang::EventObject event;
88 DisposeNotification(
89 css::uno::Reference< css::lang::XEventListener > const & theListener,
90 css::lang::EventObject const & theEvent);
93 struct ContainerNotification {
94 css::uno::Reference< css::container::XContainerListener > listener;
95 css::container::ContainerEvent event;
97 ContainerNotification(
98 css::uno::Reference< css::container::XContainerListener > const & theListener,
99 css::container::ContainerEvent const & theEvent);
102 struct PropertyChangeNotification {
103 css::uno::Reference< css::beans::XPropertyChangeListener > listener;
104 css::beans::PropertyChangeEvent event;
106 PropertyChangeNotification(
107 css::uno::Reference< css::beans::XPropertyChangeListener > const & theListener,
108 css::beans::PropertyChangeEvent const & theEvent);
111 struct PropertiesChangeNotification {
112 css::uno::Reference< css::beans::XPropertiesChangeListener > listener;
113 css::uno::Sequence< css::beans::PropertyChangeEvent > event;
115 PropertiesChangeNotification(
116 css::uno::Reference< css::beans::XPropertiesChangeListener > const & theListener,
117 css::uno::Sequence< css::beans::PropertyChangeEvent > const & theEvent);
120 struct ChangesNotification {
121 css::uno::Reference< css::util::XChangesListener > listener;
122 css::util::ChangesEvent event;
124 ChangesNotification(
125 css::uno::Reference< css::util::XChangesListener > const & theListener,
126 css::util::ChangesEvent const & theEvent);
129 typedef std::vector< DisposeNotification > DisposeNotifications;
131 typedef std::vector< ContainerNotification > ContainerNotifications;
133 typedef std::vector< PropertyChangeNotification >
134 PropertyChangeNotifications;
136 typedef std::vector< PropertiesChangeNotification >
137 PropertiesChangeNotifications;
139 typedef std::vector< ChangesNotification > ChangesNotifications;
141 DisposeNotifications disposeNotifications_;
142 ContainerNotifications containerElementInsertedNotifications_;
143 ContainerNotifications containerElementRemovedNotifications_;
144 ContainerNotifications containerElementReplacedNotifications_;
145 PropertyChangeNotifications propertyChangeNotifications_;
146 PropertiesChangeNotifications propertiesChangeNotifications_;
147 ChangesNotifications changesNotifications_;
152 #endif
154 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */