bump product version to 5.0.4.1
[LibreOffice.git] / configmgr / source / childaccess.hxx
blob2838bbd86c93964ae871c99f20cdb3e3751d4968
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
25 #include <memory>
26 #include <vector>
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>
37 #include "access.hxx"
38 #include "path.hxx"
40 namespace com { namespace sun { namespace star { namespace uno {
41 class Any;
42 class Type;
43 class XInterface;
44 } } } }
46 namespace configmgr {
48 class Components;
49 class Modifications;
50 class Node;
51 class RootAccess;
53 class ChildAccess:
54 public Access, public com::sun::star::container::XChild,
55 public com::sun::star::lang::XUnoTunnel
57 public:
58 static com::sun::star::uno::Sequence< sal_Int8 > getTunnelId();
60 ChildAccess(
61 Components & components, rtl::Reference< RootAccess > const & root,
62 rtl::Reference< Access > const & parent, OUString const & name,
63 rtl::Reference< Node > const & node);
65 ChildAccess(
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 >
86 SAL_CALL getParent()
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 >
91 const &)
92 throw (
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;
100 void bind(
101 rtl::Reference< RootAccess > const & root,
102 rtl::Reference< Access > const & parent, OUString const & name)
103 throw ();
105 void unbind() throw ();
107 bool isInTransaction() const { return inTransaction_; }
108 void committed();
109 void setNode(rtl::Reference< Node > const & node);
111 void setProperty(
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);
122 private:
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
137 OUString name_;
138 rtl::Reference< Node > node_;
139 std::unique_ptr< com::sun::star::uno::Any > changedValue_;
140 bool inTransaction_;
141 // to determine if a free node can be inserted underneath some root
142 std::shared_ptr<osl::Mutex> lock_;
147 #endif
149 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */