26#include <com/sun/star/container/XChild.hpp>
27#include <com/sun/star/lang/NoSupportException.hpp>
28#include <com/sun/star/lang/XUnoTunnel.hpp>
29#include <com/sun/star/uno/Any.hxx>
30#include <com/sun/star/uno/Reference.hxx>
31#include <com/sun/star/uno/Sequence.hxx>
32#include <com/sun/star/uno/Type.hxx>
33#include <com/sun/star/uno/XInterface.hpp>
38#include <osl/mutex.hxx>
40#include <rtl/ustrbuf.hxx>
41#include <rtl/ustring.hxx>
64 inTransaction_(false),
67 assert(root.is() && parent.is() && node.is());
73 Access(components),
root_(root), node_(node), inTransaction_(false),
76 assert(root.is() && node.is());
82 std::vector<OUString> path(parent->getAbsolutePath());
83 path.push_back(
name_);
88 std::vector<OUString> path;
91 path = parent->getRelativePath();
93 path.push_back(
name_);
98 OUStringBuffer path(128);
101 path.append(parent->getRelativePathRepresentation());
102 if (!path.isEmpty()) {
107 return path.makeStringAndClear();
142 osl::MutexGuard g(*
lock_);
144 return cppu::getXWeak(
parent_.get());
150 osl::MutexGuard g(*
lock_);
152 throw css::lang::NoSupportException(
153 "setParent", getXWeak());
161 assert(!parent_.is() && root.is() && parent.is() && !
name.isEmpty());
183 css::uno::Any
const & value,
Modifications * localModifications)
185 assert(localModifications !=
nullptr);
187 bool isNillable =
false;
188 switch (
node_->kind()) {
202 child->setProperty(
value, localModifications);
205 locale,
value, localModifications);
245 return child.is() ? child->asValue() : css::uno::Any();
248 value <<= css::uno::Reference(getXWeak());
255 css::uno::Any &value,
258 switch (rNode->kind()) {
272 assert(globalModifications !=
nullptr);
278 globalModifications->
add(path);
279 switch (
node_->kind()) {
297 osl::MutexGuard g(*
lock_);
304 assert(types !=
nullptr);
310 std::vector<OUString> * services)
312 assert(services !=
nullptr);
315 ? OUString(
"com.sun.star.configuration.GroupElement")
316 : OUString(
"com.sun.star.configuration.SetElement"));
322 osl::MutexGuard g(*
lock_);
325 return res.hasValue()
328 aType,
static_cast< css::container::XChild *
>(
this));
void commitChildChanges(bool valid, Modifications *globalModifications)
Components & getComponents() const
void checkValue(css::uno::Any const &value, Type type, bool nillable)
rtl::Reference< Node > getParentNode()
void insertLocalizedValueChild(OUString const &name, css::uno::Any const &value, Modifications *localModifications)
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &aType) override
rtl::Reference< ChildAccess > getChild(OUString const &name)
void checkLocalizedPropertyAccess()
virtual std::vector< OUString > getRelativePath() override
void setProperty(css::uno::Any const &value, Modifications *localModifications)
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent() override
virtual void addTypes(std::vector< css::uno::Type > *types) const override
virtual void SAL_CALL setParent(css::uno::Reference< css::uno::XInterface > const &) override
rtl::Reference< Access > parent_
rtl::Reference< RootAccess > root_
virtual ~ChildAccess() override
virtual rtl::Reference< Node > getNode() override
void bind(rtl::Reference< RootAccess > const &root, rtl::Reference< Access > const &parent, OUString const &name) noexcept
virtual OUString getRelativePathRepresentation() override
virtual rtl::Reference< RootAccess > getRootAccess() override
virtual std::vector< OUString > getAbsolutePath() override
virtual void SAL_CALL release() noexcept override
void commitChanges(bool valid, Modifications *globalModifications)
std::shared_ptr< osl::Mutex > lock_
virtual void SAL_CALL acquire() noexcept override
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &aType) override
ChildAccess(Components &components, rtl::Reference< RootAccess > const &root, rtl::Reference< Access > const &parent, OUString name, rtl::Reference< Node > const &node)
virtual const OUString & getNameInternal() override
std::optional< css::uno::Any > changedValue_
virtual void addSupportedServiceNames(std::vector< OUString > *services) override
static bool asSimpleValue(const rtl::Reference< Node > &rNode, css::uno::Any &value, Components &components)
Can we quickly extract a simple value into value ? if so returns true.
virtual rtl::Reference< Access > getParentAccess() override
rtl::Reference< Node > node_
void setNode(rtl::Reference< Node > const &node)
virtual bool isFinalized() override
static bool allLocales(std::u16string_view locale)
void addModification(std::vector< OUString > const &path)
Type getStaticType() const
void add(std::vector< OUString > const &path)
@ KIND_LOCALIZED_PROPERTY
Type getStaticType() const
virtual void SAL_CALL acquire() SAL_NOEXCEPT SAL_OVERRIDE
virtual void SAL_CALL release() SAL_NOEXCEPT SAL_OVERRIDE
std::shared_ptr< osl::Mutex > lock_
const LanguageTag & getLocale()
std::shared_ptr< osl::Mutex > const & lock()
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType, Interface1 *p1)
css::beans::Optional< css::uno::Any > getValue(std::u16string_view id)
rtl::Reference< RootAccess > root_
RegError REGISTRY_CALLTYPE setValue(RegKeyHandle hKey, rtl_uString *keyName, RegValueType valueType, RegValue pData, sal_uInt32 valueSize)
static OUString createSegment(std::u16string_view templateName, OUString const &name)