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>
40 namespace com
{ namespace sun
{ namespace star
{ namespace uno
{
54 public Access
, public com::sun::star::container::XChild
,
55 public com::sun::star::lang::XUnoTunnel
58 static com::sun::star::uno::Sequence
< sal_Int8
> getTunnelId();
61 Components
& components
, rtl::Reference
< RootAccess
> const & root
,
62 rtl::Reference
< Access
> const & parent
, OUString
const & name
,
63 rtl::Reference
< Node
> const & node
);
66 Components
& components
, rtl::Reference
< RootAccess
> const & root
,
67 rtl::Reference
< Node
> const & node
);
69 virtual Path
getAbsolutePath() SAL_OVERRIDE
;
70 virtual Path
getRelativePath() SAL_OVERRIDE
;
72 virtual OUString
getRelativePathRepresentation() SAL_OVERRIDE
;
73 virtual rtl::Reference
< Node
> getNode() SAL_OVERRIDE
;
75 virtual bool isFinalized() SAL_OVERRIDE
;
77 virtual OUString
getNameInternal() SAL_OVERRIDE
;
79 virtual rtl::Reference
< RootAccess
> getRootAccess() SAL_OVERRIDE
;
80 virtual rtl::Reference
< Access
> getParentAccess() SAL_OVERRIDE
;
82 virtual void SAL_CALL
acquire() throw () SAL_OVERRIDE
;
83 virtual void SAL_CALL
release() throw () SAL_OVERRIDE
;
85 virtual com::sun::star::uno::Reference
< com::sun::star::uno::XInterface
>
87 throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
89 virtual void SAL_CALL
setParent(
90 com::sun::star::uno::Reference
< com::sun::star::uno::XInterface
>
93 com::sun::star::lang::NoSupportException
,
94 com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
96 virtual sal_Int64 SAL_CALL
getSomething(
97 com::sun::star::uno::Sequence
< sal_Int8
> const & aIdentifier
)
98 throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
101 rtl::Reference
< RootAccess
> const & root
,
102 rtl::Reference
< Access
> const & parent
, OUString
const & name
)
105 void unbind() throw ();
107 bool isInTransaction() const { return inTransaction_
; }
109 void setNode(rtl::Reference
< Node
> const & node
);
112 com::sun::star::uno::Any
const & value
,
113 Modifications
* localModifications
);
115 css::uno::Any
asValue();
116 static bool asSimpleValue(const rtl::Reference
< Node
> &rNode
,
117 css::uno::Any
&value
,
118 Components
&components
);
120 void commitChanges(bool valid
, Modifications
* globalModifications
);
123 virtual ~ChildAccess();
125 virtual void addTypes(
126 std::vector
< com::sun::star::uno::Type
> * types
) const SAL_OVERRIDE
;
128 virtual void addSupportedServiceNames(
129 std::vector
< OUString
> * services
) SAL_OVERRIDE
;
131 virtual com::sun::star::uno::Any SAL_CALL
queryInterface(
132 com::sun::star::uno::Type
const & aType
)
133 throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
135 rtl::Reference
< RootAccess
> root_
;
136 rtl::Reference
< Access
> parent_
; // null if free node
138 rtl::Reference
< Node
> node_
;
139 std::unique_ptr
< com::sun::star::uno::Any
> changedValue_
;
141 // to determine if a free node can be inserted underneath some root
142 std::shared_ptr
<osl::Mutex
> lock_
;
149 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */