xref: /aoo41x/main/configmgr/source/rootaccess.hxx (revision a2faadff)
1*a2faadffSAndrew Rist /**************************************************************
2*a2faadffSAndrew Rist  *
3*a2faadffSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*a2faadffSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*a2faadffSAndrew Rist  * distributed with this work for additional information
6*a2faadffSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*a2faadffSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*a2faadffSAndrew Rist  * "License"); you may not use this file except in compliance
9*a2faadffSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*a2faadffSAndrew Rist  *
11*a2faadffSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*a2faadffSAndrew Rist  *
13*a2faadffSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*a2faadffSAndrew Rist  * software distributed under the License is distributed on an
15*a2faadffSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*a2faadffSAndrew Rist  * KIND, either express or implied.  See the License for the
17*a2faadffSAndrew Rist  * specific language governing permissions and limitations
18*a2faadffSAndrew Rist  * under the License.
19*a2faadffSAndrew Rist  *
20*a2faadffSAndrew Rist  *************************************************************/
21*a2faadffSAndrew Rist 
22*a2faadffSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef INCLUDED_CONFIGMGR_SOURCE_ROOTACCESS_HXX
25cdf0e10cSrcweir #define INCLUDED_CONFIGMGR_SOURCE_ROOTACCESS_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "sal/config.h"
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #include <set>
30cdf0e10cSrcweir #include <vector>
31cdf0e10cSrcweir 
32cdf0e10cSrcweir #include "com/sun/star/lang/WrappedTargetException.hpp"
33cdf0e10cSrcweir #include "com/sun/star/uno/RuntimeException.hpp"
34cdf0e10cSrcweir #include "com/sun/star/util/ChangesSet.hpp"
35cdf0e10cSrcweir #include "com/sun/star/util/XChangesBatch.hpp"
36cdf0e10cSrcweir #include "com/sun/star/util/XChangesNotifier.hpp"
37cdf0e10cSrcweir #include "rtl/ref.hxx"
38cdf0e10cSrcweir #include "rtl/ustring.hxx"
39cdf0e10cSrcweir #include "sal/types.h"
40cdf0e10cSrcweir 
41cdf0e10cSrcweir #include "access.hxx"
42cdf0e10cSrcweir #include "modifications.hxx"
43cdf0e10cSrcweir #include "path.hxx"
44cdf0e10cSrcweir 
45cdf0e10cSrcweir namespace com { namespace sun { namespace star {
46cdf0e10cSrcweir     namespace uno {
47cdf0e10cSrcweir         class Any;
48cdf0e10cSrcweir         class Type;
49cdf0e10cSrcweir     }
50cdf0e10cSrcweir     namespace util { class XChangesListener; }
51cdf0e10cSrcweir } } }
52cdf0e10cSrcweir 
53cdf0e10cSrcweir namespace configmgr {
54cdf0e10cSrcweir 
55cdf0e10cSrcweir class Broadcaster;
56cdf0e10cSrcweir class Components;
57cdf0e10cSrcweir class Node;
58cdf0e10cSrcweir 
59cdf0e10cSrcweir class RootAccess:
60cdf0e10cSrcweir     public Access, public com::sun::star::util::XChangesNotifier,
61cdf0e10cSrcweir     public com::sun::star::util::XChangesBatch
62cdf0e10cSrcweir {
63cdf0e10cSrcweir public:
64cdf0e10cSrcweir     RootAccess(
65cdf0e10cSrcweir         Components & components, rtl::OUString const & pathRepresenation,
66cdf0e10cSrcweir         rtl::OUString const & locale, bool update);
67cdf0e10cSrcweir 
68cdf0e10cSrcweir     virtual Path getAbsolutePath();
69cdf0e10cSrcweir 
70cdf0e10cSrcweir     virtual void initBroadcaster(
71cdf0e10cSrcweir         Modifications::Node const & modifications, Broadcaster * broadcaster);
72cdf0e10cSrcweir 
73cdf0e10cSrcweir     virtual void SAL_CALL acquire() throw ();
74cdf0e10cSrcweir 
75cdf0e10cSrcweir     virtual void SAL_CALL release() throw ();
76cdf0e10cSrcweir 
77cdf0e10cSrcweir     rtl::OUString getAbsolutePathRepresentation();
78cdf0e10cSrcweir 
79cdf0e10cSrcweir     rtl::OUString getLocale() const;
80cdf0e10cSrcweir 
81cdf0e10cSrcweir     bool isUpdate() const;
82cdf0e10cSrcweir 
83cdf0e10cSrcweir private:
84cdf0e10cSrcweir     virtual ~RootAccess();
85cdf0e10cSrcweir 
86cdf0e10cSrcweir     virtual Path getRelativePath();
87cdf0e10cSrcweir 
88cdf0e10cSrcweir     virtual rtl::OUString getRelativePathRepresentation();
89cdf0e10cSrcweir 
90cdf0e10cSrcweir     virtual rtl::Reference< Node > getNode();
91cdf0e10cSrcweir 
92cdf0e10cSrcweir     virtual bool isFinalized();
93cdf0e10cSrcweir 
94cdf0e10cSrcweir     virtual rtl::OUString getNameInternal();
95cdf0e10cSrcweir 
96cdf0e10cSrcweir     virtual rtl::Reference< RootAccess > getRootAccess();
97cdf0e10cSrcweir 
98cdf0e10cSrcweir     virtual rtl::Reference< Access > getParentAccess();
99cdf0e10cSrcweir 
100cdf0e10cSrcweir     virtual void addTypes(std::vector< com::sun::star::uno::Type > * types)
101cdf0e10cSrcweir         const;
102cdf0e10cSrcweir 
103cdf0e10cSrcweir     virtual void addSupportedServiceNames(
104cdf0e10cSrcweir         std::vector< rtl::OUString > * services);
105cdf0e10cSrcweir 
106cdf0e10cSrcweir     virtual void initDisposeBroadcaster(Broadcaster * broadcaster);
107cdf0e10cSrcweir 
108cdf0e10cSrcweir     virtual void clearListeners() throw ();
109cdf0e10cSrcweir 
110cdf0e10cSrcweir     virtual com::sun::star::uno::Any SAL_CALL queryInterface(
111cdf0e10cSrcweir         com::sun::star::uno::Type const & aType)
112cdf0e10cSrcweir         throw (com::sun::star::uno::RuntimeException);
113cdf0e10cSrcweir 
114cdf0e10cSrcweir     virtual void SAL_CALL addChangesListener(
115cdf0e10cSrcweir         com::sun::star::uno::Reference< com::sun::star::util::XChangesListener >
116cdf0e10cSrcweir             const & aListener)
117cdf0e10cSrcweir         throw (com::sun::star::uno::RuntimeException);
118cdf0e10cSrcweir 
119cdf0e10cSrcweir     virtual void SAL_CALL removeChangesListener(
120cdf0e10cSrcweir         com::sun::star::uno::Reference< com::sun::star::util::XChangesListener >
121cdf0e10cSrcweir             const & aListener)
122cdf0e10cSrcweir         throw (com::sun::star::uno::RuntimeException);
123cdf0e10cSrcweir 
124cdf0e10cSrcweir     virtual void SAL_CALL commitChanges()
125cdf0e10cSrcweir         throw (
126cdf0e10cSrcweir             com::sun::star::lang::WrappedTargetException,
127cdf0e10cSrcweir             com::sun::star::uno::RuntimeException);
128cdf0e10cSrcweir 
129cdf0e10cSrcweir     virtual sal_Bool SAL_CALL hasPendingChanges()
130cdf0e10cSrcweir         throw (com::sun::star::uno::RuntimeException);
131cdf0e10cSrcweir 
132cdf0e10cSrcweir     virtual com::sun::star::util::ChangesSet SAL_CALL getPendingChanges()
133cdf0e10cSrcweir         throw (com::sun::star::uno::RuntimeException);
134cdf0e10cSrcweir 
135cdf0e10cSrcweir     typedef
136cdf0e10cSrcweir         std::multiset<
137cdf0e10cSrcweir             com::sun::star::uno::Reference<
138cdf0e10cSrcweir                 com::sun::star::util::XChangesListener > >
139cdf0e10cSrcweir         ChangesListeners;
140cdf0e10cSrcweir 
141cdf0e10cSrcweir     rtl::OUString pathRepresentation_;
142cdf0e10cSrcweir     rtl::OUString locale_;
143cdf0e10cSrcweir     bool update_;
144cdf0e10cSrcweir     Path path_;
145cdf0e10cSrcweir     rtl::Reference< Node > node_;
146cdf0e10cSrcweir     rtl::OUString name_;
147cdf0e10cSrcweir     bool finalized_;
148cdf0e10cSrcweir     ChangesListeners changesListeners_;
149cdf0e10cSrcweir };
150cdf0e10cSrcweir 
151cdf0e10cSrcweir }
152cdf0e10cSrcweir 
153cdf0e10cSrcweir #endif
154