1f8e07b45SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3f8e07b45SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4f8e07b45SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5f8e07b45SAndrew Rist  * distributed with this work for additional information
6f8e07b45SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7f8e07b45SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8f8e07b45SAndrew Rist  * "License"); you may not use this file except in compliance
9f8e07b45SAndrew Rist  * with the License.  You may obtain a copy of the License at
10f8e07b45SAndrew Rist  *
11f8e07b45SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12f8e07b45SAndrew Rist  *
13f8e07b45SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14f8e07b45SAndrew Rist  * software distributed under the License is distributed on an
15f8e07b45SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16f8e07b45SAndrew Rist  * KIND, either express or implied.  See the License for the
17f8e07b45SAndrew Rist  * specific language governing permissions and limitations
18f8e07b45SAndrew Rist  * under the License.
19f8e07b45SAndrew Rist  *
20f8e07b45SAndrew Rist  *************************************************************/
21f8e07b45SAndrew Rist 
22f8e07b45SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef __FRAMEWORK_ACCELERATORS_ACCELERATORCONFIGURATION_HXX_
25cdf0e10cSrcweir #define __FRAMEWORK_ACCELERATORS_ACCELERATORCONFIGURATION_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir //__________________________________________
28cdf0e10cSrcweir // own includes
29cdf0e10cSrcweir 
30cdf0e10cSrcweir #include <accelerators/istoragelistener.hxx>
31cdf0e10cSrcweir #include <accelerators/presethandler.hxx>
32cdf0e10cSrcweir #include <accelerators/acceleratorcache.hxx>
33cdf0e10cSrcweir #include <accelerators/keymapping.hxx>
34cdf0e10cSrcweir #include <macros/xinterface.hxx>
35cdf0e10cSrcweir #include <macros/xtypeprovider.hxx>
36cdf0e10cSrcweir #include <threadhelp/threadhelpbase.hxx>
37cdf0e10cSrcweir #include <general.h>
38cdf0e10cSrcweir #include <stdtypes.h>
39cdf0e10cSrcweir 
40cdf0e10cSrcweir //__________________________________________
41cdf0e10cSrcweir // interface includes
42cdf0e10cSrcweir 
43cdf0e10cSrcweir #include <com/sun/star/container/XNameAccess.hpp>
44cdf0e10cSrcweir #include <com/sun/star/lang/XTypeProvider.hpp>
45cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp>
46cdf0e10cSrcweir #include <com/sun/star/ui/XAcceleratorConfiguration.hpp>
47cdf0e10cSrcweir #include <com/sun/star/ui/XUIConfiguration.hpp>
48cdf0e10cSrcweir #include <com/sun/star/ui/XUIConfigurationPersistence.hpp>
49cdf0e10cSrcweir 
50cdf0e10cSrcweir #include <com/sun/star/ui/XUIConfigurationStorage.hpp>
51cdf0e10cSrcweir #include <com/sun/star/io/XStream.hpp>
52cdf0e10cSrcweir #include <com/sun/star/io/XInputStream.hpp>
53cdf0e10cSrcweir #include <com/sun/star/io/XOutputStream.hpp>
54cdf0e10cSrcweir #include <com/sun/star/util/XChangesListener.hpp>
55cdf0e10cSrcweir 
56cdf0e10cSrcweir // TODO use XPresetHandler interface instead if available
57cdf0e10cSrcweir #include <com/sun/star/form/XReset.hpp>
58cdf0e10cSrcweir 
59cdf0e10cSrcweir //__________________________________________
60cdf0e10cSrcweir // other includes
61cdf0e10cSrcweir #include <cppuhelper/propshlp.hxx>
62cdf0e10cSrcweir #include <cppuhelper/weak.hxx>
63cdf0e10cSrcweir #include <comphelper/locale.hxx>
64cdf0e10cSrcweir #include <salhelper/singletonref.hxx>
65cdf0e10cSrcweir 
66cdf0e10cSrcweir //__________________________________________
67cdf0e10cSrcweir // definition
68cdf0e10cSrcweir 
69cdf0e10cSrcweir namespace framework
70cdf0e10cSrcweir {
71cdf0e10cSrcweir //-----------------------------------------------
72cdf0e10cSrcweir // Accelerators.xcu
73cdf0e10cSrcweir 
74cdf0e10cSrcweir static const ::rtl::OUString CFG_ENTRY_PRIMARY	    = ::rtl::OUString::createFromAscii("PrimaryKeys");
75cdf0e10cSrcweir static const ::rtl::OUString CFG_ENTRY_SECONDARY	= ::rtl::OUString::createFromAscii("SecondaryKeys");
76cdf0e10cSrcweir 
77cdf0e10cSrcweir static const ::rtl::OUString CFG_ENTRY_GLOBAL	    = ::rtl::OUString::createFromAscii("Global");
78cdf0e10cSrcweir static const ::rtl::OUString CFG_ENTRY_MODULES      = ::rtl::OUString::createFromAscii("Modules");
79cdf0e10cSrcweir 
80cdf0e10cSrcweir static const ::rtl::OUString CFG_PROP_COMMAND       = ::rtl::OUString::createFromAscii("Command");
81cdf0e10cSrcweir 
82cdf0e10cSrcweir /** "global" type to make accelerator presets unique, so they can be used
83cdf0e10cSrcweir     in combination with the salhelper::SingletonRef mechanism! */
84cdf0e10cSrcweir typedef PresetHandler AcceleratorPresets;
85cdf0e10cSrcweir 
86cdf0e10cSrcweir //__________________________________________
87cdf0e10cSrcweir /**
88cdf0e10cSrcweir     implements a read/write access to the accelerator configuration.
89cdf0e10cSrcweir  */
9007a3d7f1SPedro Giffuni class XMLBasedAcceleratorConfiguration : protected ThreadHelpBase                       // attention! Must be the first base class to guarantee right initialize lock ...
91cdf0e10cSrcweir 									   , public    IStorageListener
92cdf0e10cSrcweir 									   , public    ::cppu::OWeakObject
93cdf0e10cSrcweir 									   , public    css::lang::XTypeProvider
94cdf0e10cSrcweir 									   , public    css::form::XReset                    // TODO use XPresetHandler instead if available
95cdf0e10cSrcweir 									   , public    css::ui::XAcceleratorConfiguration  // => css::ui::XUIConfigurationPersistence
96cdf0e10cSrcweir 																					   //    css::ui::XUIConfigurationStorage
97cdf0e10cSrcweir 																				       //    css::ui::XUIConfiguration
98cdf0e10cSrcweir {
99cdf0e10cSrcweir 	//______________________________________
100cdf0e10cSrcweir 	// member
101cdf0e10cSrcweir 
102cdf0e10cSrcweir 	protected:
103cdf0e10cSrcweir 
104cdf0e10cSrcweir 		//---------------------------------------
105cdf0e10cSrcweir 		/** the global uno service manager.
106cdf0e10cSrcweir 		Must be used to create own needed services. */
107cdf0e10cSrcweir 		css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
108cdf0e10cSrcweir 
109cdf0e10cSrcweir 		//---------------------------------------
110cdf0e10cSrcweir 		/** used to:
111cdf0e10cSrcweir 		i  ) copy configuration files from the share to the user layer
112cdf0e10cSrcweir 		ii ) provide access to these config files
113cdf0e10cSrcweir 		iii) cache all sub storages on the path from the top to the bottom(!)
114cdf0e10cSrcweir 		iv ) provide commit for changes. */
115cdf0e10cSrcweir 		PresetHandler m_aPresetHandler;
116cdf0e10cSrcweir 
117cdf0e10cSrcweir 		//---------------------------------------
118cdf0e10cSrcweir 		/** contains the cached configuration data */
119cdf0e10cSrcweir 		AcceleratorCache m_aReadCache;
120cdf0e10cSrcweir 
121cdf0e10cSrcweir 		//---------------------------------------
122cdf0e10cSrcweir 		/** used to implement the copy on write pattern! */
123cdf0e10cSrcweir 		AcceleratorCache* m_pWriteCache;
124cdf0e10cSrcweir 
125cdf0e10cSrcweir 		//______________________________________
126cdf0e10cSrcweir 		// native interface!
127cdf0e10cSrcweir 
128cdf0e10cSrcweir 	public:
129cdf0e10cSrcweir 
130cdf0e10cSrcweir 		XMLBasedAcceleratorConfiguration( const css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR );
131cdf0e10cSrcweir 		virtual ~XMLBasedAcceleratorConfiguration(                                                                    );
132cdf0e10cSrcweir 
133cdf0e10cSrcweir 		//______________________________________
134cdf0e10cSrcweir 		// uno interface!
135cdf0e10cSrcweir 
136cdf0e10cSrcweir 	public:
137cdf0e10cSrcweir 
138cdf0e10cSrcweir 		// XInterface, XTypeProvider
139cdf0e10cSrcweir 		FWK_DECLARE_XINTERFACE
140cdf0e10cSrcweir 		FWK_DECLARE_XTYPEPROVIDER
141cdf0e10cSrcweir 
142cdf0e10cSrcweir 		// XAcceleratorConfiguration
143cdf0e10cSrcweir 		virtual css::uno::Sequence< css::awt::KeyEvent > SAL_CALL getAllKeyEvents()
144cdf0e10cSrcweir 			throw(css::uno::RuntimeException);
145cdf0e10cSrcweir 
146cdf0e10cSrcweir 		virtual ::rtl::OUString SAL_CALL getCommandByKeyEvent(const css::awt::KeyEvent& aKeyEvent)
147cdf0e10cSrcweir 			throw(css::container::NoSuchElementException,
148cdf0e10cSrcweir 			css::uno::RuntimeException            );
149cdf0e10cSrcweir 
150cdf0e10cSrcweir 		virtual void SAL_CALL setKeyEvent(const css::awt::KeyEvent& aKeyEvent,
151cdf0e10cSrcweir 			const ::rtl::OUString&    sCommand )
152cdf0e10cSrcweir 			throw(css::lang::IllegalArgumentException,
153cdf0e10cSrcweir 			css::uno::RuntimeException         );
154cdf0e10cSrcweir 
155cdf0e10cSrcweir 		virtual void SAL_CALL removeKeyEvent(const css::awt::KeyEvent& aKeyEvent)
156cdf0e10cSrcweir 			throw(css::container::NoSuchElementException,
157cdf0e10cSrcweir 			css::uno::RuntimeException            );
158cdf0e10cSrcweir 
159cdf0e10cSrcweir 		virtual css::uno::Sequence< css::awt::KeyEvent > SAL_CALL getKeyEventsByCommand(const ::rtl::OUString& sCommand)
160cdf0e10cSrcweir 			throw(css::lang::IllegalArgumentException   ,
161cdf0e10cSrcweir 			css::container::NoSuchElementException,
162cdf0e10cSrcweir 			css::uno::RuntimeException            );
163cdf0e10cSrcweir 
164cdf0e10cSrcweir 		virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPreferredKeyEventsForCommandList(const css::uno::Sequence< ::rtl::OUString >& lCommandList)
165cdf0e10cSrcweir 			throw(css::lang::IllegalArgumentException   ,
166cdf0e10cSrcweir 			css::uno::RuntimeException            );
167cdf0e10cSrcweir 
168cdf0e10cSrcweir 		virtual void SAL_CALL removeCommandFromAllKeyEvents(const ::rtl::OUString& sCommand)
169cdf0e10cSrcweir 			throw(css::lang::IllegalArgumentException   ,
170cdf0e10cSrcweir 			css::container::NoSuchElementException,
171cdf0e10cSrcweir 			css::uno::RuntimeException            );
172cdf0e10cSrcweir 
173cdf0e10cSrcweir 		// XUIConfigurationPersistence
174cdf0e10cSrcweir 		virtual void SAL_CALL reload()
175cdf0e10cSrcweir 			throw(css::uno::Exception       ,
176cdf0e10cSrcweir 			css::uno::RuntimeException);
177cdf0e10cSrcweir 
178cdf0e10cSrcweir 		virtual void SAL_CALL store()
179cdf0e10cSrcweir 			throw(css::uno::Exception       ,
180cdf0e10cSrcweir 			css::uno::RuntimeException);
181cdf0e10cSrcweir 
182cdf0e10cSrcweir 		virtual void SAL_CALL storeToStorage(const css::uno::Reference< css::embed::XStorage >& xStorage)
183cdf0e10cSrcweir 			throw(css::uno::Exception       ,
184cdf0e10cSrcweir 			css::uno::RuntimeException);
185cdf0e10cSrcweir 
186cdf0e10cSrcweir 		virtual ::sal_Bool SAL_CALL isModified()
187cdf0e10cSrcweir 			throw(css::uno::RuntimeException);
188cdf0e10cSrcweir 
189cdf0e10cSrcweir 		virtual ::sal_Bool SAL_CALL isReadOnly()
190cdf0e10cSrcweir 			throw(css::uno::RuntimeException);
191cdf0e10cSrcweir 
192cdf0e10cSrcweir 		// XUIConfigurationStorage
193cdf0e10cSrcweir 		virtual void SAL_CALL setStorage(const css::uno::Reference< css::embed::XStorage >& xStorage)
194cdf0e10cSrcweir 			throw(css::uno::RuntimeException);
195cdf0e10cSrcweir 
196cdf0e10cSrcweir 		virtual ::sal_Bool SAL_CALL hasStorage()
197cdf0e10cSrcweir 			throw(css::uno::RuntimeException);
198cdf0e10cSrcweir 
199cdf0e10cSrcweir 		// XUIConfiguration
200cdf0e10cSrcweir 		virtual void SAL_CALL addConfigurationListener(const css::uno::Reference< css::ui::XUIConfigurationListener >& xListener)
201cdf0e10cSrcweir 			throw(css::uno::RuntimeException);
202cdf0e10cSrcweir 
203cdf0e10cSrcweir 		virtual void SAL_CALL removeConfigurationListener(const css::uno::Reference< css::ui::XUIConfigurationListener >& xListener)
204cdf0e10cSrcweir 			throw(css::uno::RuntimeException);
205cdf0e10cSrcweir 
206cdf0e10cSrcweir 		// XReset
207cdf0e10cSrcweir 		// TODO use XPresetHandler instead if available
208cdf0e10cSrcweir 		virtual void SAL_CALL reset()
209cdf0e10cSrcweir 			throw(css::uno::RuntimeException);
210cdf0e10cSrcweir 
211cdf0e10cSrcweir 		virtual void SAL_CALL addResetListener(const css::uno::Reference< css::form::XResetListener >& xListener)
212cdf0e10cSrcweir 			throw(css::uno::RuntimeException);
213cdf0e10cSrcweir 
214cdf0e10cSrcweir 		virtual void SAL_CALL removeResetListener(const css::uno::Reference< css::form::XResetListener >& xListener)
215cdf0e10cSrcweir 			throw(css::uno::RuntimeException);
216cdf0e10cSrcweir 
217cdf0e10cSrcweir 		// IStorageListener
218cdf0e10cSrcweir 		virtual void changesOccured(const ::rtl::OUString& sPath);
219cdf0e10cSrcweir 
220cdf0e10cSrcweir 		//______________________________________
221cdf0e10cSrcweir 		// helper for derived classes
222cdf0e10cSrcweir 
223cdf0e10cSrcweir 	protected:
224cdf0e10cSrcweir 
225cdf0e10cSrcweir 		//---------------------------------------
226cdf0e10cSrcweir 		/** @short  return the current office locale.
227cdf0e10cSrcweir 
228cdf0e10cSrcweir 		@descr  We does not cache this value, because we are not listen
229cdf0e10cSrcweir 		for changes on the configuration layer ...
230cdf0e10cSrcweir 
231cdf0e10cSrcweir 		@return ::comphelper::Locale
232cdf0e10cSrcweir 		The current office locale.
233cdf0e10cSrcweir 		*/
234cdf0e10cSrcweir 		::comphelper::Locale impl_ts_getLocale() const;
235cdf0e10cSrcweir 
236cdf0e10cSrcweir 		//______________________________________
237cdf0e10cSrcweir 		// helper
238cdf0e10cSrcweir 
239cdf0e10cSrcweir 	private:
240cdf0e10cSrcweir 
241cdf0e10cSrcweir 		//---------------------------------------
242cdf0e10cSrcweir 		/** @short  load a configuration set, using the given stream.
243cdf0e10cSrcweir 
244cdf0e10cSrcweir 		@param  xStream
245cdf0e10cSrcweir 		provides the XML structure as stream.
246cdf0e10cSrcweir 		*/
247cdf0e10cSrcweir 		void impl_ts_load(const css::uno::Reference< css::io::XInputStream >& xStream);
248cdf0e10cSrcweir 
249cdf0e10cSrcweir 		//---------------------------------------
250cdf0e10cSrcweir 		/** @short  save a configuration set, using the given stream.
251cdf0e10cSrcweir 
252cdf0e10cSrcweir 		@param  xStream
253cdf0e10cSrcweir 		the XML structure can be written there.
254cdf0e10cSrcweir 		*/
255cdf0e10cSrcweir 		void impl_ts_save(const css::uno::Reference< css::io::XOutputStream >& xStream);
256cdf0e10cSrcweir 
257cdf0e10cSrcweir 		//---------------------------------------
258cdf0e10cSrcweir 		/** @short  try to locate and open a sub storage.
259cdf0e10cSrcweir 
260cdf0e10cSrcweir 		@descr  It search at the root storage for the specified
261cdf0e10cSrcweir 		sub storage. If it exists - it will be opened.
262cdf0e10cSrcweir 		By default this method tries to open the storage
263cdf0e10cSrcweir 		for reading. But the calli can request a writeable
264cdf0e10cSrcweir 		storage.
265cdf0e10cSrcweir 
266cdf0e10cSrcweir 		@param  xRooStorage
267cdf0e10cSrcweir 		used to locate the sub storage.
268cdf0e10cSrcweir 
269cdf0e10cSrcweir 		@param  sSubStorage
270cdf0e10cSrcweir 		relativ path of the sub storage.
271cdf0e10cSrcweir 
272cdf0e10cSrcweir 		@param  bOutStream
273cdf0e10cSrcweir 		force open of the sub storage in
274cdf0e10cSrcweir 		write mode - instead of read mode, which
275cdf0e10cSrcweir 		is the default.
276cdf0e10cSrcweir 
277cdf0e10cSrcweir 		@return [XInterface]
278cdf0e10cSrcweir 		will be a css::io::XInpoutStream or a css::io::XOutputStream.
279cdf0e10cSrcweir 		Depends from the parameter bWriteable!
280cdf0e10cSrcweir 		*/
281cdf0e10cSrcweir 		css::uno::Reference< css::uno::XInterface > impl_ts_openSubStorage(const css::uno::Reference< css::embed::XStorage >& xRootStorage,
282cdf0e10cSrcweir 			const ::rtl::OUString&                             sSubStorage ,
283cdf0e10cSrcweir 			sal_Bool                                     bOutStream  );
284cdf0e10cSrcweir 
285cdf0e10cSrcweir 		//---------------------------------------
286cdf0e10cSrcweir 		/** @short  returns a reference to one of our internal cache members.
287cdf0e10cSrcweir 
288cdf0e10cSrcweir 		@descr  We implement the copy-on-write pattern. Doing so
289*a49f1911Smseidel 		we know two caches internally. The second one is used
290cdf0e10cSrcweir 		only, if the container was changed.
291cdf0e10cSrcweir 
292cdf0e10cSrcweir 		This method here returns access to one of these
293cdf0e10cSrcweir 		caches - depending on the change state of this
294cdf0e10cSrcweir 		configuration service.
295cdf0e10cSrcweir 
296cdf0e10cSrcweir 		@param  bWriteAccessRequested
297cdf0e10cSrcweir 		if the outside code whish to change the container
298cdf0e10cSrcweir 		it must call this method with "sal_True". So the internal
299cdf0e10cSrcweir 		cache can be prepared for that (means copy-on-write ...).
300cdf0e10cSrcweir 
301cdf0e10cSrcweir 		@return [AcceleratorCache]
302cdf0e10cSrcweir 		c++ reference(!) to one of our internal caches.
303cdf0e10cSrcweir 		*/
304cdf0e10cSrcweir 		AcceleratorCache& impl_getCFG(sal_Bool bWriteAccessRequested = sal_False);
305cdf0e10cSrcweir 
306cdf0e10cSrcweir };
307cdf0e10cSrcweir 
30807a3d7f1SPedro Giffuni class XCUBasedAcceleratorConfiguration : protected ThreadHelpBase                       // attention! Must be the first base class to guarantee right initialize lock ...
309cdf0e10cSrcweir 									   , public    ::cppu::OWeakObject
310cdf0e10cSrcweir 								       , public    css::lang::XTypeProvider
311cdf0e10cSrcweir 									   , public    css::util::XChangesListener
312796936d9SAndre Fischer 									   , public    css::lang::XComponent
313cdf0e10cSrcweir 									   , public    css::form::XReset                    // TODO use XPresetHandler instead if available
314cdf0e10cSrcweir 									   , public    css::ui::XAcceleratorConfiguration  // => css::ui::XUIConfigurationPersistence
315cdf0e10cSrcweir 																					   //    css::ui::XUIConfigurationStorage
316cdf0e10cSrcweir 																					   //    css::ui::XUIConfiguration
317cdf0e10cSrcweir {
318cdf0e10cSrcweir 	//______________________________________
319cdf0e10cSrcweir 	// member
320cdf0e10cSrcweir 
321cdf0e10cSrcweir 	protected:
322cdf0e10cSrcweir 
323cdf0e10cSrcweir 		//---------------------------------------
324cdf0e10cSrcweir 		/** the global uno service manager.
325cdf0e10cSrcweir 		Must be used to create own needed services. */
326cdf0e10cSrcweir 		css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
327cdf0e10cSrcweir 
328cdf0e10cSrcweir 		css::uno::Reference< css::container::XNameAccess > m_xCfg;
329cdf0e10cSrcweir         AcceleratorCache m_aPrimaryReadCache;
330cdf0e10cSrcweir         AcceleratorCache m_aSecondaryReadCache;
331cdf0e10cSrcweir         AcceleratorCache* m_pPrimaryWriteCache;
332cdf0e10cSrcweir         AcceleratorCache* m_pSecondaryWriteCache;
333cdf0e10cSrcweir 
334cdf0e10cSrcweir         ::rtl::OUString m_sGlobalOrModules;
335cdf0e10cSrcweir 		::rtl::OUString m_sModuleCFG;
336cdf0e10cSrcweir 
337cdf0e10cSrcweir         ::salhelper::SingletonRef< KeyMapping > m_rKeyMapping;
338cdf0e10cSrcweir 
339cdf0e10cSrcweir 		//______________________________________
340cdf0e10cSrcweir 		// native interface!
341cdf0e10cSrcweir 
342cdf0e10cSrcweir 	public:
343cdf0e10cSrcweir 
344cdf0e10cSrcweir 		XCUBasedAcceleratorConfiguration( const css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR );
345cdf0e10cSrcweir 		virtual ~XCUBasedAcceleratorConfiguration(                                                           );
346cdf0e10cSrcweir 
347cdf0e10cSrcweir 		//______________________________________
348cdf0e10cSrcweir 		// uno interface!
349cdf0e10cSrcweir 
350cdf0e10cSrcweir 	public:
351cdf0e10cSrcweir 
352cdf0e10cSrcweir 		// XInterface, XTypeProvider
353cdf0e10cSrcweir 		FWK_DECLARE_XINTERFACE
354cdf0e10cSrcweir 		FWK_DECLARE_XTYPEPROVIDER
355cdf0e10cSrcweir 
356cdf0e10cSrcweir 		// XAcceleratorConfiguration
357cdf0e10cSrcweir 		virtual css::uno::Sequence< css::awt::KeyEvent > SAL_CALL getAllKeyEvents()
358cdf0e10cSrcweir 			throw(css::uno::RuntimeException);
359cdf0e10cSrcweir 
360cdf0e10cSrcweir 		virtual ::rtl::OUString SAL_CALL getCommandByKeyEvent(const css::awt::KeyEvent& aKeyEvent)
361cdf0e10cSrcweir 			throw(css::container::NoSuchElementException,
362cdf0e10cSrcweir 			css::uno::RuntimeException            );
363cdf0e10cSrcweir 
364cdf0e10cSrcweir 		virtual void SAL_CALL setKeyEvent(const css::awt::KeyEvent& aKeyEvent,
365cdf0e10cSrcweir 			const ::rtl::OUString&    sCommand )
366cdf0e10cSrcweir 			throw(css::lang::IllegalArgumentException,
367cdf0e10cSrcweir 			css::uno::RuntimeException         );
368cdf0e10cSrcweir 
369cdf0e10cSrcweir 		virtual void SAL_CALL removeKeyEvent(const css::awt::KeyEvent& aKeyEvent)
370cdf0e10cSrcweir 			throw(css::container::NoSuchElementException,
371cdf0e10cSrcweir 			css::uno::RuntimeException            );
372cdf0e10cSrcweir 
373cdf0e10cSrcweir 		virtual css::uno::Sequence< css::awt::KeyEvent > SAL_CALL getKeyEventsByCommand(const ::rtl::OUString& sCommand)
374cdf0e10cSrcweir 			throw(css::lang::IllegalArgumentException   ,
375cdf0e10cSrcweir 			css::container::NoSuchElementException,
376cdf0e10cSrcweir 			css::uno::RuntimeException            );
377cdf0e10cSrcweir 
378cdf0e10cSrcweir 		virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPreferredKeyEventsForCommandList(const css::uno::Sequence< ::rtl::OUString >& lCommandList)
379cdf0e10cSrcweir 			throw(css::lang::IllegalArgumentException   ,
380cdf0e10cSrcweir 			css::uno::RuntimeException            );
381cdf0e10cSrcweir 
382cdf0e10cSrcweir 		virtual void SAL_CALL removeCommandFromAllKeyEvents(const ::rtl::OUString& sCommand)
383cdf0e10cSrcweir 			throw(css::lang::IllegalArgumentException   ,
384cdf0e10cSrcweir 			css::container::NoSuchElementException,
385cdf0e10cSrcweir 			css::uno::RuntimeException            );
386cdf0e10cSrcweir 
387cdf0e10cSrcweir 		// XUIConfigurationPersistence
388cdf0e10cSrcweir 		virtual void SAL_CALL reload()
389cdf0e10cSrcweir 			throw(css::uno::Exception       ,
390cdf0e10cSrcweir 			css::uno::RuntimeException);
391cdf0e10cSrcweir 
392cdf0e10cSrcweir 		virtual void SAL_CALL store()
393cdf0e10cSrcweir 			throw(css::uno::Exception       ,
394cdf0e10cSrcweir 			css::uno::RuntimeException);
395cdf0e10cSrcweir 
396cdf0e10cSrcweir 		virtual void SAL_CALL storeToStorage(const css::uno::Reference< css::embed::XStorage >& xStorage)
397cdf0e10cSrcweir 			throw(css::uno::Exception       ,
398cdf0e10cSrcweir 			css::uno::RuntimeException);
399cdf0e10cSrcweir 
400cdf0e10cSrcweir 		virtual ::sal_Bool SAL_CALL isModified()
401cdf0e10cSrcweir 			throw(css::uno::RuntimeException);
402cdf0e10cSrcweir 
403cdf0e10cSrcweir 		virtual ::sal_Bool SAL_CALL isReadOnly()
404cdf0e10cSrcweir 			throw(css::uno::RuntimeException);
405cdf0e10cSrcweir 
406cdf0e10cSrcweir 		// XUIConfigurationStorage
407cdf0e10cSrcweir 		virtual void SAL_CALL setStorage(const css::uno::Reference< css::embed::XStorage >& xStorage)
408cdf0e10cSrcweir 			throw(css::uno::RuntimeException);
409cdf0e10cSrcweir 
410cdf0e10cSrcweir 		virtual ::sal_Bool SAL_CALL hasStorage()
411cdf0e10cSrcweir 			throw(css::uno::RuntimeException);
412cdf0e10cSrcweir 
413cdf0e10cSrcweir 		// XUIConfiguration
414cdf0e10cSrcweir 		virtual void SAL_CALL addConfigurationListener(const css::uno::Reference< css::ui::XUIConfigurationListener >& xListener)
415cdf0e10cSrcweir 			throw(css::uno::RuntimeException);
416cdf0e10cSrcweir 
417cdf0e10cSrcweir 		virtual void SAL_CALL removeConfigurationListener(const css::uno::Reference< css::ui::XUIConfigurationListener >& xListener)
418cdf0e10cSrcweir 			throw(css::uno::RuntimeException);
419cdf0e10cSrcweir 
420cdf0e10cSrcweir 		// XReset
421cdf0e10cSrcweir 		// TODO use XPresetHandler instead if available
422cdf0e10cSrcweir 		virtual void SAL_CALL reset()
423cdf0e10cSrcweir 			throw(css::uno::RuntimeException);
424cdf0e10cSrcweir 
425cdf0e10cSrcweir 		virtual void SAL_CALL addResetListener(const css::uno::Reference< css::form::XResetListener >& xListener)
426cdf0e10cSrcweir 			throw(css::uno::RuntimeException);
427cdf0e10cSrcweir 
428cdf0e10cSrcweir 		virtual void SAL_CALL removeResetListener(const css::uno::Reference< css::form::XResetListener >& xListener)
429cdf0e10cSrcweir 			throw(css::uno::RuntimeException);
430cdf0e10cSrcweir 
431cdf0e10cSrcweir 		// css.util.XChangesListener
432cdf0e10cSrcweir 		virtual void SAL_CALL changesOccurred(const css::util::ChangesEvent& aEvent)
433cdf0e10cSrcweir 			throw(css::uno::RuntimeException);
434cdf0e10cSrcweir 
435cdf0e10cSrcweir 		// css.lang.XEventListener
436cdf0e10cSrcweir 		virtual void SAL_CALL disposing(const css::lang::EventObject& aEvent)
437cdf0e10cSrcweir 			throw(css::uno::RuntimeException);
438cdf0e10cSrcweir 
439796936d9SAndre Fischer 		// XComponent
440796936d9SAndre Fischer 		virtual  void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);
441796936d9SAndre Fischer 		virtual  void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
442796936d9SAndre Fischer 		virtual  void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
443796936d9SAndre Fischer 
444cdf0e10cSrcweir 		//______________________________________
445cdf0e10cSrcweir 		// helper for derived classes
446cdf0e10cSrcweir 
447cdf0e10cSrcweir 	protected:
448cdf0e10cSrcweir 
449cdf0e10cSrcweir 		//---------------------------------------
450cdf0e10cSrcweir 		/** @short  return the current office locale.
451cdf0e10cSrcweir 
452cdf0e10cSrcweir 		@descr  We does not cache this value, because we are not listen
453cdf0e10cSrcweir 		for changes on the configuration layer ...
454cdf0e10cSrcweir 
455cdf0e10cSrcweir 		@return ::comphelper::Locale
456cdf0e10cSrcweir 		The current office locale.
457cdf0e10cSrcweir 		*/
458cdf0e10cSrcweir 		::comphelper::Locale impl_ts_getLocale() const;
459cdf0e10cSrcweir 
460cdf0e10cSrcweir 		//______________________________________
461cdf0e10cSrcweir 		// helper
462cdf0e10cSrcweir 
463cdf0e10cSrcweir 	private:
464cdf0e10cSrcweir 
465cdf0e10cSrcweir         void impl_ts_load(sal_Bool bPreferred, const css::uno::Reference< css::container::XNameAccess >& xCfg);
466cdf0e10cSrcweir         void impl_ts_save(sal_Bool bPreferred, const css::uno::Reference< css::container::XNameAccess >& xCfg);
467cdf0e10cSrcweir 
468cdf0e10cSrcweir 		void insertKeyToConfiguration(const css::awt::KeyEvent& aKeyEvent, const ::rtl::OUString& sCommand, const sal_Bool bPreferred);
469cdf0e10cSrcweir 		void removeKeyFromConfiguration(const css::awt::KeyEvent& aKeyEvent, const sal_Bool bPreferred);
470cdf0e10cSrcweir 
471cdf0e10cSrcweir 		void reloadChanged(const ::rtl::OUString& sPrimarySecondary, const ::rtl::OUString& sGlobalModules, const ::rtl::OUString& sModule, const ::rtl::OUString& sKey);
472cdf0e10cSrcweir         AcceleratorCache& impl_getCFG(sal_Bool bPreferred, sal_Bool bWriteAccessRequested = sal_False);
473cdf0e10cSrcweir 
474cdf0e10cSrcweir };
475cdf0e10cSrcweir 
476cdf0e10cSrcweir } // namespace framework
477cdf0e10cSrcweir 
478cdf0e10cSrcweir #endif // __FRAMEWORK_ACCELERATORS_ACCELERATORCONFIGURATION_HXX_
479