bump product version to 6.3.0.0.beta1
[LibreOffice.git] / configmgr / source / rootaccess.hxx
blob389cc9ad62b1f13b2a8500970f552ecaa43c3c93
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_ROOTACCESS_HXX
21 #define INCLUDED_CONFIGMGR_SOURCE_ROOTACCESS_HXX
23 #include <sal/config.h>
25 #include <memory>
26 #include <set>
27 #include <vector>
29 #include <com/sun/star/lang/WrappedTargetException.hpp>
30 #include <com/sun/star/uno/RuntimeException.hpp>
31 #include <com/sun/star/util/ChangesSet.hpp>
32 #include <com/sun/star/util/XChangesBatch.hpp>
33 #include <com/sun/star/util/XChangesNotifier.hpp>
34 #include <rtl/ref.hxx>
35 #include <rtl/ustring.hxx>
36 #include <sal/types.h>
38 #include "access.hxx"
39 #include "modifications.hxx"
41 namespace com { namespace sun { namespace star {
42 namespace uno {
43 class Any;
44 class Type;
46 namespace util { class XChangesListener; }
47 } } }
49 namespace configmgr {
51 class Broadcaster;
52 class Components;
53 class Node;
55 class RootAccess:
56 public Access, public css::util::XChangesNotifier,
57 public css::util::XChangesBatch
59 public:
60 RootAccess(
61 Components & components, OUString const & pathRepresentation,
62 OUString const & locale, bool update);
64 virtual std::vector<OUString> getAbsolutePath() override;
66 virtual void initBroadcaster(
67 Modifications::Node const & modifications, Broadcaster * broadcaster) override;
69 virtual void SAL_CALL acquire() throw () override;
71 virtual void SAL_CALL release() throw () override;
73 OUString const & getAbsolutePathRepresentation();
75 const OUString& getLocale() const { return locale_;}
77 bool isUpdate() const { return update_;}
79 void setAlive(bool b);
81 virtual void SAL_CALL addChangesListener(
82 css::uno::Reference< css::util::XChangesListener >
83 const & aListener) override;
85 virtual void SAL_CALL removeChangesListener(
86 css::uno::Reference< css::util::XChangesListener >
87 const & aListener) override;
89 virtual void SAL_CALL commitChanges() override;
91 virtual sal_Bool SAL_CALL hasPendingChanges() override;
93 virtual css::uno::Sequence< ::css::util::ElementChange > SAL_CALL getPendingChanges() override;
95 private:
96 virtual ~RootAccess() override;
98 virtual std::vector<OUString> getRelativePath() override;
100 virtual OUString getRelativePathRepresentation() override;
102 virtual rtl::Reference< Node > getNode() override;
104 virtual bool isFinalized() override;
106 virtual OUString getNameInternal() override;
108 virtual rtl::Reference< RootAccess > getRootAccess() override;
110 virtual rtl::Reference< Access > getParentAccess() override;
112 virtual void addTypes(std::vector< css::uno::Type > * types)
113 const override;
115 virtual void addSupportedServiceNames(
116 std::vector<OUString> * services) override;
118 virtual void initDisposeBroadcaster(Broadcaster * broadcaster) override;
120 virtual void clearListeners() throw () override;
122 virtual css::uno::Any SAL_CALL queryInterface(
123 css::uno::Type const & aType) override;
125 virtual OUString SAL_CALL getImplementationName() override;
127 typedef
128 std::multiset<
129 css::uno::Reference<
130 css::util::XChangesListener > >
131 ChangesListeners;
133 OUString pathRepresentation_;
134 OUString locale_;
135 std::vector<OUString> path_;
136 rtl::Reference< Node > node_;
137 OUString name_;
138 ChangesListeners changesListeners_;
140 std::shared_ptr<osl::Mutex> lock_;
142 bool update_:1;
143 bool finalized_:1;
144 bool alive_:1;
149 #endif
151 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */