1*f6a6b25fSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*f6a6b25fSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*f6a6b25fSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*f6a6b25fSAndrew Rist * distributed with this work for additional information 6*f6a6b25fSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*f6a6b25fSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*f6a6b25fSAndrew Rist * "License"); you may not use this file except in compliance 9*f6a6b25fSAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*f6a6b25fSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*f6a6b25fSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*f6a6b25fSAndrew Rist * software distributed under the License is distributed on an 15*f6a6b25fSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*f6a6b25fSAndrew Rist * KIND, either express or implied. See the License for the 17*f6a6b25fSAndrew Rist * specific language governing permissions and limitations 18*f6a6b25fSAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*f6a6b25fSAndrew Rist *************************************************************/ 21*f6a6b25fSAndrew Rist 22*f6a6b25fSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir //------------------------------------------------------------------ 25cdf0e10cSrcweir // 26cdf0e10cSrcweir // date functions add in 27cdf0e10cSrcweir // 28cdf0e10cSrcweir //------------------------------------------------------------------ 29cdf0e10cSrcweir 30cdf0e10cSrcweir #ifndef _SCA_DATEFUNC_HXX 31cdf0e10cSrcweir #define _SCA_DATEFUNC_HXX 32cdf0e10cSrcweir 33cdf0e10cSrcweir #include <string.h> 34cdf0e10cSrcweir #include <com/sun/star/lang/XServiceName.hpp> 35cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp> 36cdf0e10cSrcweir #include <com/sun/star/sheet/XAddIn.hpp> 37cdf0e10cSrcweir #include <com/sun/star/sheet/XCompatibilityNames.hpp> 38cdf0e10cSrcweir #include <com/sun/star/sheet/addin/XDateFunctions.hpp> 39cdf0e10cSrcweir #include <com/sun/star/sheet/addin/XMiscFunctions.hpp> 40cdf0e10cSrcweir #include <cppuhelper/implbase6.hxx> // helper for implementations 41cdf0e10cSrcweir #include <tools/resid.hxx> 42cdf0e10cSrcweir #include <tools/rc.hxx> 43cdf0e10cSrcweir #include <tools/resary.hxx> 44cdf0e10cSrcweir 45cdf0e10cSrcweir //------------------------------------------------------------------ 46cdf0e10cSrcweir 47cdf0e10cSrcweir class ScaList 48cdf0e10cSrcweir { 49cdf0e10cSrcweir private: 50cdf0e10cSrcweir static const sal_uInt32 nStartSize; 51cdf0e10cSrcweir static const sal_uInt32 nIncrSize; 52cdf0e10cSrcweir 53cdf0e10cSrcweir void** pData; // pointer array 54cdf0e10cSrcweir sal_uInt32 nSize; // array size 55cdf0e10cSrcweir sal_uInt32 nCount; // next index to be inserted at 56cdf0e10cSrcweir sal_uInt32 nCurr; // current pos for iterations 57cdf0e10cSrcweir 58cdf0e10cSrcweir void _Grow(); 59cdf0e10cSrcweir inline void Grow(); 60cdf0e10cSrcweir 61cdf0e10cSrcweir public: 62cdf0e10cSrcweir ScaList(); 63cdf0e10cSrcweir virtual ~ScaList(); 64cdf0e10cSrcweir 65cdf0e10cSrcweir inline sal_uInt32 Count() const { return nCount; } 66cdf0e10cSrcweir 67cdf0e10cSrcweir inline const void* GetObject( sal_uInt32 nIndex ) const 68cdf0e10cSrcweir { return (nIndex < nCount) ? pData[ nIndex ] : NULL; } 69cdf0e10cSrcweir 70cdf0e10cSrcweir inline void* First() { return nCount ? pData[ nCurr = 0 ] : NULL; } 71cdf0e10cSrcweir inline void* Next() { return (nCurr + 1 < nCount) ? pData[ ++nCurr ] : NULL; } 72cdf0e10cSrcweir 73cdf0e10cSrcweir inline void Append( void* pNew ); 74cdf0e10cSrcweir void Insert( void* pNew, sal_uInt32 nIndex ); 75cdf0e10cSrcweir }; 76cdf0e10cSrcweir 77cdf0e10cSrcweir 78cdf0e10cSrcweir inline void ScaList::Grow() 79cdf0e10cSrcweir { 80cdf0e10cSrcweir if( nCount >= nSize ) 81cdf0e10cSrcweir _Grow(); 82cdf0e10cSrcweir } 83cdf0e10cSrcweir 84cdf0e10cSrcweir inline void ScaList::Append( void* pNew ) 85cdf0e10cSrcweir { 86cdf0e10cSrcweir Grow(); 87cdf0e10cSrcweir pData[ nCount++ ] = pNew; 88cdf0e10cSrcweir } 89cdf0e10cSrcweir 90cdf0e10cSrcweir 91cdf0e10cSrcweir //------------------------------------------------------------------ 92cdf0e10cSrcweir 93cdf0e10cSrcweir class ScaStringList : protected ScaList 94cdf0e10cSrcweir { 95cdf0e10cSrcweir public: 96cdf0e10cSrcweir inline ScaStringList() : ScaList() {}; 97cdf0e10cSrcweir virtual ~ScaStringList(); 98cdf0e10cSrcweir 99cdf0e10cSrcweir using ScaList::Count; 100cdf0e10cSrcweir 101cdf0e10cSrcweir inline const ::rtl::OUString* Get( sal_uInt32 nIndex ) const; 102cdf0e10cSrcweir 103cdf0e10cSrcweir inline ::rtl::OUString* First(); 104cdf0e10cSrcweir inline ::rtl::OUString* Next(); 105cdf0e10cSrcweir 106cdf0e10cSrcweir using ScaList::Append; 107cdf0e10cSrcweir inline void Append( ::rtl::OUString* pNew ); 108cdf0e10cSrcweir inline void Append( const ::rtl::OUString& rNew ); 109cdf0e10cSrcweir }; 110cdf0e10cSrcweir 111cdf0e10cSrcweir 112cdf0e10cSrcweir inline const ::rtl::OUString* ScaStringList::Get( sal_uInt32 nIndex ) const 113cdf0e10cSrcweir { 114cdf0e10cSrcweir return static_cast< const ::rtl::OUString* >( ScaList::GetObject( nIndex ) ); 115cdf0e10cSrcweir } 116cdf0e10cSrcweir 117cdf0e10cSrcweir inline ::rtl::OUString* ScaStringList::First() 118cdf0e10cSrcweir { 119cdf0e10cSrcweir return static_cast< ::rtl::OUString* >( ScaList::First() ); 120cdf0e10cSrcweir } 121cdf0e10cSrcweir 122cdf0e10cSrcweir inline ::rtl::OUString* ScaStringList::Next() 123cdf0e10cSrcweir { 124cdf0e10cSrcweir return static_cast< ::rtl::OUString* >( ScaList::Next() ); 125cdf0e10cSrcweir } 126cdf0e10cSrcweir 127cdf0e10cSrcweir inline void ScaStringList::Append( ::rtl::OUString* pNew ) 128cdf0e10cSrcweir { 129cdf0e10cSrcweir ScaList::Append( pNew ); 130cdf0e10cSrcweir } 131cdf0e10cSrcweir 132cdf0e10cSrcweir inline void ScaStringList::Append( const ::rtl::OUString& rNew ) 133cdf0e10cSrcweir { 134cdf0e10cSrcweir ScaList::Append( new ::rtl::OUString( rNew ) ); 135cdf0e10cSrcweir } 136cdf0e10cSrcweir 137cdf0e10cSrcweir 138cdf0e10cSrcweir //------------------------------------------------------------------ 139cdf0e10cSrcweir 140cdf0e10cSrcweir class ScaResId : public ResId 141cdf0e10cSrcweir { 142cdf0e10cSrcweir public: 143cdf0e10cSrcweir ScaResId( sal_uInt16 nResId, ResMgr& rResMgr ); 144cdf0e10cSrcweir }; 145cdf0e10cSrcweir 146cdf0e10cSrcweir 147cdf0e10cSrcweir //------------------------------------------------------------------ 148cdf0e10cSrcweir 149cdf0e10cSrcweir class ScaResStringLoader : public Resource 150cdf0e10cSrcweir { 151cdf0e10cSrcweir private: 152cdf0e10cSrcweir String aStr; 153cdf0e10cSrcweir 154cdf0e10cSrcweir public: 155cdf0e10cSrcweir inline ScaResStringLoader( sal_uInt16 nResId, sal_uInt16 nStrId, ResMgr& rResMgr ); 156cdf0e10cSrcweir 157cdf0e10cSrcweir inline const String& GetString() const { return aStr; } 158cdf0e10cSrcweir 159cdf0e10cSrcweir }; 160cdf0e10cSrcweir 161cdf0e10cSrcweir 162cdf0e10cSrcweir inline ScaResStringLoader::ScaResStringLoader( sal_uInt16 nResId, sal_uInt16 nStrId, ResMgr& rResMgr ) : 163cdf0e10cSrcweir Resource( ScaResId( nResId, rResMgr ) ), 164cdf0e10cSrcweir aStr( ScaResId( nStrId, rResMgr ) ) 165cdf0e10cSrcweir { 166cdf0e10cSrcweir FreeResource(); 167cdf0e10cSrcweir } 168cdf0e10cSrcweir 169cdf0e10cSrcweir 170cdf0e10cSrcweir //------------------------------------------------------------------ 171cdf0e10cSrcweir 172cdf0e10cSrcweir class ScaResStringArrLoader : public Resource 173cdf0e10cSrcweir { 174cdf0e10cSrcweir private: 175cdf0e10cSrcweir ResStringArray aStrArray; 176cdf0e10cSrcweir 177cdf0e10cSrcweir public: 178cdf0e10cSrcweir inline ScaResStringArrLoader( sal_uInt16 nResId, sal_uInt16 nArrayId, ResMgr& rResMgr ); 179cdf0e10cSrcweir 180cdf0e10cSrcweir inline const ResStringArray& GetStringArray() const { return aStrArray; } 181cdf0e10cSrcweir }; 182cdf0e10cSrcweir 183cdf0e10cSrcweir 184cdf0e10cSrcweir 185cdf0e10cSrcweir inline ScaResStringArrLoader::ScaResStringArrLoader( sal_uInt16 nResId, sal_uInt16 nArrayId, ResMgr& rResMgr ) : 186cdf0e10cSrcweir Resource( ScaResId( nResId, rResMgr ) ), 187cdf0e10cSrcweir aStrArray( ScaResId( nArrayId, rResMgr ) ) 188cdf0e10cSrcweir { 189cdf0e10cSrcweir FreeResource(); 190cdf0e10cSrcweir } 191cdf0e10cSrcweir 192cdf0e10cSrcweir 193cdf0e10cSrcweir //------------------------------------------------------------------ 194cdf0e10cSrcweir 195cdf0e10cSrcweir class ScaResPublisher : public Resource 196cdf0e10cSrcweir { 197cdf0e10cSrcweir public: 198cdf0e10cSrcweir inline ScaResPublisher( const ScaResId& rResId ) : Resource( rResId ) {} 199cdf0e10cSrcweir 200cdf0e10cSrcweir inline sal_Bool IsAvailableRes( const ResId& rResId ) const 201cdf0e10cSrcweir { return Resource::IsAvailableRes( rResId ); } 202cdf0e10cSrcweir inline void FreeResource() 203cdf0e10cSrcweir { Resource::FreeResource(); } 204cdf0e10cSrcweir }; 205cdf0e10cSrcweir 206cdf0e10cSrcweir 207cdf0e10cSrcweir //------------------------------------------------------------------ 208cdf0e10cSrcweir 209cdf0e10cSrcweir class ScaFuncRes : public Resource 210cdf0e10cSrcweir { 211cdf0e10cSrcweir public: 212cdf0e10cSrcweir ScaFuncRes( ResId& rResId, ResMgr& rResMgr, sal_uInt16 nIndex, ::rtl::OUString& rRet ); 213cdf0e10cSrcweir }; 214cdf0e10cSrcweir 215cdf0e10cSrcweir 216cdf0e10cSrcweir //------------------------------------------------------------------ 217cdf0e10cSrcweir 218cdf0e10cSrcweir enum ScaCategory 219cdf0e10cSrcweir { 220cdf0e10cSrcweir ScaCat_AddIn, 221cdf0e10cSrcweir ScaCat_DateTime, 222cdf0e10cSrcweir ScaCat_Text, 223cdf0e10cSrcweir ScaCat_Finance, 224cdf0e10cSrcweir ScaCat_Inf, 225cdf0e10cSrcweir ScaCat_Math, 226cdf0e10cSrcweir ScaCat_Tech 227cdf0e10cSrcweir }; 228cdf0e10cSrcweir 229cdf0e10cSrcweir struct ScaFuncDataBase 230cdf0e10cSrcweir { 231cdf0e10cSrcweir const sal_Char* pIntName; // internal name (get***) 232cdf0e10cSrcweir sal_uInt16 nUINameID; // resource ID to UI name 233cdf0e10cSrcweir sal_uInt16 nDescrID; // resource ID to description, parameter names and ~ description 234cdf0e10cSrcweir sal_uInt16 nCompListID; // resource ID to list of valid names 235cdf0e10cSrcweir sal_uInt16 nParamCount; // number of named / described parameters 236cdf0e10cSrcweir ScaCategory eCat; // function category 237cdf0e10cSrcweir sal_Bool bDouble; // name already exist in Calc 238cdf0e10cSrcweir sal_Bool bWithOpt; // first parameter is internal 239cdf0e10cSrcweir }; 240cdf0e10cSrcweir 241cdf0e10cSrcweir class ScaFuncData 242cdf0e10cSrcweir { 243cdf0e10cSrcweir private: 244cdf0e10cSrcweir ::rtl::OUString aIntName; // internal name (get***) 245cdf0e10cSrcweir sal_uInt16 nUINameID; // resource ID to UI name 246cdf0e10cSrcweir sal_uInt16 nDescrID; // leads also to parameter descriptions! 247cdf0e10cSrcweir sal_uInt16 nCompListID; // resource ID to list of valid names 248cdf0e10cSrcweir sal_uInt16 nParamCount; // num of parameters 249cdf0e10cSrcweir ScaStringList aCompList; // list of all valid names 250cdf0e10cSrcweir ScaCategory eCat; // function category 251cdf0e10cSrcweir sal_Bool bDouble; // name already exist in Calc 252cdf0e10cSrcweir sal_Bool bWithOpt; // first parameter is internal 253cdf0e10cSrcweir 254cdf0e10cSrcweir public: 255cdf0e10cSrcweir ScaFuncData( const ScaFuncDataBase& rBaseData, ResMgr& rRscMgr ); 256cdf0e10cSrcweir virtual ~ScaFuncData(); 257cdf0e10cSrcweir 258cdf0e10cSrcweir inline sal_uInt16 GetUINameID() const { return nUINameID; } 259cdf0e10cSrcweir inline sal_uInt16 GetDescrID() const { return nDescrID; } 260cdf0e10cSrcweir inline ScaCategory GetCategory() const { return eCat; } 261cdf0e10cSrcweir inline sal_Bool IsDouble() const { return bDouble; } 262cdf0e10cSrcweir inline sal_Bool HasIntParam() const { return bWithOpt; } 263cdf0e10cSrcweir 264cdf0e10cSrcweir sal_uInt16 GetStrIndex( sal_uInt16 nParam ) const; 265cdf0e10cSrcweir inline sal_Bool Is( const ::rtl::OUString& rCompare ) const 266cdf0e10cSrcweir { return aIntName == rCompare; } 267cdf0e10cSrcweir 268cdf0e10cSrcweir inline const ScaStringList& GetCompNameList() const { return aCompList; } 269cdf0e10cSrcweir }; 270cdf0e10cSrcweir 271cdf0e10cSrcweir 272cdf0e10cSrcweir //------------------------------------------------------------------ 273cdf0e10cSrcweir 274cdf0e10cSrcweir class ScaFuncDataList : private ScaList 275cdf0e10cSrcweir { 276cdf0e10cSrcweir ::rtl::OUString aLastName; 277cdf0e10cSrcweir sal_uInt32 nLast; 278cdf0e10cSrcweir 279cdf0e10cSrcweir public: 280cdf0e10cSrcweir ScaFuncDataList( ResMgr& rResMgr ); 281cdf0e10cSrcweir virtual ~ScaFuncDataList(); 282cdf0e10cSrcweir 283cdf0e10cSrcweir using ScaList::Count; 284cdf0e10cSrcweir 285cdf0e10cSrcweir inline const ScaFuncData* Get( sal_uInt32 nIndex ) const; 286cdf0e10cSrcweir const ScaFuncData* Get( const ::rtl::OUString& rProgrammaticName ) const; 287cdf0e10cSrcweir inline ScaFuncData* First(); 288cdf0e10cSrcweir inline ScaFuncData* Next(); 289cdf0e10cSrcweir 290cdf0e10cSrcweir using ScaList::Append; 291cdf0e10cSrcweir inline void Append( ScaFuncData* pNew ) { ScaList::Append( pNew ); } 292cdf0e10cSrcweir }; 293cdf0e10cSrcweir 294cdf0e10cSrcweir 295cdf0e10cSrcweir inline const ScaFuncData* ScaFuncDataList::Get( sal_uInt32 nIndex ) const 296cdf0e10cSrcweir { 297cdf0e10cSrcweir return static_cast< const ScaFuncData* >( ScaList::GetObject( nIndex ) ); 298cdf0e10cSrcweir } 299cdf0e10cSrcweir 300cdf0e10cSrcweir inline ScaFuncData* ScaFuncDataList::First() 301cdf0e10cSrcweir { 302cdf0e10cSrcweir return static_cast< ScaFuncData* >( ScaList::First() ); 303cdf0e10cSrcweir } 304cdf0e10cSrcweir 305cdf0e10cSrcweir inline ScaFuncData* ScaFuncDataList::Next() 306cdf0e10cSrcweir { 307cdf0e10cSrcweir return static_cast< ScaFuncData* >( ScaList::Next() ); 308cdf0e10cSrcweir } 309cdf0e10cSrcweir 310cdf0e10cSrcweir 311cdf0e10cSrcweir //------------------------------------------------------------------ 312cdf0e10cSrcweir //------------------------------------------------------------------ 313cdf0e10cSrcweir 314cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL DateFunctionAddIn_CreateInstance( 315cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& ); 316cdf0e10cSrcweir 317cdf0e10cSrcweir 318cdf0e10cSrcweir // THE AddIn class for date functions 319cdf0e10cSrcweir 320cdf0e10cSrcweir class ScaDateAddIn : public ::cppu::WeakImplHelper6< 321cdf0e10cSrcweir ::com::sun::star::sheet::XAddIn, 322cdf0e10cSrcweir ::com::sun::star::sheet::XCompatibilityNames, 323cdf0e10cSrcweir ::com::sun::star::sheet::addin::XDateFunctions, 324cdf0e10cSrcweir ::com::sun::star::sheet::addin::XMiscFunctions, 325cdf0e10cSrcweir ::com::sun::star::lang::XServiceName, 326cdf0e10cSrcweir ::com::sun::star::lang::XServiceInfo > 327cdf0e10cSrcweir { 328cdf0e10cSrcweir private: 329cdf0e10cSrcweir ::com::sun::star::lang::Locale aFuncLoc; 330cdf0e10cSrcweir ::com::sun::star::lang::Locale* pDefLocales; 331cdf0e10cSrcweir ResMgr* pResMgr; 332cdf0e10cSrcweir ScaFuncDataList* pFuncDataList; 333cdf0e10cSrcweir 334cdf0e10cSrcweir 335cdf0e10cSrcweir void InitDefLocales(); 336cdf0e10cSrcweir const ::com::sun::star::lang::Locale& GetLocale( sal_uInt32 nIndex ); 337cdf0e10cSrcweir ResMgr& GetResMgr() throw( ::com::sun::star::uno::RuntimeException ); 338cdf0e10cSrcweir void InitData(); 339cdf0e10cSrcweir 340cdf0e10cSrcweir ::rtl::OUString GetDisplFuncStr( sal_uInt16 nResId ) throw( ::com::sun::star::uno::RuntimeException ); 341cdf0e10cSrcweir ::rtl::OUString GetFuncDescrStr( sal_uInt16 nResId, sal_uInt16 nStrIndex ) throw( ::com::sun::star::uno::RuntimeException ); 342cdf0e10cSrcweir 343cdf0e10cSrcweir public: 344cdf0e10cSrcweir ScaDateAddIn(); 345cdf0e10cSrcweir virtual ~ScaDateAddIn(); 346cdf0e10cSrcweir 347cdf0e10cSrcweir static ::rtl::OUString getImplementationName_Static(); 348cdf0e10cSrcweir static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(); 349cdf0e10cSrcweir 350cdf0e10cSrcweir // XAddIn 351cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getProgrammaticFuntionName( const ::rtl::OUString& aDisplayName ) throw( ::com::sun::star::uno::RuntimeException ); 352cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getDisplayFunctionName( const ::rtl::OUString& aProgrammaticName ) throw( ::com::sun::star::uno::RuntimeException ); 353cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getFunctionDescription( const ::rtl::OUString& aProgrammaticName ) throw( ::com::sun::star::uno::RuntimeException ); 354cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getDisplayArgumentName( const ::rtl::OUString& aProgrammaticName, sal_Int32 nArgument ) throw( ::com::sun::star::uno::RuntimeException ); 355cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getArgumentDescription( const ::rtl::OUString& aProgrammaticName, sal_Int32 nArgument ) throw( ::com::sun::star::uno::RuntimeException ); 356cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getProgrammaticCategoryName( const ::rtl::OUString& aProgrammaticName ) throw( ::com::sun::star::uno::RuntimeException ); 357cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getDisplayCategoryName( const ::rtl::OUString& aProgrammaticName ) throw( ::com::sun::star::uno::RuntimeException ); 358cdf0e10cSrcweir 359cdf0e10cSrcweir // XCompatibilityNames 360cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::LocalizedName > SAL_CALL getCompatibilityNames( const ::rtl::OUString& aProgrammaticName ) throw( ::com::sun::star::uno::RuntimeException ); 361cdf0e10cSrcweir 362cdf0e10cSrcweir // XLocalizable 363cdf0e10cSrcweir virtual void SAL_CALL setLocale( const ::com::sun::star::lang::Locale& eLocale ) throw( ::com::sun::star::uno::RuntimeException ); 364cdf0e10cSrcweir virtual ::com::sun::star::lang::Locale SAL_CALL getLocale() throw( ::com::sun::star::uno::RuntimeException ); 365cdf0e10cSrcweir 366cdf0e10cSrcweir // XServiceName 367cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getServiceName() throw( ::com::sun::star::uno::RuntimeException ); 368cdf0e10cSrcweir 369cdf0e10cSrcweir // XServiceInfo 370cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException ); 371cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw( ::com::sun::star::uno::RuntimeException ); 372cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException ); 373cdf0e10cSrcweir 374cdf0e10cSrcweir // methods from own interfaces start here 375cdf0e10cSrcweir 376cdf0e10cSrcweir // XDateFunctions 377cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getDiffWeeks( 378cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xOptions, 379cdf0e10cSrcweir sal_Int32 nEndDate, sal_Int32 nStartDate, 380cdf0e10cSrcweir sal_Int32 nMode ) 381cdf0e10cSrcweir throw( ::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException ); 382cdf0e10cSrcweir 383cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getDiffMonths( 384cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xOptions, 385cdf0e10cSrcweir sal_Int32 nEndDate, sal_Int32 nStartDate, 386cdf0e10cSrcweir sal_Int32 nMode ) 387cdf0e10cSrcweir throw( ::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException ); 388cdf0e10cSrcweir 389cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getDiffYears( 390cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xOptions, 391cdf0e10cSrcweir sal_Int32 nEndDate, sal_Int32 nStartDate, 392cdf0e10cSrcweir sal_Int32 nMode ) 393cdf0e10cSrcweir throw( ::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException ); 394cdf0e10cSrcweir 395cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getIsLeapYear( 396cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xOptions, 397cdf0e10cSrcweir sal_Int32 nDate ) 398cdf0e10cSrcweir throw( ::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException ); 399cdf0e10cSrcweir 400cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getDaysInMonth( 401cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xOptions, 402cdf0e10cSrcweir sal_Int32 nDate ) 403cdf0e10cSrcweir throw( ::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException ); 404cdf0e10cSrcweir 405cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getDaysInYear( 406cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xOptions, 407cdf0e10cSrcweir sal_Int32 nDate ) 408cdf0e10cSrcweir throw( ::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException ); 409cdf0e10cSrcweir 410cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getWeeksInYear( 411cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xOptions, 412cdf0e10cSrcweir sal_Int32 nDate ) 413cdf0e10cSrcweir throw( ::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException ); 414cdf0e10cSrcweir 415cdf0e10cSrcweir // XMiscFunctions 416cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getRot13( 417cdf0e10cSrcweir const ::rtl::OUString& aSrcText ) 418cdf0e10cSrcweir throw( ::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException ); 419cdf0e10cSrcweir }; 420cdf0e10cSrcweir 421cdf0e10cSrcweir //------------------------------------------------------------------ 422cdf0e10cSrcweir 423cdf0e10cSrcweir #endif // _SCA_DATEFUNC_HXX 424cdf0e10cSrcweir 425