CppunitTest_sc_tiledrendering2: move to tiledrendering folder
[LibreOffice.git] / configmgr / source / rootaccess.hxx
bloba30975dd652dedc899fa6063d430050c61aa5c1a
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 #pragma once
22 #include <sal/config.h>
24 #include <set>
25 #include <vector>
27 #include <com/sun/star/util/XChangesBatch.hpp>
28 #include <com/sun/star/util/XChangesNotifier.hpp>
29 #include <rtl/ref.hxx>
30 #include <rtl/ustring.hxx>
31 #include <sal/types.h>
33 #include "access.hxx"
34 #include "modifications.hxx"
36 namespace com::sun::star {
37 namespace uno {
38 class Any;
39 class Type;
41 namespace util { class XChangesListener; }
44 namespace configmgr {
46 class Broadcaster;
47 class Components;
48 class Node;
50 class RootAccess:
51 public Access, public css::util::XChangesNotifier,
52 public css::util::XChangesBatch
54 public:
55 RootAccess(
56 Components & components, OUString pathRepresentation,
57 OUString locale, bool update);
59 virtual std::vector<OUString> getAbsolutePath() override;
61 virtual void initBroadcaster(
62 Modifications::Node const & modifications, Broadcaster * broadcaster) override;
64 virtual void SAL_CALL acquire() noexcept override;
66 virtual void SAL_CALL release() noexcept override;
68 OUString const & getAbsolutePathRepresentation();
70 const OUString& getLocale() const { return locale_;}
72 bool isUpdate() const { return update_;}
74 void setAlive(bool b);
76 virtual void SAL_CALL addChangesListener(
77 css::uno::Reference< css::util::XChangesListener >
78 const & aListener) override;
80 virtual void SAL_CALL removeChangesListener(
81 css::uno::Reference< css::util::XChangesListener >
82 const & aListener) override;
84 virtual void SAL_CALL commitChanges() override;
86 virtual sal_Bool SAL_CALL hasPendingChanges() override;
88 virtual css::uno::Sequence< ::css::util::ElementChange > SAL_CALL getPendingChanges() override;
90 private:
91 virtual ~RootAccess() override;
93 virtual std::vector<OUString> getRelativePath() override;
95 virtual OUString getRelativePathRepresentation() override;
97 virtual const rtl::Reference< Node > & getNode() override;
99 virtual bool isFinalized() override;
101 virtual const OUString & getNameInternal() override;
103 virtual rtl::Reference< RootAccess > getRootAccess() override;
105 virtual rtl::Reference< Access > getParentAccess() override;
107 virtual void addTypes(std::vector< css::uno::Type > * types)
108 const override;
110 virtual void addSupportedServiceNames(
111 std::vector<OUString> * services) override;
113 virtual void initDisposeBroadcaster(Broadcaster * broadcaster) override;
115 virtual void clearListeners() noexcept override;
117 virtual css::uno::Any SAL_CALL queryInterface(
118 css::uno::Type const & aType) override;
120 virtual OUString SAL_CALL getImplementationName() override;
122 typedef
123 std::multiset<
124 css::uno::Reference<
125 css::util::XChangesListener > >
126 ChangesListeners;
128 OUString pathRepresentation_;
129 OUString locale_;
130 std::vector<OUString> path_;
131 rtl::Reference< Node > node_;
132 OUString name_;
133 ChangesListeners changesListeners_;
135 std::shared_ptr<osl::Mutex> lock_;
137 bool update_:1;
138 bool finalized_:1;
139 bool alive_:1;
144 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */