bump product version to 5.0.4.1
[LibreOffice.git] / configmgr / source / rootaccess.hxx
blob4f80907a90dbb00c9915ba92a8f0d2ddb3bf4918
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"
40 #include "path.hxx"
42 namespace com { namespace sun { namespace star {
43 namespace uno {
44 class Any;
45 class Type;
47 namespace util { class XChangesListener; }
48 } } }
50 namespace configmgr {
52 class Broadcaster;
53 class Components;
54 class Node;
56 class RootAccess:
57 public Access, public com::sun::star::util::XChangesNotifier,
58 public com::sun::star::util::XChangesBatch
60 public:
61 RootAccess(
62 Components & components, OUString const & pathRepresenation,
63 OUString const & locale, bool update);
65 virtual Path getAbsolutePath() SAL_OVERRIDE;
67 virtual void initBroadcaster(
68 Modifications::Node const & modifications, Broadcaster * broadcaster) SAL_OVERRIDE;
70 virtual void SAL_CALL acquire() throw () SAL_OVERRIDE;
72 virtual void SAL_CALL release() throw () SAL_OVERRIDE;
74 OUString getAbsolutePathRepresentation();
76 OUString getLocale() const { return locale_;}
78 bool isUpdate() const { return update_;}
80 void setAlive(bool b);
82 virtual void SAL_CALL addChangesListener(
83 com::sun::star::uno::Reference< com::sun::star::util::XChangesListener >
84 const & aListener)
85 throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
87 virtual void SAL_CALL removeChangesListener(
88 com::sun::star::uno::Reference< com::sun::star::util::XChangesListener >
89 const & aListener)
90 throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
92 virtual void SAL_CALL commitChanges()
93 throw (
94 com::sun::star::lang::WrappedTargetException,
95 com::sun::star::uno::RuntimeException,
96 std::exception) SAL_OVERRIDE;
98 virtual sal_Bool SAL_CALL hasPendingChanges()
99 throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
101 virtual com::sun::star::util::ChangesSet SAL_CALL getPendingChanges()
102 throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
104 private:
105 virtual ~RootAccess();
107 virtual Path getRelativePath() SAL_OVERRIDE;
109 virtual OUString getRelativePathRepresentation() SAL_OVERRIDE;
111 virtual rtl::Reference< Node > getNode() SAL_OVERRIDE;
113 virtual bool isFinalized() SAL_OVERRIDE;
115 virtual OUString getNameInternal() SAL_OVERRIDE;
117 virtual rtl::Reference< RootAccess > getRootAccess() SAL_OVERRIDE;
119 virtual rtl::Reference< Access > getParentAccess() SAL_OVERRIDE;
121 virtual void addTypes(std::vector< com::sun::star::uno::Type > * types)
122 const SAL_OVERRIDE;
124 virtual void addSupportedServiceNames(
125 std::vector< OUString > * services) SAL_OVERRIDE;
127 virtual void initDisposeBroadcaster(Broadcaster * broadcaster) SAL_OVERRIDE;
129 virtual void clearListeners() throw () 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 virtual OUString SAL_CALL getImplementationName()
136 throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
138 typedef
139 std::multiset<
140 com::sun::star::uno::Reference<
141 com::sun::star::util::XChangesListener > >
142 ChangesListeners;
144 OUString pathRepresentation_;
145 OUString locale_;
146 Path path_;
147 rtl::Reference< Node > node_;
148 OUString name_;
149 ChangesListeners changesListeners_;
151 std::shared_ptr<osl::Mutex> lock_;
153 bool update_:1;
154 bool finalized_:1;
155 bool alive_:1;
160 #endif
162 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */