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>
27 #include <com/sun/star/container/XChild.hpp>
28 #include <com/sun/star/lang/XUnoTunnel.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
,
51 public css::lang::XUnoTunnel
54 static css::uno::Sequence
< sal_Int8
> const & getTunnelId();
57 Components
& components
, rtl::Reference
< RootAccess
> const & root
,
58 rtl::Reference
< Access
> const & parent
, OUString
const & name
,
59 rtl::Reference
< Node
> const & node
);
62 Components
& components
, rtl::Reference
< RootAccess
> const & root
,
63 rtl::Reference
< Node
> const & node
);
65 virtual std::vector
<OUString
> getAbsolutePath() override
;
66 virtual std::vector
<OUString
> getRelativePath() override
;
68 virtual OUString
getRelativePathRepresentation() override
;
69 virtual rtl::Reference
< Node
> getNode() override
;
71 virtual bool isFinalized() override
;
73 virtual OUString
getNameInternal() override
;
75 virtual rtl::Reference
< RootAccess
> getRootAccess() override
;
76 virtual rtl::Reference
< Access
> getParentAccess() override
;
78 virtual void SAL_CALL
acquire() throw () override
;
79 virtual void SAL_CALL
release() throw () override
;
81 virtual css::uno::Reference
< css::uno::XInterface
>
82 SAL_CALL
getParent() override
;
84 virtual void SAL_CALL
setParent(
85 css::uno::Reference
< css::uno::XInterface
> const &) override
;
87 virtual sal_Int64 SAL_CALL
getSomething(
88 css::uno::Sequence
< sal_Int8
> const & aIdentifier
) override
;
91 rtl::Reference
< RootAccess
> const & root
,
92 rtl::Reference
< Access
> const & parent
, OUString
const & name
)
95 void unbind() throw ();
97 bool isInTransaction() const { return inTransaction_
; }
99 void setNode(rtl::Reference
< Node
> const & node
);
102 css::uno::Any
const & value
,
103 Modifications
* localModifications
);
105 css::uno::Any
asValue();
106 static bool asSimpleValue(const rtl::Reference
< Node
> &rNode
,
107 css::uno::Any
&value
,
108 Components
&components
);
110 void commitChanges(bool valid
, Modifications
* globalModifications
);
113 virtual ~ChildAccess() override
;
115 virtual void addTypes(
116 std::vector
< css::uno::Type
> * types
) const override
;
118 virtual void addSupportedServiceNames(
119 std::vector
<OUString
> * services
) override
;
121 virtual css::uno::Any SAL_CALL
queryInterface(
122 css::uno::Type
const & aType
) override
;
124 rtl::Reference
< RootAccess
> root_
;
125 rtl::Reference
< Access
> parent_
; // null if free node
127 rtl::Reference
< Node
> node_
;
128 std::unique_ptr
< css::uno::Any
> changedValue_
;
130 // to determine if a free node can be inserted underneath some root
131 std::shared_ptr
<osl::Mutex
> lock_
;
136 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */