merged tag ooo/DEV300_m102
[LibreOffice.git] / configmgr / source / rootaccess.hxx
blob77d945cdbbedc1868002ffce998688068ba03b94
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef INCLUDED_CONFIGMGR_SOURCE_ROOTACCESS_HXX
29 #define INCLUDED_CONFIGMGR_SOURCE_ROOTACCESS_HXX
31 #include "sal/config.h"
33 #include <set>
34 #include <vector>
36 #include "com/sun/star/lang/WrappedTargetException.hpp"
37 #include "com/sun/star/uno/RuntimeException.hpp"
38 #include "com/sun/star/util/ChangesSet.hpp"
39 #include "com/sun/star/util/XChangesBatch.hpp"
40 #include "com/sun/star/util/XChangesNotifier.hpp"
41 #include "rtl/ref.hxx"
42 #include "rtl/ustring.hxx"
43 #include "sal/types.h"
45 #include "access.hxx"
46 #include "modifications.hxx"
47 #include "path.hxx"
49 namespace com { namespace sun { namespace star {
50 namespace uno {
51 class Any;
52 class Type;
54 namespace util { class XChangesListener; }
55 } } }
57 namespace configmgr {
59 class Broadcaster;
60 class Components;
61 class Node;
63 class RootAccess:
64 public Access, public com::sun::star::util::XChangesNotifier,
65 public com::sun::star::util::XChangesBatch
67 public:
68 RootAccess(
69 Components & components, rtl::OUString const & pathRepresenation,
70 rtl::OUString const & locale, bool update);
72 virtual Path getAbsolutePath();
74 virtual void initBroadcaster(
75 Modifications::Node const & modifications, Broadcaster * broadcaster);
77 virtual void SAL_CALL acquire() throw ();
79 virtual void SAL_CALL release() throw ();
81 rtl::OUString getAbsolutePathRepresentation();
83 rtl::OUString getLocale() const;
85 bool isUpdate() const;
87 private:
88 virtual ~RootAccess();
90 virtual Path getRelativePath();
92 virtual rtl::OUString getRelativePathRepresentation();
94 virtual rtl::Reference< Node > getNode();
96 virtual bool isFinalized();
98 virtual rtl::OUString getNameInternal();
100 virtual rtl::Reference< RootAccess > getRootAccess();
102 virtual rtl::Reference< Access > getParentAccess();
104 virtual void addTypes(std::vector< com::sun::star::uno::Type > * types)
105 const;
107 virtual void addSupportedServiceNames(
108 std::vector< rtl::OUString > * services);
110 virtual void initDisposeBroadcaster(Broadcaster * broadcaster);
112 virtual void clearListeners() throw ();
114 virtual com::sun::star::uno::Any SAL_CALL queryInterface(
115 com::sun::star::uno::Type const & aType)
116 throw (com::sun::star::uno::RuntimeException);
118 virtual void SAL_CALL addChangesListener(
119 com::sun::star::uno::Reference< com::sun::star::util::XChangesListener >
120 const & aListener)
121 throw (com::sun::star::uno::RuntimeException);
123 virtual void SAL_CALL removeChangesListener(
124 com::sun::star::uno::Reference< com::sun::star::util::XChangesListener >
125 const & aListener)
126 throw (com::sun::star::uno::RuntimeException);
128 virtual void SAL_CALL commitChanges()
129 throw (
130 com::sun::star::lang::WrappedTargetException,
131 com::sun::star::uno::RuntimeException);
133 virtual sal_Bool SAL_CALL hasPendingChanges()
134 throw (com::sun::star::uno::RuntimeException);
136 virtual com::sun::star::util::ChangesSet SAL_CALL getPendingChanges()
137 throw (com::sun::star::uno::RuntimeException);
139 typedef
140 std::multiset<
141 com::sun::star::uno::Reference<
142 com::sun::star::util::XChangesListener > >
143 ChangesListeners;
145 rtl::OUString pathRepresentation_;
146 rtl::OUString locale_;
147 bool update_;
148 Path path_;
149 rtl::Reference< Node > node_;
150 rtl::OUString name_;
151 bool finalized_;
152 ChangesListeners changesListeners_;
157 #endif