24#include <com/sun/star/beans/XPropertiesChangeListener.hpp>
25#include <com/sun/star/beans/XPropertyChangeListener.hpp>
26#include <com/sun/star/container/XContainerListener.hpp>
27#include <com/sun/star/lang/DisposedException.hpp>
28#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
29#include <com/sun/star/lang/XEventListener.hpp>
30#include <com/sun/star/uno/Any.hxx>
31#include <com/sun/star/uno/Exception.hpp>
32#include <com/sun/star/uno/Reference.hxx>
33#include <com/sun/star/uno/XInterface.hpp>
34#include <com/sun/star/util/XChangesListener.hpp>
36#include <rtl/ustrbuf.hxx>
37#include <rtl/ustring.hxx>
47 OUStringBuffer & buffer, css::uno::Exception
const & exception)
50 buffer.append(exception.Message);
56 css::uno::Reference< css::lang::XEventListener >
const & listener,
57 css::lang::EventObject
const & event)
63 css::uno::Reference< css::container::XContainerListener >
const & listener,
64 css::container::ContainerEvent
const & event)
70 css::uno::Reference< css::container::XContainerListener >
const & listener,
71 css::container::ContainerEvent
const & event)
77 css::uno::Reference< css::container::XContainerListener >
const & listener,
78 css::container::ContainerEvent
const & event)
84 css::uno::Reference< css::beans::XPropertyChangeListener >
const & listener,
85 css::beans::PropertyChangeEvent
const & event)
91 css::uno::Reference< css::beans::XPropertiesChangeListener >
const &
93 css::uno::Sequence< css::beans::PropertyChangeEvent >
const & event)
99 css::uno::Reference< css::util::XChangesListener >
const & listener,
100 css::util::ChangesEvent
const & event,
bool bRootListener)
109 css::uno::Any exception;
110 OUStringBuffer messages;
113 rNotification.listener->disposing(rNotification.event);
114 }
catch (css::lang::DisposedException &) {
115 }
catch (css::uno::Exception & e) {
117 appendMessage(messages, e);
123 rNotification.listener->elementInserted(rNotification.event);
124 }
catch (css::lang::DisposedException &) {
125 }
catch (css::uno::Exception & e) {
127 appendMessage(messages, e);
133 rNotification.listener->elementRemoved(rNotification.event);
134 }
catch (css::lang::DisposedException &) {
135 }
catch (css::uno::Exception & e) {
137 appendMessage(messages, e);
143 rNotification.listener->elementReplaced(rNotification.event);
144 }
catch (css::lang::DisposedException &) {
145 }
catch (css::uno::Exception & e) {
147 appendMessage(messages, e);
153 rNotification.listener->propertyChange(rNotification.event);
154 }
catch (css::lang::DisposedException &) {
155 }
catch (css::uno::Exception & e) {
157 appendMessage(messages, e);
163 rNotification.listener->propertiesChange(rNotification.event);
164 }
catch (css::lang::DisposedException &) {
165 }
catch (css::uno::Exception & e) {
167 appendMessage(messages, e);
173 for (
auto& rNotification : container) {
175 rNotification.listener->changesOccurred(rNotification.event);
176 }
catch (css::lang::DisposedException &) {
177 }
catch (css::uno::Exception & e) {
179 appendMessage(messages, e);
183 if (exception.hasValue()) {
184 throw css::lang::WrappedTargetRuntimeException(
185 (
"configmgr exceptions during listener notification" +
187 css::uno::Reference< css::uno::XInterface >(),
193 css::uno::Reference< css::lang::XEventListener >
const & theListener,
194 css::lang::EventObject theEvent):
195 listener(theListener), event(
std::move(theEvent))
197 assert(theListener.is());
201 css::uno::Reference< css::container::XContainerListener >
const &
203 css::container::ContainerEvent theEvent):
204 listener(theListener), event(
std::move(theEvent))
206 assert(theListener.is());
210 css::uno::Reference< css::beans::XPropertyChangeListener >
const &
212 css::beans::PropertyChangeEvent theEvent):
213 listener(theListener), event(
std::move(theEvent))
215 assert(theListener.is());
219 css::uno::Reference< css::beans::XPropertiesChangeListener >
const &
221 css::uno::Sequence< css::beans::PropertyChangeEvent >
const & theEvent):
222 listener(theListener), event(theEvent)
224 assert(theListener.is());
228 css::uno::Reference< css::util::XChangesListener >
const & theListener,
229 css::util::ChangesEvent theEvent):
230 listener(theListener), event(
std::move(theEvent))
232 assert(theListener.is());
void addContainerElementRemovedNotification(css::uno::Reference< css::container::XContainerListener > const &listener, css::container::ContainerEvent const &event)
void addChangesNotification(css::uno::Reference< css::util::XChangesListener > const &listener, css::util::ChangesEvent const &event, bool bRootListener)
std::vector< ContainerNotification > containerElementRemovedNotifications_
std::vector< ChangesNotification > rootChangesNotifications_
std::vector< ChangesNotification > changesNotifications_
void addContainerElementReplacedNotification(css::uno::Reference< css::container::XContainerListener > const &listener, css::container::ContainerEvent const &event)
std::vector< ContainerNotification > containerElementReplacedNotifications_
void addContainerElementInsertedNotification(css::uno::Reference< css::container::XContainerListener > const &listener, css::container::ContainerEvent const &event)
std::vector< ContainerNotification > containerElementInsertedNotifications_
void addPropertyChangeNotification(css::uno::Reference< css::beans::XPropertyChangeListener > const &listener, css::beans::PropertyChangeEvent const &event)
std::vector< PropertiesChangeNotification > propertiesChangeNotifications_
void addDisposeNotification(css::uno::Reference< css::lang::XEventListener > const &listener, css::lang::EventObject const &event)
void addPropertiesChangeNotification(css::uno::Reference< css::beans::XPropertiesChangeListener > const &listener, css::uno::Sequence< css::beans::PropertyChangeEvent > const &event)
std::vector< PropertyChangeNotification > propertyChangeNotifications_
std::vector< DisposeNotification > disposeNotifications_
Any SAL_CALL getCaughtException()
ChangesNotification(css::uno::Reference< css::util::XChangesListener > const &theListener, css::util::ChangesEvent theEvent)
ContainerNotification(css::uno::Reference< css::container::XContainerListener > const &theListener, css::container::ContainerEvent theEvent)
DisposeNotification(css::uno::Reference< css::lang::XEventListener > const &theListener, css::lang::EventObject theEvent)
PropertiesChangeNotification(css::uno::Reference< css::beans::XPropertiesChangeListener > const &theListener, css::uno::Sequence< css::beans::PropertyChangeEvent > const &theEvent)
PropertyChangeNotification(css::uno::Reference< css::beans::XPropertyChangeListener > const &theListener, css::beans::PropertyChangeEvent theEvent)