1*6998d047SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*6998d047SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*6998d047SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*6998d047SAndrew Rist  * distributed with this work for additional information
6*6998d047SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*6998d047SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*6998d047SAndrew Rist  * "License"); you may not use this file except in compliance
9*6998d047SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*6998d047SAndrew Rist  *
11*6998d047SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*6998d047SAndrew Rist  *
13*6998d047SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*6998d047SAndrew Rist  * software distributed under the License is distributed on an
15*6998d047SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*6998d047SAndrew Rist  * KIND, either express or implied.  See the License for the
17*6998d047SAndrew Rist  * specific language governing permissions and limitations
18*6998d047SAndrew Rist  * under the License.
19*6998d047SAndrew Rist  *
20*6998d047SAndrew Rist  *************************************************************/
21*6998d047SAndrew Rist 
22*6998d047SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef SCRIPTING_DLGPROV_HXX
25cdf0e10cSrcweir #define SCRIPTING_DLGPROV_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #ifndef _COM_SUN_STAR_AWT_XSTRINGRESOURCEWITHSTORAGE_HPP_
28cdf0e10cSrcweir #include <com/sun/star/resource/XStringResourceWithStorage.hpp>
29cdf0e10cSrcweir #endif
30cdf0e10cSrcweir #ifndef _COM_SUN_STAR_AWT_XSTRINGRESOURCEWITHSTORAGE_HPP_
31cdf0e10cSrcweir #include <com/sun/star/resource/XStringResourceWithLocation.hpp>
32cdf0e10cSrcweir #endif
33cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp>
34cdf0e10cSrcweir #include <com/sun/star/lang/XInitialization.hpp>
35cdf0e10cSrcweir #include <com/sun/star/uno/XComponentContext.hpp>
36cdf0e10cSrcweir #include <com/sun/star/ucb/XSimpleFileAccess.hpp>
37cdf0e10cSrcweir #include <com/sun/star/io/XInputStream.hpp>
38cdf0e10cSrcweir #include <com/sun/star/io/XOutputStream.hpp>
39cdf0e10cSrcweir #include <cppuhelper/implbase1.hxx>
40cdf0e10cSrcweir #include <cppuhelper/implbase2.hxx>
41cdf0e10cSrcweir #include <cppuhelper/interfacecontainer.hxx>
42cdf0e10cSrcweir #include <osl/mutex.hxx>
43cdf0e10cSrcweir 
44cdf0e10cSrcweir #include <vector>
45cdf0e10cSrcweir #include <hash_map>
46cdf0e10cSrcweir 
47cdf0e10cSrcweir //.........................................................................
48cdf0e10cSrcweir namespace stringresource
49cdf0e10cSrcweir {
50cdf0e10cSrcweir //.........................................................................
51cdf0e10cSrcweir 
52cdf0e10cSrcweir // =============================================================================
53cdf0e10cSrcweir // mutex
54cdf0e10cSrcweir // =============================================================================
55cdf0e10cSrcweir 
56cdf0e10cSrcweir ::osl::Mutex& getMutex();
57cdf0e10cSrcweir 
58cdf0e10cSrcweir 
59cdf0e10cSrcweir // =============================================================================
60cdf0e10cSrcweir // class stringresourceImpl
61cdf0e10cSrcweir // =============================================================================
62cdf0e10cSrcweir 
63cdf0e10cSrcweir // Hashtable to map string ids to string
64cdf0e10cSrcweir struct hashName_Impl
65cdf0e10cSrcweir {
operator ()stringresource::hashName_Impl66cdf0e10cSrcweir 	size_t operator()(const ::rtl::OUString Str) const
67cdf0e10cSrcweir 	{
68cdf0e10cSrcweir 		return (size_t)Str.hashCode();
69cdf0e10cSrcweir 	}
70cdf0e10cSrcweir };
71cdf0e10cSrcweir 
72cdf0e10cSrcweir struct eqName_Impl
73cdf0e10cSrcweir {
operator ()stringresource::eqName_Impl74cdf0e10cSrcweir 	sal_Bool operator()(const ::rtl::OUString Str1, const ::rtl::OUString Str2) const
75cdf0e10cSrcweir 	{
76cdf0e10cSrcweir 		return ( Str1 == Str2 );
77cdf0e10cSrcweir 	}
78cdf0e10cSrcweir };
79cdf0e10cSrcweir 
80cdf0e10cSrcweir typedef std::hash_map
81cdf0e10cSrcweir <
82cdf0e10cSrcweir 	::rtl::OUString,
83cdf0e10cSrcweir 	::rtl::OUString,
84cdf0e10cSrcweir 	hashName_Impl,
85cdf0e10cSrcweir 	eqName_Impl
86cdf0e10cSrcweir >
87cdf0e10cSrcweir IdToStringMap;
88cdf0e10cSrcweir 
89cdf0e10cSrcweir typedef std::hash_map
90cdf0e10cSrcweir <
91cdf0e10cSrcweir 	::rtl::OUString,
92cdf0e10cSrcweir 	sal_Int32,
93cdf0e10cSrcweir 	hashName_Impl,
94cdf0e10cSrcweir 	eqName_Impl
95cdf0e10cSrcweir >
96cdf0e10cSrcweir IdToIndexMap;
97cdf0e10cSrcweir 
98cdf0e10cSrcweir 
99cdf0e10cSrcweir struct LocaleItem
100cdf0e10cSrcweir {
101cdf0e10cSrcweir 	::com::sun::star::lang::Locale		m_locale;
102cdf0e10cSrcweir 	IdToStringMap						m_aIdToStringMap;
103cdf0e10cSrcweir 	IdToIndexMap						m_aIdToIndexMap;
104cdf0e10cSrcweir 	sal_Int32							m_nNextIndex;
105cdf0e10cSrcweir 	bool								m_bLoaded;
106cdf0e10cSrcweir 	bool								m_bModified;
107cdf0e10cSrcweir 
LocaleItemstringresource::LocaleItem108cdf0e10cSrcweir 	LocaleItem( ::com::sun::star::lang::Locale locale, bool bLoaded=true )
109cdf0e10cSrcweir 		: m_locale( locale )
110cdf0e10cSrcweir 		, m_nNextIndex( 0 )
111cdf0e10cSrcweir 		, m_bLoaded( bLoaded )
112cdf0e10cSrcweir 		, m_bModified( false )
113cdf0e10cSrcweir 	{}
114cdf0e10cSrcweir };
115cdf0e10cSrcweir 
116cdf0e10cSrcweir typedef std::vector< LocaleItem* > LocaleItemVector;
117cdf0e10cSrcweir typedef std::vector< LocaleItem* >::iterator LocaleItemVectorIt;
118cdf0e10cSrcweir typedef std::vector< LocaleItem* >::const_iterator LocaleItemVectorConstIt;
119cdf0e10cSrcweir 
120cdf0e10cSrcweir typedef ::cppu::WeakImplHelper2<
121cdf0e10cSrcweir     ::com::sun::star::lang::XServiceInfo,
122cdf0e10cSrcweir     ::com::sun::star::resource::XStringResourceManager > StringResourceImpl_BASE;
123cdf0e10cSrcweir 
124cdf0e10cSrcweir class StringResourceImpl : public StringResourceImpl_BASE
125cdf0e10cSrcweir {
126cdf0e10cSrcweir protected:
127cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >        m_xContext;
128cdf0e10cSrcweir 	::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiComponentFactory >	m_xMCF;
129cdf0e10cSrcweir 
130cdf0e10cSrcweir 	LocaleItem*																			m_pCurrentLocaleItem;
131cdf0e10cSrcweir 	LocaleItem*																			m_pDefaultLocaleItem;
132cdf0e10cSrcweir 	bool																				m_bDefaultModified;
133cdf0e10cSrcweir 
134cdf0e10cSrcweir 	::cppu::OInterfaceContainerHelper													m_aListenerContainer;
135cdf0e10cSrcweir 
136cdf0e10cSrcweir 	LocaleItemVector																	m_aLocaleItemVector;
137cdf0e10cSrcweir 	LocaleItemVector																	m_aDeletedLocaleItemVector;
138cdf0e10cSrcweir 	LocaleItemVector																	m_aChangedDefaultLocaleVector;
139cdf0e10cSrcweir 
140cdf0e10cSrcweir 	bool																				m_bModified;
141cdf0e10cSrcweir 	bool																				m_bReadOnly;
142cdf0e10cSrcweir 
143cdf0e10cSrcweir 	sal_Int32																			m_nNextUniqueNumericId;
144cdf0e10cSrcweir 
145cdf0e10cSrcweir 	// Scans ResourceID to start with number and adapt m_nNextUniqueNumericId
146cdf0e10cSrcweir 	void implScanIdForNumber( const ::rtl::OUString& ResourceID );
147cdf0e10cSrcweir 	const static sal_Int32 UNIQUE_NUMBER_NEEDS_INITIALISATION = -1;
148cdf0e10cSrcweir 
149cdf0e10cSrcweir 	// Checks read only status and throws exception if it's true
150cdf0e10cSrcweir 	void implCheckReadOnly( const sal_Char* pExceptionMsg )
151cdf0e10cSrcweir 		throw (::com::sun::star::lang::NoSupportException);
152cdf0e10cSrcweir 
153cdf0e10cSrcweir 	// Return the context's MultiComponentFactory
154cdf0e10cSrcweir 	::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiComponentFactory >
155cdf0e10cSrcweir 		getMultiComponentFactory( void );
156cdf0e10cSrcweir 
157cdf0e10cSrcweir 	// Returns the LocalItem for a given locale, if it exists, otherwise NULL
158cdf0e10cSrcweir 	// This method compares the locales exactly, no closest match search is performed
159cdf0e10cSrcweir 	LocaleItem* getItemForLocale( const ::com::sun::star::lang::Locale& locale, sal_Bool bException )
160cdf0e10cSrcweir 		throw (::com::sun::star::lang::IllegalArgumentException);
161cdf0e10cSrcweir 
162cdf0e10cSrcweir 	// Returns the LocalItem for a given locale, if it exists, otherwise NULL
163cdf0e10cSrcweir 	// This method performes a closest match search, at least the language must match
164cdf0e10cSrcweir 	LocaleItem* getClosestMatchItemForLocale( const ::com::sun::star::lang::Locale& locale );
165cdf0e10cSrcweir 	void implSetCurrentLocale( const ::com::sun::star::lang::Locale& locale,
166cdf0e10cSrcweir 		sal_Bool FindClosestMatch, sal_Bool bUseDefaultIfNoMatch )
167cdf0e10cSrcweir 			throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
168cdf0e10cSrcweir 
169cdf0e10cSrcweir 	void implModified( void );
170cdf0e10cSrcweir 	void implNotifyListeners( void );
171cdf0e10cSrcweir 
172cdf0e10cSrcweir 	//=== Impl methods for ...ForLocale methods ===
173cdf0e10cSrcweir     ::rtl::OUString SAL_CALL implResolveString( const ::rtl::OUString& ResourceID, LocaleItem* pLocaleItem )
174cdf0e10cSrcweir 		throw (::com::sun::star::resource::MissingResourceException);
175cdf0e10cSrcweir     ::sal_Bool implHasEntryForId( const ::rtl::OUString& ResourceID, LocaleItem* pLocaleItem );
176cdf0e10cSrcweir 	::com::sun::star::uno::Sequence< ::rtl::OUString > implGetResourceIDs( LocaleItem* pLocaleItem );
177cdf0e10cSrcweir 	void implSetString( const ::rtl::OUString& ResourceID,
178cdf0e10cSrcweir 		const ::rtl::OUString& Str, LocaleItem* pLocaleItem );
179cdf0e10cSrcweir     void implRemoveId( const ::rtl::OUString& ResourceID, LocaleItem* pLocaleItem )
180cdf0e10cSrcweir 		throw (::com::sun::star::resource::MissingResourceException);
181cdf0e10cSrcweir 
182cdf0e10cSrcweir 	// Method to load a locale if necessary, returns true if loading was
183cdf0e10cSrcweir 	// successful. Default implementation in base class just returns true.
184cdf0e10cSrcweir 	virtual bool loadLocale( LocaleItem* pLocaleItem );
185cdf0e10cSrcweir 
186cdf0e10cSrcweir 	virtual void implLoadAllLocales( void );
187cdf0e10cSrcweir 
188cdf0e10cSrcweir public:
189cdf0e10cSrcweir     StringResourceImpl(
190cdf0e10cSrcweir         const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
191cdf0e10cSrcweir     virtual ~StringResourceImpl();
192cdf0e10cSrcweir 
193cdf0e10cSrcweir     // XServiceInfo
194cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getImplementationName(  )
195cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
196cdf0e10cSrcweir     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
197cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
198cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  )
199cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
200cdf0e10cSrcweir 
201cdf0e10cSrcweir 	// XModifyBroadcaster
202cdf0e10cSrcweir 	virtual void SAL_CALL addModifyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
203cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
204cdf0e10cSrcweir 	virtual void SAL_CALL removeModifyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
205cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
206cdf0e10cSrcweir 
207cdf0e10cSrcweir  	// XStringResourceResolver
208cdf0e10cSrcweir 	virtual ::rtl::OUString SAL_CALL resolveString( const ::rtl::OUString& ResourceID )
209cdf0e10cSrcweir 		throw (::com::sun::star::resource::MissingResourceException, ::com::sun::star::uno::RuntimeException);
210cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL resolveStringForLocale( const ::rtl::OUString& ResourceID,
211cdf0e10cSrcweir 		const ::com::sun::star::lang::Locale& locale )
212cdf0e10cSrcweir 			throw ( ::com::sun::star::resource::MissingResourceException,
213cdf0e10cSrcweir 					::com::sun::star::uno::RuntimeException);
214cdf0e10cSrcweir     virtual ::sal_Bool SAL_CALL hasEntryForId( const ::rtl::OUString& ResourceID )
215cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
216cdf0e10cSrcweir     virtual ::sal_Bool SAL_CALL hasEntryForIdAndLocale( const ::rtl::OUString& ResourceID,
217cdf0e10cSrcweir 		const ::com::sun::star::lang::Locale& locale )
218cdf0e10cSrcweir 			throw (::com::sun::star::uno::RuntimeException);
219cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getResourceIDs(  )
220cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
221cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getResourceIDsForLocale
222cdf0e10cSrcweir 		( const ::com::sun::star::lang::Locale& locale )
223cdf0e10cSrcweir 			throw (::com::sun::star::uno::RuntimeException);
224cdf0e10cSrcweir 	virtual ::com::sun::star::lang::Locale SAL_CALL getCurrentLocale(  )
225cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
226cdf0e10cSrcweir 	virtual ::com::sun::star::lang::Locale SAL_CALL getDefaultLocale(  )
227cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
228cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Sequence< ::com::sun::star::lang::Locale > SAL_CALL getLocales(  )
229cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
230cdf0e10cSrcweir 
231cdf0e10cSrcweir 	// XStringResourceManager
232cdf0e10cSrcweir 	virtual ::sal_Bool SAL_CALL isReadOnly()
233cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
234cdf0e10cSrcweir 	virtual void SAL_CALL setCurrentLocale( const ::com::sun::star::lang::Locale& locale, ::sal_Bool FindClosestMatch )
235cdf0e10cSrcweir 		throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
236cdf0e10cSrcweir 	virtual void SAL_CALL setDefaultLocale( const ::com::sun::star::lang::Locale& locale )
237cdf0e10cSrcweir 		throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException,
238cdf0e10cSrcweir 		       ::com::sun::star::lang::NoSupportException);
239cdf0e10cSrcweir     virtual void SAL_CALL setString( const ::rtl::OUString& ResourceID, const ::rtl::OUString& Str )
240cdf0e10cSrcweir 		throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
241cdf0e10cSrcweir     virtual void SAL_CALL setStringForLocale( const ::rtl::OUString& ResourceID, const ::rtl::OUString& Str,
242cdf0e10cSrcweir 		const ::com::sun::star::lang::Locale& locale )
243cdf0e10cSrcweir 			throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
244cdf0e10cSrcweir 	virtual void SAL_CALL removeId( const ::rtl::OUString& ResourceID )
245cdf0e10cSrcweir 		throw (::com::sun::star::resource::MissingResourceException, ::com::sun::star::uno::RuntimeException,
246cdf0e10cSrcweir 		       ::com::sun::star::lang::NoSupportException);
247cdf0e10cSrcweir     virtual void SAL_CALL removeIdForLocale( const ::rtl::OUString& ResourceID,
248cdf0e10cSrcweir 		const ::com::sun::star::lang::Locale& locale )
249cdf0e10cSrcweir 			throw (::com::sun::star::resource::MissingResourceException, ::com::sun::star::uno::RuntimeException,
250cdf0e10cSrcweir 				   ::com::sun::star::lang::NoSupportException);
251cdf0e10cSrcweir 	virtual void SAL_CALL newLocale( const ::com::sun::star::lang::Locale& locale )
252cdf0e10cSrcweir 		throw (::com::sun::star::container::ElementExistException, ::com::sun::star::lang::IllegalArgumentException,
253cdf0e10cSrcweir 			   ::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
254cdf0e10cSrcweir 	virtual void SAL_CALL removeLocale( const ::com::sun::star::lang::Locale& locale )
255cdf0e10cSrcweir 		throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException,
256cdf0e10cSrcweir 		       ::com::sun::star::lang::NoSupportException);
257cdf0e10cSrcweir     virtual ::sal_Int32 SAL_CALL getUniqueNumericId(  )
258cdf0e10cSrcweir 		throw (::com::sun::star::lang::NoSupportException,
259cdf0e10cSrcweir 			   ::com::sun::star::uno::RuntimeException);
260cdf0e10cSrcweir  };
261cdf0e10cSrcweir 
262cdf0e10cSrcweir typedef ::cppu::ImplInheritanceHelper1<
263cdf0e10cSrcweir 		StringResourceImpl,
264cdf0e10cSrcweir 		::com::sun::star::resource::XStringResourcePersistence > StringResourcePersistenceImpl_BASE;
265cdf0e10cSrcweir 
266cdf0e10cSrcweir class BinaryOutput;
267cdf0e10cSrcweir class BinaryInput;
268cdf0e10cSrcweir 
269cdf0e10cSrcweir class StringResourcePersistenceImpl : public StringResourcePersistenceImpl_BASE
270cdf0e10cSrcweir {
271cdf0e10cSrcweir protected:
272cdf0e10cSrcweir 	::rtl::OUString																m_aNameBase;
273cdf0e10cSrcweir 	::rtl::OUString																m_aComment;
274cdf0e10cSrcweir 
275cdf0e10cSrcweir     void SAL_CALL implInitializeCommonParameters
276cdf0e10cSrcweir 		( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
277cdf0e10cSrcweir 			throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
278cdf0e10cSrcweir 
279cdf0e10cSrcweir 	// Scan locale properties files
280cdf0e10cSrcweir 	virtual void implScanLocales( void );
281cdf0e10cSrcweir 
282cdf0e10cSrcweir 	// Method to load a locale if necessary, returns true if loading was successful
283cdf0e10cSrcweir 	virtual bool loadLocale( LocaleItem* pLocaleItem );
284cdf0e10cSrcweir 
285cdf0e10cSrcweir 	// does the actual loading
286cdf0e10cSrcweir 	virtual bool implLoadLocale( LocaleItem* pLocaleItem );
287cdf0e10cSrcweir 
288cdf0e10cSrcweir 	virtual void implLoadAllLocales( void );
289cdf0e10cSrcweir 
290cdf0e10cSrcweir 	void implScanLocaleNames( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aContentSeq );
291cdf0e10cSrcweir 	::rtl::OUString implGetFileNameForLocaleItem( LocaleItem* pLocaleItem, const ::rtl::OUString& aNameBase );
292cdf0e10cSrcweir 	::rtl::OUString implGetPathForLocaleItem( LocaleItem* pLocaleItem, const ::rtl::OUString& aNameBase,
293cdf0e10cSrcweir 		const ::rtl::OUString& aLocation, bool bDefaultFile=false );
294cdf0e10cSrcweir 
295cdf0e10cSrcweir 	bool implReadPropertiesFile( LocaleItem* pLocaleItem,
296cdf0e10cSrcweir 		const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInput );
297cdf0e10cSrcweir 
298cdf0e10cSrcweir 	bool implWritePropertiesFile( LocaleItem* pLocaleItem, const ::com::sun::star::uno::Reference
299cdf0e10cSrcweir 		< ::com::sun::star::io::XOutputStream >& xOutputStream, const ::rtl::OUString& aComment );
300cdf0e10cSrcweir 
301cdf0e10cSrcweir 	void implWriteLocaleBinary( LocaleItem* pLocaleItem, BinaryOutput& rOut );
302cdf0e10cSrcweir 
303cdf0e10cSrcweir 	void implStoreAtStorage
304cdf0e10cSrcweir 	(
305cdf0e10cSrcweir 		const ::rtl::OUString& aNameBase,
306cdf0e10cSrcweir 		const ::rtl::OUString& aComment,
307cdf0e10cSrcweir 		const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& Storage,
308cdf0e10cSrcweir 		bool bUsedForStore,
309cdf0e10cSrcweir 		bool bStoreAll
310cdf0e10cSrcweir 	)
311cdf0e10cSrcweir 	throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
312cdf0e10cSrcweir 
313cdf0e10cSrcweir 	void implKillRemovedLocaleFiles
314cdf0e10cSrcweir 	(
315cdf0e10cSrcweir 		const ::rtl::OUString& Location,
316cdf0e10cSrcweir 		const ::rtl::OUString& aNameBase,
317cdf0e10cSrcweir 		const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess >& xFileAccess
318cdf0e10cSrcweir 	)
319cdf0e10cSrcweir 	throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
320cdf0e10cSrcweir 
321cdf0e10cSrcweir 	void implKillChangedDefaultFiles
322cdf0e10cSrcweir 	(
323cdf0e10cSrcweir 		const ::rtl::OUString& Location,
324cdf0e10cSrcweir 		const ::rtl::OUString& aNameBase,
325cdf0e10cSrcweir 		const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess >& xFileAccess
326cdf0e10cSrcweir 	)
327cdf0e10cSrcweir 	throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
328cdf0e10cSrcweir 
329cdf0e10cSrcweir 	void implStoreAtLocation
330cdf0e10cSrcweir 	(
331cdf0e10cSrcweir 		const ::rtl::OUString& Location,
332cdf0e10cSrcweir 		const ::rtl::OUString& aNameBase,
333cdf0e10cSrcweir 		const ::rtl::OUString& aComment,
334cdf0e10cSrcweir 		const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess >& xFileAccess,
335cdf0e10cSrcweir 		bool bUsedForStore,
336cdf0e10cSrcweir 		bool bStoreAll,
337cdf0e10cSrcweir 		bool bKillAll = false
338cdf0e10cSrcweir 	)
339cdf0e10cSrcweir 	throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
340cdf0e10cSrcweir 
341cdf0e10cSrcweir public:
342cdf0e10cSrcweir     StringResourcePersistenceImpl(
343cdf0e10cSrcweir         const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
344cdf0e10cSrcweir     virtual ~StringResourcePersistenceImpl();
345cdf0e10cSrcweir 
346cdf0e10cSrcweir     // XServiceInfo
347cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getImplementationName(  )
348cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
349cdf0e10cSrcweir     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
350cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
351cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  )
352cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
353cdf0e10cSrcweir 
354cdf0e10cSrcweir 	// XModifyBroadcaster
355cdf0e10cSrcweir 	virtual void SAL_CALL addModifyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
356cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
357cdf0e10cSrcweir 	virtual void SAL_CALL removeModifyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
358cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
359cdf0e10cSrcweir 
360cdf0e10cSrcweir  	// XStringResourceResolver
361cdf0e10cSrcweir 	virtual ::rtl::OUString SAL_CALL resolveString( const ::rtl::OUString& ResourceID )
362cdf0e10cSrcweir 		throw (::com::sun::star::resource::MissingResourceException, ::com::sun::star::uno::RuntimeException);
363cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL resolveStringForLocale( const ::rtl::OUString& ResourceID,
364cdf0e10cSrcweir 		const ::com::sun::star::lang::Locale& locale )
365cdf0e10cSrcweir 			throw ( ::com::sun::star::resource::MissingResourceException,
366cdf0e10cSrcweir 					::com::sun::star::uno::RuntimeException);
367cdf0e10cSrcweir     virtual ::sal_Bool SAL_CALL hasEntryForId( const ::rtl::OUString& ResourceID )
368cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
369cdf0e10cSrcweir     virtual ::sal_Bool SAL_CALL hasEntryForIdAndLocale( const ::rtl::OUString& ResourceID,
370cdf0e10cSrcweir 		const ::com::sun::star::lang::Locale& locale )
371cdf0e10cSrcweir 			throw (::com::sun::star::uno::RuntimeException);
372cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getResourceIDs(  )
373cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
374cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getResourceIDsForLocale
375cdf0e10cSrcweir 		( const ::com::sun::star::lang::Locale& locale )
376cdf0e10cSrcweir 			throw (::com::sun::star::uno::RuntimeException);
377cdf0e10cSrcweir 	virtual ::com::sun::star::lang::Locale SAL_CALL getCurrentLocale(  )
378cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
379cdf0e10cSrcweir 	virtual ::com::sun::star::lang::Locale SAL_CALL getDefaultLocale(  )
380cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
381cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Sequence< ::com::sun::star::lang::Locale > SAL_CALL getLocales(  )
382cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
383cdf0e10cSrcweir 
384cdf0e10cSrcweir 	// XStringResourceManager
385cdf0e10cSrcweir 	virtual ::sal_Bool SAL_CALL isReadOnly()
386cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
387cdf0e10cSrcweir 	virtual void SAL_CALL setCurrentLocale( const ::com::sun::star::lang::Locale& locale, ::sal_Bool FindClosestMatch )
388cdf0e10cSrcweir 		throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
389cdf0e10cSrcweir 	virtual void SAL_CALL setDefaultLocale( const ::com::sun::star::lang::Locale& locale )
390cdf0e10cSrcweir 		throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException,
391cdf0e10cSrcweir 		       ::com::sun::star::lang::NoSupportException);
392cdf0e10cSrcweir     virtual void SAL_CALL setString( const ::rtl::OUString& ResourceID, const ::rtl::OUString& Str )
393cdf0e10cSrcweir 		throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
394cdf0e10cSrcweir     virtual void SAL_CALL setStringForLocale( const ::rtl::OUString& ResourceID, const ::rtl::OUString& Str,
395cdf0e10cSrcweir 		const ::com::sun::star::lang::Locale& locale )
396cdf0e10cSrcweir 			throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
397cdf0e10cSrcweir 	virtual void SAL_CALL removeId( const ::rtl::OUString& ResourceID )
398cdf0e10cSrcweir 		throw (::com::sun::star::resource::MissingResourceException, ::com::sun::star::uno::RuntimeException,
399cdf0e10cSrcweir 		       ::com::sun::star::lang::NoSupportException);
400cdf0e10cSrcweir     virtual void SAL_CALL removeIdForLocale( const ::rtl::OUString& ResourceID,
401cdf0e10cSrcweir 		const ::com::sun::star::lang::Locale& locale )
402cdf0e10cSrcweir 			throw (::com::sun::star::resource::MissingResourceException, ::com::sun::star::uno::RuntimeException,
403cdf0e10cSrcweir 				   ::com::sun::star::lang::NoSupportException);
404cdf0e10cSrcweir 	virtual void SAL_CALL newLocale( const ::com::sun::star::lang::Locale& locale )
405cdf0e10cSrcweir 		throw (::com::sun::star::container::ElementExistException, ::com::sun::star::lang::IllegalArgumentException,
406cdf0e10cSrcweir 			   ::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
407cdf0e10cSrcweir 	virtual void SAL_CALL removeLocale( const ::com::sun::star::lang::Locale& locale )
408cdf0e10cSrcweir 		throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException,
409cdf0e10cSrcweir 		       ::com::sun::star::lang::NoSupportException);
410cdf0e10cSrcweir     virtual ::sal_Int32 SAL_CALL getUniqueNumericId(  )
411cdf0e10cSrcweir 		throw (::com::sun::star::lang::NoSupportException,
412cdf0e10cSrcweir 			   ::com::sun::star::uno::RuntimeException);
413cdf0e10cSrcweir 
414cdf0e10cSrcweir 	// XStringResourcePersistence
415cdf0e10cSrcweir     virtual void SAL_CALL store(  )
416cdf0e10cSrcweir 		throw (::com::sun::star::lang::NoSupportException,
417cdf0e10cSrcweir 			   ::com::sun::star::uno::Exception,
418cdf0e10cSrcweir 			   ::com::sun::star::uno::RuntimeException);
419cdf0e10cSrcweir     virtual ::sal_Bool SAL_CALL isModified(  )
420cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
421cdf0e10cSrcweir     virtual void SAL_CALL setComment( const ::rtl::OUString& Comment )
422cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
423cdf0e10cSrcweir 	virtual void SAL_CALL storeToStorage
424cdf0e10cSrcweir 		( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& Storage,
425cdf0e10cSrcweir 		  const ::rtl::OUString& NameBase, const ::rtl::OUString& Comment )
426cdf0e10cSrcweir 			throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
427cdf0e10cSrcweir     virtual void SAL_CALL storeToURL( const ::rtl::OUString& URL, const ::rtl::OUString& NameBase,
428cdf0e10cSrcweir 		const ::rtl::OUString& Comment,	const ::com::sun::star::uno::Reference
429cdf0e10cSrcweir 		< ::com::sun::star::task::XInteractionHandler >& Handler )
430cdf0e10cSrcweir 			throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
431cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::sal_Int8 > SAL_CALL exportBinary(  )
432cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
433cdf0e10cSrcweir     virtual void SAL_CALL importBinary( const ::com::sun::star::uno::Sequence< ::sal_Int8 >& Data )
434cdf0e10cSrcweir 		throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
435cdf0e10cSrcweir };
436cdf0e10cSrcweir 
437cdf0e10cSrcweir 
438cdf0e10cSrcweir typedef ::cppu::ImplInheritanceHelper2<
439cdf0e10cSrcweir 		StringResourcePersistenceImpl,
440cdf0e10cSrcweir 	    ::com::sun::star::lang::XInitialization,
441cdf0e10cSrcweir 		::com::sun::star::resource::XStringResourceWithStorage > StringResourceWithStorageImpl_BASE;
442cdf0e10cSrcweir 
443cdf0e10cSrcweir class StringResourceWithStorageImpl : public StringResourceWithStorageImpl_BASE
444cdf0e10cSrcweir {
445cdf0e10cSrcweir 	::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >		m_xStorage;
446cdf0e10cSrcweir 	bool																		m_bStorageChanged;
447cdf0e10cSrcweir 
448cdf0e10cSrcweir 	virtual void implScanLocales( void );
449cdf0e10cSrcweir 	virtual bool implLoadLocale( LocaleItem* pLocaleItem );
450cdf0e10cSrcweir 
451cdf0e10cSrcweir public:
452cdf0e10cSrcweir     StringResourceWithStorageImpl(
453cdf0e10cSrcweir         const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
454cdf0e10cSrcweir     virtual ~StringResourceWithStorageImpl();
455cdf0e10cSrcweir 
456cdf0e10cSrcweir     // XServiceInfo
457cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getImplementationName(  )
458cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
459cdf0e10cSrcweir     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
460cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
461cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  )
462cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
463cdf0e10cSrcweir 
464cdf0e10cSrcweir     // XInitialization
465cdf0e10cSrcweir     virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
466cdf0e10cSrcweir         throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
467cdf0e10cSrcweir 
468cdf0e10cSrcweir 	// XModifyBroadcaster
469cdf0e10cSrcweir 	virtual void SAL_CALL addModifyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
470cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
471cdf0e10cSrcweir 	virtual void SAL_CALL removeModifyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
472cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
473cdf0e10cSrcweir 
474cdf0e10cSrcweir  	// XStringResourceResolver
475cdf0e10cSrcweir 	virtual ::rtl::OUString SAL_CALL resolveString( const ::rtl::OUString& ResourceID )
476cdf0e10cSrcweir 		throw (::com::sun::star::resource::MissingResourceException, ::com::sun::star::uno::RuntimeException);
477cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL resolveStringForLocale( const ::rtl::OUString& ResourceID,
478cdf0e10cSrcweir 		const ::com::sun::star::lang::Locale& locale )
479cdf0e10cSrcweir 			throw ( ::com::sun::star::resource::MissingResourceException,
480cdf0e10cSrcweir 					::com::sun::star::uno::RuntimeException);
481cdf0e10cSrcweir     virtual ::sal_Bool SAL_CALL hasEntryForId( const ::rtl::OUString& ResourceID )
482cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
483cdf0e10cSrcweir     virtual ::sal_Bool SAL_CALL hasEntryForIdAndLocale( const ::rtl::OUString& ResourceID,
484cdf0e10cSrcweir 		const ::com::sun::star::lang::Locale& locale )
485cdf0e10cSrcweir 			throw (::com::sun::star::uno::RuntimeException);
486cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getResourceIDs(  )
487cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
488cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getResourceIDsForLocale
489cdf0e10cSrcweir 		( const ::com::sun::star::lang::Locale& locale )
490cdf0e10cSrcweir 			throw (::com::sun::star::uno::RuntimeException);
491cdf0e10cSrcweir 	virtual ::com::sun::star::lang::Locale SAL_CALL getCurrentLocale(  )
492cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
493cdf0e10cSrcweir 	virtual ::com::sun::star::lang::Locale SAL_CALL getDefaultLocale(  )
494cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
495cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Sequence< ::com::sun::star::lang::Locale > SAL_CALL getLocales(  )
496cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
497cdf0e10cSrcweir 
498cdf0e10cSrcweir 	// XStringResourceManager
499cdf0e10cSrcweir 	virtual ::sal_Bool SAL_CALL isReadOnly()
500cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
501cdf0e10cSrcweir 	virtual void SAL_CALL setCurrentLocale( const ::com::sun::star::lang::Locale& locale, ::sal_Bool FindClosestMatch )
502cdf0e10cSrcweir 		throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
503cdf0e10cSrcweir 	virtual void SAL_CALL setDefaultLocale( const ::com::sun::star::lang::Locale& locale )
504cdf0e10cSrcweir 		throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException,
505cdf0e10cSrcweir 		       ::com::sun::star::lang::NoSupportException);
506cdf0e10cSrcweir     virtual void SAL_CALL setString( const ::rtl::OUString& ResourceID, const ::rtl::OUString& Str )
507cdf0e10cSrcweir 		throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
508cdf0e10cSrcweir     virtual void SAL_CALL setStringForLocale( const ::rtl::OUString& ResourceID, const ::rtl::OUString& Str,
509cdf0e10cSrcweir 		const ::com::sun::star::lang::Locale& locale )
510cdf0e10cSrcweir 			throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
511cdf0e10cSrcweir 	virtual void SAL_CALL removeId( const ::rtl::OUString& ResourceID )
512cdf0e10cSrcweir 		throw (::com::sun::star::resource::MissingResourceException, ::com::sun::star::uno::RuntimeException,
513cdf0e10cSrcweir 		       ::com::sun::star::lang::NoSupportException);
514cdf0e10cSrcweir     virtual void SAL_CALL removeIdForLocale( const ::rtl::OUString& ResourceID,
515cdf0e10cSrcweir 		const ::com::sun::star::lang::Locale& locale )
516cdf0e10cSrcweir 			throw (::com::sun::star::resource::MissingResourceException, ::com::sun::star::uno::RuntimeException,
517cdf0e10cSrcweir 				   ::com::sun::star::lang::NoSupportException);
518cdf0e10cSrcweir 	virtual void SAL_CALL newLocale( const ::com::sun::star::lang::Locale& locale )
519cdf0e10cSrcweir 		throw (::com::sun::star::container::ElementExistException, ::com::sun::star::lang::IllegalArgumentException,
520cdf0e10cSrcweir 			   ::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
521cdf0e10cSrcweir 	virtual void SAL_CALL removeLocale( const ::com::sun::star::lang::Locale& locale )
522cdf0e10cSrcweir 		throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException,
523cdf0e10cSrcweir 		       ::com::sun::star::lang::NoSupportException);
524cdf0e10cSrcweir     virtual ::sal_Int32 SAL_CALL getUniqueNumericId(  )
525cdf0e10cSrcweir 		throw (::com::sun::star::lang::NoSupportException,
526cdf0e10cSrcweir 			   ::com::sun::star::uno::RuntimeException);
527cdf0e10cSrcweir 
528cdf0e10cSrcweir 	// XStringResourcePersistence
529cdf0e10cSrcweir     virtual void SAL_CALL store(  )
530cdf0e10cSrcweir 		throw (::com::sun::star::lang::NoSupportException,
531cdf0e10cSrcweir 			   ::com::sun::star::uno::Exception,
532cdf0e10cSrcweir 			   ::com::sun::star::uno::RuntimeException);
533cdf0e10cSrcweir     virtual ::sal_Bool SAL_CALL isModified(  )
534cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
535cdf0e10cSrcweir     virtual void SAL_CALL setComment( const ::rtl::OUString& Comment )
536cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
537cdf0e10cSrcweir     virtual void SAL_CALL storeToStorage
538cdf0e10cSrcweir 		( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& Storage,
539cdf0e10cSrcweir 		  const ::rtl::OUString& NameBase, const ::rtl::OUString& Comment )
540cdf0e10cSrcweir 			throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
541cdf0e10cSrcweir     virtual void SAL_CALL storeToURL( const ::rtl::OUString& URL, const ::rtl::OUString& NameBase,
542cdf0e10cSrcweir 		const ::rtl::OUString& Comment, const ::com::sun::star::uno::Reference
543cdf0e10cSrcweir 		< ::com::sun::star::task::XInteractionHandler >& Handler )
544cdf0e10cSrcweir 			throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
545cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::sal_Int8 > SAL_CALL exportBinary(  )
546cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
547cdf0e10cSrcweir     virtual void SAL_CALL importBinary( const ::com::sun::star::uno::Sequence< ::sal_Int8 >& Data )
548cdf0e10cSrcweir 		throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
549cdf0e10cSrcweir 
550cdf0e10cSrcweir 	// XStringResourceWithStorage
551cdf0e10cSrcweir     virtual void SAL_CALL storeAsStorage
552cdf0e10cSrcweir 		( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& Storage )
553cdf0e10cSrcweir 			throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
554cdf0e10cSrcweir     virtual void SAL_CALL setStorage
555cdf0e10cSrcweir 		( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& Storage )
556cdf0e10cSrcweir 			throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
557cdf0e10cSrcweir };
558cdf0e10cSrcweir 
559cdf0e10cSrcweir 
560cdf0e10cSrcweir typedef ::cppu::ImplInheritanceHelper2<
561cdf0e10cSrcweir 		StringResourcePersistenceImpl,
562cdf0e10cSrcweir 	    ::com::sun::star::lang::XInitialization,
563cdf0e10cSrcweir 		::com::sun::star::resource::XStringResourceWithLocation > StringResourceWithLocationImpl_BASE;
564cdf0e10cSrcweir 
565cdf0e10cSrcweir class StringResourceWithLocationImpl : public StringResourceWithLocationImpl_BASE
566cdf0e10cSrcweir {
567cdf0e10cSrcweir 	::rtl::OUString																m_aLocation;
568cdf0e10cSrcweir 	bool																		m_bLocationChanged;
569cdf0e10cSrcweir 	com::sun::star::uno::Reference< com::sun::star::ucb::XSimpleFileAccess >	m_xSFI;
570cdf0e10cSrcweir 	com::sun::star::uno::Reference< com::sun::star::task::XInteractionHandler >	m_xInteractionHandler;
571cdf0e10cSrcweir 
572cdf0e10cSrcweir 	const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess > getFileAccess( void );
573cdf0e10cSrcweir 
574cdf0e10cSrcweir 	virtual void implScanLocales( void );
575cdf0e10cSrcweir 	virtual bool implLoadLocale( LocaleItem* pLocaleItem );
576cdf0e10cSrcweir 
577cdf0e10cSrcweir public:
578cdf0e10cSrcweir     StringResourceWithLocationImpl(
579cdf0e10cSrcweir         const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
580cdf0e10cSrcweir     virtual ~StringResourceWithLocationImpl();
581cdf0e10cSrcweir 
582cdf0e10cSrcweir     // XServiceInfo
583cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getImplementationName(  )
584cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
585cdf0e10cSrcweir     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
586cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
587cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  )
588cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
589cdf0e10cSrcweir 
590cdf0e10cSrcweir     // XInitialization
591cdf0e10cSrcweir     virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
592cdf0e10cSrcweir         throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
593cdf0e10cSrcweir 
594cdf0e10cSrcweir 	// XModifyBroadcaster
595cdf0e10cSrcweir 	virtual void SAL_CALL addModifyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
596cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
597cdf0e10cSrcweir 	virtual void SAL_CALL removeModifyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
598cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
599cdf0e10cSrcweir 
600cdf0e10cSrcweir  	// XStringResourceResolver
601cdf0e10cSrcweir 	virtual ::rtl::OUString SAL_CALL resolveString( const ::rtl::OUString& ResourceID )
602cdf0e10cSrcweir 		throw (::com::sun::star::resource::MissingResourceException, ::com::sun::star::uno::RuntimeException);
603cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL resolveStringForLocale( const ::rtl::OUString& ResourceID,
604cdf0e10cSrcweir 		const ::com::sun::star::lang::Locale& locale )
605cdf0e10cSrcweir 			throw ( ::com::sun::star::resource::MissingResourceException,
606cdf0e10cSrcweir 					::com::sun::star::uno::RuntimeException);
607cdf0e10cSrcweir     virtual ::sal_Bool SAL_CALL hasEntryForId( const ::rtl::OUString& ResourceID )
608cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
609cdf0e10cSrcweir     virtual ::sal_Bool SAL_CALL hasEntryForIdAndLocale( const ::rtl::OUString& ResourceID,
610cdf0e10cSrcweir 		const ::com::sun::star::lang::Locale& locale )
611cdf0e10cSrcweir 			throw (::com::sun::star::uno::RuntimeException);
612cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getResourceIDs(  )
613cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
614cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getResourceIDsForLocale
615cdf0e10cSrcweir 		( const ::com::sun::star::lang::Locale& locale )
616cdf0e10cSrcweir 			throw (::com::sun::star::uno::RuntimeException);
617cdf0e10cSrcweir 	virtual ::com::sun::star::lang::Locale SAL_CALL getCurrentLocale(  )
618cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
619cdf0e10cSrcweir 	virtual ::com::sun::star::lang::Locale SAL_CALL getDefaultLocale(  )
620cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
621cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Sequence< ::com::sun::star::lang::Locale > SAL_CALL getLocales(  )
622cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
623cdf0e10cSrcweir 
624cdf0e10cSrcweir 	// XStringResourceManager
625cdf0e10cSrcweir 	virtual ::sal_Bool SAL_CALL isReadOnly()
626cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
627cdf0e10cSrcweir 	virtual void SAL_CALL setCurrentLocale( const ::com::sun::star::lang::Locale& locale, ::sal_Bool FindClosestMatch )
628cdf0e10cSrcweir 		throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
629cdf0e10cSrcweir 	virtual void SAL_CALL setDefaultLocale( const ::com::sun::star::lang::Locale& locale )
630cdf0e10cSrcweir 		throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException,
631cdf0e10cSrcweir 		       ::com::sun::star::lang::NoSupportException);
632cdf0e10cSrcweir     virtual void SAL_CALL setString( const ::rtl::OUString& ResourceID, const ::rtl::OUString& Str )
633cdf0e10cSrcweir 		throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
634cdf0e10cSrcweir     virtual void SAL_CALL setStringForLocale( const ::rtl::OUString& ResourceID, const ::rtl::OUString& Str,
635cdf0e10cSrcweir 		const ::com::sun::star::lang::Locale& locale )
636cdf0e10cSrcweir 			throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
637cdf0e10cSrcweir 	virtual void SAL_CALL removeId( const ::rtl::OUString& ResourceID )
638cdf0e10cSrcweir 		throw (::com::sun::star::resource::MissingResourceException, ::com::sun::star::uno::RuntimeException,
639cdf0e10cSrcweir 		       ::com::sun::star::lang::NoSupportException);
640cdf0e10cSrcweir     virtual void SAL_CALL removeIdForLocale( const ::rtl::OUString& ResourceID,
641cdf0e10cSrcweir 		const ::com::sun::star::lang::Locale& locale )
642cdf0e10cSrcweir 			throw (::com::sun::star::resource::MissingResourceException, ::com::sun::star::uno::RuntimeException,
643cdf0e10cSrcweir 				   ::com::sun::star::lang::NoSupportException);
644cdf0e10cSrcweir 	virtual void SAL_CALL newLocale( const ::com::sun::star::lang::Locale& locale )
645cdf0e10cSrcweir 		throw (::com::sun::star::container::ElementExistException, ::com::sun::star::lang::IllegalArgumentException,
646cdf0e10cSrcweir 			   ::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
647cdf0e10cSrcweir 	virtual void SAL_CALL removeLocale( const ::com::sun::star::lang::Locale& locale )
648cdf0e10cSrcweir 		throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException,
649cdf0e10cSrcweir 		       ::com::sun::star::lang::NoSupportException);
650cdf0e10cSrcweir     virtual ::sal_Int32 SAL_CALL getUniqueNumericId(  )
651cdf0e10cSrcweir 		throw (::com::sun::star::lang::NoSupportException,
652cdf0e10cSrcweir 			   ::com::sun::star::uno::RuntimeException);
653cdf0e10cSrcweir 
654cdf0e10cSrcweir 	// XStringResourcePersistence
655cdf0e10cSrcweir     virtual void SAL_CALL store(  )
656cdf0e10cSrcweir 		throw (::com::sun::star::lang::NoSupportException,
657cdf0e10cSrcweir 			   ::com::sun::star::uno::Exception,
658cdf0e10cSrcweir 			   ::com::sun::star::uno::RuntimeException);
659cdf0e10cSrcweir     virtual ::sal_Bool SAL_CALL isModified(  )
660cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
661cdf0e10cSrcweir     virtual void SAL_CALL setComment( const ::rtl::OUString& Comment )
662cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
663cdf0e10cSrcweir     virtual void SAL_CALL storeToStorage
664cdf0e10cSrcweir 		( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& Storage,
665cdf0e10cSrcweir 		  const ::rtl::OUString& NameBase, const ::rtl::OUString& Comment )
666cdf0e10cSrcweir 			throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
667cdf0e10cSrcweir     virtual void SAL_CALL storeToURL( const ::rtl::OUString& URL, const ::rtl::OUString& NameBase,
668cdf0e10cSrcweir 		const ::rtl::OUString& Comment, const ::com::sun::star::uno::Reference
669cdf0e10cSrcweir 		< ::com::sun::star::task::XInteractionHandler >& Handler )
670cdf0e10cSrcweir 			throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
671cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::sal_Int8 > SAL_CALL exportBinary(  )
672cdf0e10cSrcweir 		throw (::com::sun::star::uno::RuntimeException);
673cdf0e10cSrcweir     virtual void SAL_CALL importBinary( const ::com::sun::star::uno::Sequence< ::sal_Int8 >& Data )
674cdf0e10cSrcweir 		throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
675cdf0e10cSrcweir 
676cdf0e10cSrcweir 	// XStringResourceWithLocation
677cdf0e10cSrcweir     virtual void SAL_CALL storeAsURL( const ::rtl::OUString& URL )
678cdf0e10cSrcweir 		throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
679cdf0e10cSrcweir     virtual void SAL_CALL setURL( const ::rtl::OUString& URL )
680cdf0e10cSrcweir 		throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
681cdf0e10cSrcweir };
682cdf0e10cSrcweir 
683cdf0e10cSrcweir //.........................................................................
684cdf0e10cSrcweir }	// namespace stringtable
685cdf0e10cSrcweir //.........................................................................
686cdf0e10cSrcweir 
687cdf0e10cSrcweir #endif // SCRIPTING_DLGPROV_HXX
688