bump product version to 7.2.5.1
[LibreOffice.git] / configmgr / source / broadcaster.hxx
blob6c4943f5526ed359ce604765a6aeb5c0f178cc62
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 #pragma once
22 #include <sal/config.h>
24 #include <vector>
26 #include <com/sun/star/beans/PropertyChangeEvent.hpp>
27 #include <com/sun/star/container/ContainerEvent.hpp>
28 #include <com/sun/star/lang/EventObject.hpp>
29 #include <com/sun/star/uno/Reference.hxx>
30 #include <com/sun/star/uno/Sequence.hxx>
31 #include <com/sun/star/util/ChangesEvent.hpp>
33 namespace com::sun::star {
34 namespace beans {
35 class XPropertiesChangeListener;
36 class XPropertyChangeListener;
38 namespace container { class XContainerListener; }
39 namespace lang { class XEventListener; }
40 namespace util { class XChangesListener; }
43 namespace configmgr {
45 class Broadcaster {
46 public:
47 Broadcaster() {}
49 void addDisposeNotification(
50 css::uno::Reference< css::lang::XEventListener > const & listener,
51 css::lang::EventObject const & event);
53 void addContainerElementInsertedNotification(
54 css::uno::Reference< css::container::XContainerListener > const & listener,
55 css::container::ContainerEvent const & event);
57 void addContainerElementRemovedNotification(
58 css::uno::Reference< css::container::XContainerListener > const & listener,
59 css::container::ContainerEvent const & event);
61 void addContainerElementReplacedNotification(
62 css::uno::Reference< css::container::XContainerListener > const & listener,
63 css::container::ContainerEvent const & event);
65 void addPropertyChangeNotification(
66 css::uno::Reference< css::beans::XPropertyChangeListener > const & listener,
67 css::beans::PropertyChangeEvent const & event);
69 void addPropertiesChangeNotification(
70 css::uno::Reference< css::beans::XPropertiesChangeListener > const & listener,
71 css::uno::Sequence< css::beans::PropertyChangeEvent > const & event);
73 void addChangesNotification(
74 css::uno::Reference< css::util::XChangesListener > const & listener,
75 css::util::ChangesEvent const & event);
77 void send();
79 private:
80 Broadcaster(const Broadcaster&) = delete;
81 Broadcaster& operator=(const Broadcaster&) = delete;
83 struct DisposeNotification {
84 css::uno::Reference< css::lang::XEventListener > listener;
85 css::lang::EventObject event;
87 DisposeNotification(
88 css::uno::Reference< css::lang::XEventListener > const & theListener,
89 css::lang::EventObject const & theEvent);
92 struct ContainerNotification {
93 css::uno::Reference< css::container::XContainerListener > listener;
94 css::container::ContainerEvent event;
96 ContainerNotification(
97 css::uno::Reference< css::container::XContainerListener > const & theListener,
98 css::container::ContainerEvent const & theEvent);
101 struct PropertyChangeNotification {
102 css::uno::Reference< css::beans::XPropertyChangeListener > listener;
103 css::beans::PropertyChangeEvent event;
105 PropertyChangeNotification(
106 css::uno::Reference< css::beans::XPropertyChangeListener > const & theListener,
107 css::beans::PropertyChangeEvent const & theEvent);
110 struct PropertiesChangeNotification {
111 css::uno::Reference< css::beans::XPropertiesChangeListener > listener;
112 css::uno::Sequence< css::beans::PropertyChangeEvent > event;
114 PropertiesChangeNotification(
115 css::uno::Reference< css::beans::XPropertiesChangeListener > const & theListener,
116 css::uno::Sequence< css::beans::PropertyChangeEvent > const & theEvent);
119 struct ChangesNotification {
120 css::uno::Reference< css::util::XChangesListener > listener;
121 css::util::ChangesEvent event;
123 ChangesNotification(
124 css::uno::Reference< css::util::XChangesListener > const & theListener,
125 css::util::ChangesEvent const & theEvent);
128 std::vector< DisposeNotification > disposeNotifications_;
129 std::vector< ContainerNotification > containerElementInsertedNotifications_;
130 std::vector< ContainerNotification > containerElementRemovedNotifications_;
131 std::vector< ContainerNotification > containerElementReplacedNotifications_;
132 std::vector< PropertyChangeNotification > propertyChangeNotifications_;
133 std::vector< PropertiesChangeNotification > propertiesChangeNotifications_;
134 std::vector< ChangesNotification > changesNotifications_;
139 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */