1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: callform.hxx,v $
10 * $Revision: 1.3.32.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SC_CALLFORM_HXX
32 #define SC_CALLFORM_HXX
34 #include "collect.hxx"
36 //------------------------------------------------------------------------
37 #define MAXFUNCPARAM 16
38 #define MAXARRSIZE 0xfffe
40 //------------------------------------------------------------------------
45 #define CALLTYPE __cdecl
48 #define PASCAL _pascal
50 #define CALLTYPE FAR PASCAL
54 typedef void (CALLTYPE
* AdvData
)( double& nHandle
, void* pData
);
57 //------------------------------------------------------------------------
68 //------------------------------------------------------------------------
70 class FuncData
: public ScDataObject
72 friend class FuncCollection
;
73 const ModuleData
* pModuleData
;
79 ParamType eParamType
[MAXFUNCPARAM
];
81 FuncData(const String
& rIName
);
83 FuncData(const ModuleData
*pModule
,
88 const ParamType
* peType
,
90 FuncData(const FuncData
& rData
);
91 virtual ScDataObject
* Clone() const { return new FuncData(*this); }
93 const String
& GetModuleName() const;
94 const String
& GetInternalName() const { return aInternalName
; }
95 const String
& GetFuncName() const { return aFuncName
; }
96 USHORT
GetParamCount() const { return nParamCount
; }
97 ParamType
GetParamType(USHORT nIndex
) const { return eParamType
[nIndex
]; }
98 ParamType
GetReturnType() const { return eParamType
[0]; }
99 ParamType
GetAsyncType() const { return eAsyncType
; }
100 BOOL
Call(void** ppParam
);
101 BOOL
Unadvice(double nHandle
);
103 // Name und Beschreibung des Parameters nParam.
104 // nParam==0 => Desc := Funktions-Beschreibung,
106 BOOL
GetParamDesc( String
& aName
, String
& aDesc
, USHORT nParam
);
110 //------------------------------------------------------------------------
111 class FuncCollection
: public ScSortedCollection
114 FuncCollection(USHORT nLim
= 4, USHORT nDel
= 4, BOOL bDup
= FALSE
) : ScSortedCollection ( nLim
, nDel
, bDup
) {}
115 FuncCollection(const FuncCollection
& rFuncCollection
) : ScSortedCollection ( rFuncCollection
) {}
117 virtual ScDataObject
* Clone() const { return new FuncCollection(*this); }
118 FuncData
* operator[]( const USHORT nIndex
) const {return (FuncData
*)At(nIndex
);}
119 virtual short Compare(ScDataObject
* pKey1
, ScDataObject
* pKey2
) const;
120 BOOL
SearchFunc( const String
& rName
, USHORT
& rIndex
) const;
124 BOOL
InitExternalFunc(const rtl::OUString
& rModuleName
);
125 void ExitExternalFunc();