1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 #include <sal/config.h>
28 #include <com/sun/star/container/XChild.hpp>
29 #include <com/sun/star/uno/Reference.hxx>
30 #include <com/sun/star/uno/Sequence.hxx>
31 #include <rtl/ref.hxx>
32 #include <sal/types.h>
36 namespace com::sun::star::uno
{
50 public Access
, public css::container::XChild
55 Components
& components
, rtl::Reference
< RootAccess
> const & root
,
56 rtl::Reference
< Access
> const & parent
, OUString name
,
57 rtl::Reference
< Node
> const & node
);
60 Components
& components
, rtl::Reference
< RootAccess
> const & root
,
61 rtl::Reference
< Node
> const & node
);
63 virtual std::vector
<OUString
> getAbsolutePath() override
;
64 virtual std::vector
<OUString
> getRelativePath() override
;
66 virtual OUString
getRelativePathRepresentation() override
;
67 virtual const rtl::Reference
< Node
> & getNode() override
;
69 virtual bool isFinalized() override
;
71 virtual const OUString
& getNameInternal() override
;
73 virtual rtl::Reference
< RootAccess
> getRootAccess() override
;
74 virtual rtl::Reference
< Access
> getParentAccess() override
;
76 virtual void SAL_CALL
acquire() noexcept override
;
77 virtual void SAL_CALL
release() noexcept override
;
79 virtual css::uno::Reference
< css::uno::XInterface
>
80 SAL_CALL
getParent() override
;
82 virtual void SAL_CALL
setParent(
83 css::uno::Reference
< css::uno::XInterface
> const &) override
;
86 rtl::Reference
< RootAccess
> const & root
,
87 rtl::Reference
< Access
> const & parent
, OUString
const & name
)
90 void unbind() noexcept
;
92 bool isInTransaction() const { return inTransaction_
; }
94 void setNode(rtl::Reference
< Node
> const & node
);
97 css::uno::Any
const & value
,
98 Modifications
* localModifications
);
100 css::uno::Any
asValue();
101 static bool asSimpleValue(const rtl::Reference
< Node
> &rNode
,
102 css::uno::Any
&value
,
103 Components
&components
);
105 void commitChanges(bool valid
, Modifications
* globalModifications
);
108 virtual ~ChildAccess() override
;
110 virtual void addTypes(
111 std::vector
< css::uno::Type
> * types
) const override
;
113 virtual void addSupportedServiceNames(
114 std::vector
<OUString
> * services
) override
;
116 virtual css::uno::Any SAL_CALL
queryInterface(
117 css::uno::Type
const & aType
) override
;
119 rtl::Reference
< RootAccess
> root_
;
120 rtl::Reference
< Access
> parent_
; // null if free node
122 rtl::Reference
< Node
> node_
;
123 std::optional
< css::uno::Any
> changedValue_
;
125 // to determine if a free node can be inserted underneath some root
126 std::shared_ptr
<osl::Mutex
> lock_
;
131 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */