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 .
20 #ifndef INCLUDED_CONFIGMGR_SOURCE_CHILDACCESS_HXX
21 #define INCLUDED_CONFIGMGR_SOURCE_CHILDACCESS_HXX
23 #include <sal/config.h>
28 #include <com/sun/star/container/XChild.hpp>
29 #include <com/sun/star/lang/NoSupportException.hpp>
30 #include <com/sun/star/lang/XUnoTunnel.hpp>
31 #include <com/sun/star/uno/Reference.hxx>
32 #include <com/sun/star/uno/RuntimeException.hpp>
33 #include <com/sun/star/uno/Sequence.hxx>
34 #include <rtl/ref.hxx>
35 #include <sal/types.h>
39 namespace com
{ namespace sun
{ namespace star
{ namespace uno
{
53 public Access
, public css::container::XChild
,
54 public css::lang::XUnoTunnel
57 static css::uno::Sequence
< sal_Int8
> const & getTunnelId();
60 Components
& components
, rtl::Reference
< RootAccess
> const & root
,
61 rtl::Reference
< Access
> const & parent
, OUString
const & name
,
62 rtl::Reference
< Node
> const & node
);
65 Components
& components
, rtl::Reference
< RootAccess
> const & root
,
66 rtl::Reference
< Node
> const & node
);
68 virtual std::vector
<OUString
> getAbsolutePath() override
;
69 virtual std::vector
<OUString
> getRelativePath() override
;
71 virtual OUString
getRelativePathRepresentation() override
;
72 virtual rtl::Reference
< Node
> getNode() override
;
74 virtual bool isFinalized() override
;
76 virtual OUString
getNameInternal() override
;
78 virtual rtl::Reference
< RootAccess
> getRootAccess() override
;
79 virtual rtl::Reference
< Access
> getParentAccess() override
;
81 virtual void SAL_CALL
acquire() throw () override
;
82 virtual void SAL_CALL
release() throw () override
;
84 virtual css::uno::Reference
< css::uno::XInterface
>
85 SAL_CALL
getParent() override
;
87 virtual void SAL_CALL
setParent(
88 css::uno::Reference
< css::uno::XInterface
> const &) override
;
90 virtual sal_Int64 SAL_CALL
getSomething(
91 css::uno::Sequence
< sal_Int8
> const & aIdentifier
) override
;
94 rtl::Reference
< RootAccess
> const & root
,
95 rtl::Reference
< Access
> const & parent
, OUString
const & name
)
98 void unbind() throw ();
100 bool isInTransaction() const { return inTransaction_
; }
102 void setNode(rtl::Reference
< Node
> const & node
);
105 css::uno::Any
const & value
,
106 Modifications
* localModifications
);
108 css::uno::Any
asValue();
109 static bool asSimpleValue(const rtl::Reference
< Node
> &rNode
,
110 css::uno::Any
&value
,
111 Components
&components
);
113 void commitChanges(bool valid
, Modifications
* globalModifications
);
116 virtual ~ChildAccess() override
;
118 virtual void addTypes(
119 std::vector
< css::uno::Type
> * types
) const override
;
121 virtual void addSupportedServiceNames(
122 std::vector
<OUString
> * services
) override
;
124 virtual css::uno::Any SAL_CALL
queryInterface(
125 css::uno::Type
const & aType
) override
;
127 rtl::Reference
< RootAccess
> root_
;
128 rtl::Reference
< Access
> parent_
; // null if free node
130 rtl::Reference
< Node
> node_
;
131 std::unique_ptr
< css::uno::Any
> changedValue_
;
133 // to determine if a free node can be inserted underneath some root
134 std::shared_ptr
<osl::Mutex
> lock_
;
141 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */