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 .
22 #include <sal/config.h>
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>
34 #include "modifications.hxx"
36 namespace com::sun::star
{
41 namespace util
{ class XChangesListener
; }
51 public Access
, public css::util::XChangesNotifier
,
52 public css::util::XChangesBatch
56 Components
& components
, OUString
const & pathRepresentation
,
57 OUString
const & 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
;
91 virtual ~RootAccess() override
;
93 virtual std::vector
<OUString
> getRelativePath() override
;
95 virtual OUString
getRelativePathRepresentation() override
;
97 virtual rtl::Reference
< Node
> getNode() override
;
99 virtual bool isFinalized() override
;
101 virtual 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
)
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
;
125 css::util::XChangesListener
> >
128 OUString pathRepresentation_
;
130 std::vector
<OUString
> path_
;
131 rtl::Reference
< Node
> node_
;
133 ChangesListeners changesListeners_
;
135 std::shared_ptr
<osl::Mutex
> lock_
;
144 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */