26 #include <com/sun/star/lang/DisposedException.hpp>
27 #include <com/sun/star/lang/EventObject.hpp>
28 #include <com/sun/star/uno/Any.hxx>
29 #include <com/sun/star/uno/Reference.hxx>
30 #include <com/sun/star/uno/RuntimeException.hpp>
31 #include <com/sun/star/uno/Type.hxx>
32 #include <com/sun/star/uno/XInterface.hpp>
33 #include <com/sun/star/util/ChangesEvent.hpp>
34 #include <com/sun/star/util/ChangesSet.hpp>
35 #include <com/sun/star/util/ElementChange.hpp>
36 #include <com/sun/star/util/XChangesBatch.hpp>
37 #include <com/sun/star/util/XChangesListener.hpp>
38 #include <com/sun/star/util/XChangesNotifier.hpp>
43 #include <osl/mutex.hxx>
44 #include <rtl/ref.hxx>
45 #include <rtl/ustring.hxx>
58 Components & components, OUString pathRepresentation,
59 OUString locale,
bool update):
60 Access(components), pathRepresentation_(
std::move(pathRepresentation)),
63 update_(update), finalized_(
false), alive_(true)
75 assert(broadcaster !=
nullptr);
76 std::vector< css::util::ElementChange > changes;
86 css::uno::Reference< css::uno::XInterface > xBase( pSource, css::uno::UNO_QUERY );
89 css::util::ChangesEvent(
90 pSource, css::uno::Any( xBase ), set));
113 css::uno::Reference< css::util::XChangesListener >
const & aListener)
117 osl::MutexGuard g(*
lock_);
119 if (!aListener.is()) {
120 throw css::uno::RuntimeException(
121 "null listener", static_cast< cppu::OWeakObject * >(
this));
129 aListener->disposing(
130 css::lang::EventObject(static_cast< cppu::OWeakObject * >(
this)));
131 }
catch (css::lang::DisposedException &) {}
135 css::uno::Reference< css::util::XChangesListener >
const & aListener)
138 osl::MutexGuard g(*
lock_);
155 osl::MutexGuard g(*
lock_);
174 osl::MutexGuard g(*
lock_);
177 std::vector< css::util::ElementChange > changes;
179 return !changes.empty();
185 osl::MutexGuard g(*
lock_);
187 std::vector< css::util::ElementChange > changes;
194 osl::MutexGuard g(*
lock_);
200 return std::vector<OUString>();
214 throw css::uno::RuntimeException(
224 if (!
path_.empty()) {
251 assert(types !=
nullptr);
257 std::vector<OUString> * services)
259 assert(services !=
nullptr);
260 services->push_back(
"com.sun.star.configuration.AccessRootElement");
262 services->push_back(
"com.sun.star.configuration.UpdateRootElement");
267 assert(broadcaster !=
nullptr);
272 css::lang::EventObject(static_cast< cppu::OWeakObject * >(
this)));
285 osl::MutexGuard g(*
lock_);
288 if (res.hasValue()) {
292 aType, static_cast< css::util::XChangesNotifier * >(
this));
293 if (res.hasValue()) {
296 if (!res.hasValue() &&
update_) {
298 aType, static_cast< css::util::XChangesBatch * >(
this));
306 osl::MutexGuard g(*
lock_);
308 return "configmgr.RootAccess";
virtual OUString SAL_CALL getImplementationName() override
void addChangesNotification(css::uno::Reference< css::util::XChangesListener > const &listener, css::util::ChangesEvent const &event)
std::vector< OUString > path_
rtl::Reference< Node > resolvePathRepresentation(OUString const &pathRepresentation, OUString *canonicRepresentation, std::vector< OUString > *path, int *finalizedLayer) const
Components & getComponents() const
OUString pathRepresentation_
virtual rtl::Reference< Node > getNode() override
virtual std::vector< OUString > getRelativePath() override
virtual void SAL_CALL acquire() SAL_NOEXCEPT SAL_OVERRIDE
virtual ~RootAccess() override
virtual void SAL_CALL addChangesListener(css::uno::Reference< css::util::XChangesListener > const &aListener) override
void addDisposeNotification(css::uno::Reference< css::lang::XEventListener > const &listener, css::lang::EventObject const &event)
virtual void SAL_CALL acquire() noexcept override
void commitChildChanges(bool valid, Modifications *globalModifications)
virtual css::uno::Sequence< ::css::util::ElementChange > SAL_CALL getPendingChanges() override
virtual void SAL_CALL release() noexcept override
virtual rtl::Reference< Access > getParentAccess() override
virtual std::vector< OUString > getAbsolutePath() override
void removeRootAccess(RootAccess *access)
void reportChildChanges(std::vector< css::util::ElementChange > *changes)
std::shared_ptr< osl::Mutex > lock_
virtual void initDisposeBroadcaster(Broadcaster *broadcaster) override
virtual bool isFinalized() override
rtl::Reference< Node > node_
void checkLocalizedPropertyAccess()
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &aType) override
void writeModifications()
virtual void initDisposeBroadcaster(Broadcaster *broadcaster)
ChangesListeners changesListeners_
void initBroadcasterAndChanges(Modifications::Node const &modifications, Broadcaster *broadcaster, std::vector< css::util::ElementChange > *changes)
virtual void clearListeners() noexcept
virtual OUString getRelativePathRepresentation() override
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
virtual void initBroadcaster(Modifications::Node const &modifications, Broadcaster *broadcaster) override
virtual void addTypes(std::vector< css::uno::Type > *types) const override
RootAccess(Components &components, OUString pathRepresentation, OUString locale, bool update)
virtual void clearListeners() noexcept override
virtual sal_Bool SAL_CALL hasPendingChanges() override
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &aType) override
virtual void SAL_CALL removeChangesListener(css::uno::Reference< css::util::XChangesListener > const &aListener) override
void initGlobalBroadcaster(Modifications const &modifications, rtl::Reference< RootAccess > const &exclude, Broadcaster *broadcaster)
virtual rtl::Reference< RootAccess > getRootAccess() override
virtual void SAL_CALL commitChanges() override
std::shared_ptr< osl::Mutex > lock_
virtual void SAL_CALL release() SAL_NOEXCEPT SAL_OVERRIDE
virtual const OUString & getNameInternal() override
OUString const & getAbsolutePathRepresentation()
virtual void addSupportedServiceNames(std::vector< OUString > *services) override
std::shared_ptr< osl::Mutex > const & lock()
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType, Interface1 *p1)
void set(css::uno::UnoInterfaceReference const &value)
bool m_bDetectedRangeSegmentation false