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