LibreOffice Module configmgr (master) 1
rootaccess.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <sal/config.h>
23
24#include <set>
25#include <vector>
26
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>
32
33#include "access.hxx"
34#include "modifications.hxx"
35
36namespace com::sun::star {
37 namespace uno {
38 class Any;
39 class Type;
40 }
41 namespace util { class XChangesListener; }
42}
43
44namespace configmgr {
45
46class Broadcaster;
47class Components;
48class Node;
49
51 public Access, public css::util::XChangesNotifier,
52 public css::util::XChangesBatch
53{
54public:
56 Components & components, OUString pathRepresentation,
57 OUString locale, bool update);
58
59 virtual std::vector<OUString> getAbsolutePath() override;
60
61 virtual void initBroadcaster(
62 Modifications::Node const & modifications, Broadcaster * broadcaster) override;
63
64 virtual void SAL_CALL acquire() noexcept override;
65
66 virtual void SAL_CALL release() noexcept override;
67
68 OUString const & getAbsolutePathRepresentation();
69
70 const OUString& getLocale() const { return locale_;}
71
72 bool isUpdate() const { return update_;}
73
74 void setAlive(bool b);
75
76 virtual void SAL_CALL addChangesListener(
77 css::uno::Reference< css::util::XChangesListener >
78 const & aListener) override;
79
80 virtual void SAL_CALL removeChangesListener(
81 css::uno::Reference< css::util::XChangesListener >
82 const & aListener) override;
83
84 virtual void SAL_CALL commitChanges() override;
85
86 virtual sal_Bool SAL_CALL hasPendingChanges() override;
87
88 virtual css::uno::Sequence< ::css::util::ElementChange > SAL_CALL getPendingChanges() override;
89
90private:
91 virtual ~RootAccess() override;
92
93 virtual std::vector<OUString> getRelativePath() override;
94
95 virtual OUString getRelativePathRepresentation() override;
96
97 virtual rtl::Reference< Node > getNode() override;
98
99 virtual bool isFinalized() override;
100
101 virtual const OUString & getNameInternal() override;
102
104
105 virtual rtl::Reference< Access > getParentAccess() override;
106
107 virtual void addTypes(std::vector< css::uno::Type > * types)
108 const override;
109
110 virtual void addSupportedServiceNames(
111 std::vector<OUString> * services) override;
112
113 virtual void initDisposeBroadcaster(Broadcaster * broadcaster) override;
114
115 virtual void clearListeners() noexcept override;
116
117 virtual css::uno::Any SAL_CALL queryInterface(
118 css::uno::Type const & aType) override;
119
120 virtual OUString SAL_CALL getImplementationName() override;
121
122 typedef
123 std::multiset<
124 css::uno::Reference<
125 css::util::XChangesListener > >
127
129 OUString locale_;
130 std::vector<OUString> path_;
131 rtl::Reference< Node > node_;
132 OUString name_;
134
135 std::shared_ptr<osl::Mutex> lock_;
136
137 bool update_:1;
139 bool alive_:1;
140};
141
142}
143
144/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OUString pathRepresentation_
Definition: rootaccess.hxx:128
rtl::Reference< Node > node_
Definition: rootaccess.hxx:131
virtual void SAL_CALL commitChanges() override
Definition: rootaccess.cxx:146
OUString const & getAbsolutePathRepresentation()
Definition: rootaccess.cxx:102
virtual void SAL_CALL removeChangesListener(css::uno::Reference< css::util::XChangesListener > const &aListener) override
Definition: rootaccess.cxx:134
virtual ~RootAccess() override
Definition: rootaccess.cxx:192
bool isUpdate() const
Definition: rootaccess.hxx:72
virtual std::vector< OUString > getRelativePath() override
Definition: rootaccess.cxx:199
virtual const OUString & getNameInternal() override
Definition: rootaccess.cxx:237
std::vector< OUString > path_
Definition: rootaccess.hxx:130
virtual void SAL_CALL acquire() noexcept override
Definition: rootaccess.cxx:94
void setAlive(bool b)
Definition: rootaccess.cxx:108
virtual void SAL_CALL addChangesListener(css::uno::Reference< css::util::XChangesListener > const &aListener) override
Definition: rootaccess.cxx:112
virtual rtl::Reference< Access > getParentAccess() override
Definition: rootaccess.cxx:246
virtual OUString SAL_CALL getImplementationName() override
Definition: rootaccess.cxx:303
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &aType) override
Definition: rootaccess.cxx:282
std::shared_ptr< osl::Mutex > lock_
Definition: rootaccess.hxx:135
virtual std::vector< OUString > getAbsolutePath() override
Definition: rootaccess.cxx:67
virtual void addSupportedServiceNames(std::vector< OUString > *services) override
Definition: rootaccess.cxx:256
virtual void clearListeners() noexcept override
Definition: rootaccess.cxx:277
virtual rtl::Reference< RootAccess > getRootAccess() override
Definition: rootaccess.cxx:242
const OUString & getLocale() const
Definition: rootaccess.hxx:70
virtual OUString getRelativePathRepresentation() override
Definition: rootaccess.cxx:203
virtual void addTypes(std::vector< css::uno::Type > *types) const override
Definition: rootaccess.cxx:250
virtual rtl::Reference< Node > getNode() override
Definition: rootaccess.cxx:207
virtual void initDisposeBroadcaster(Broadcaster *broadcaster) override
Definition: rootaccess.cxx:266
ChangesListeners changesListeners_
Definition: rootaccess.hxx:133
std::multiset< css::uno::Reference< css::util::XChangesListener > > ChangesListeners
Definition: rootaccess.hxx:126
virtual bool isFinalized() override
Definition: rootaccess.cxx:232
virtual void initBroadcaster(Modifications::Node const &modifications, Broadcaster *broadcaster) override
Definition: rootaccess.cxx:72
virtual sal_Bool SAL_CALL hasPendingChanges() override
Definition: rootaccess.cxx:172
virtual void SAL_CALL release() noexcept override
Definition: rootaccess.cxx:98
virtual css::uno::Sequence< ::css::util::ElementChange > SAL_CALL getPendingChanges() override
Definition: rootaccess.cxx:182
RootAccess(Components &components, OUString pathRepresentation, OUString locale, bool update)
Definition: rootaccess.cxx:57
unsigned char sal_Bool
bool update()
std::vector< uno::Reference< sheet::XSpreadsheetDocument > > Components