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