1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef SC_CALLFORM_HXX
29 #define SC_CALLFORM_HXX
31 #include "collect.hxx"
33 //------------------------------------------------------------------------
34 #define MAXFUNCPARAM 16
35 #define MAXARRSIZE 0xfffe
37 //------------------------------------------------------------------------
42 #define CALLTYPE __cdecl
45 #define PASCAL _pascal
47 #define CALLTYPE FAR PASCAL
51 typedef void (CALLTYPE
* AdvData
)( double& nHandle
, void* pData
);
54 //------------------------------------------------------------------------
65 //------------------------------------------------------------------------
67 class FuncData
: public ScDataObject
69 friend class FuncCollection
;
70 const ModuleData
* pModuleData
;
76 ParamType eParamType
[MAXFUNCPARAM
];
78 FuncData(const String
& rIName
);
80 FuncData(const ModuleData
*pModule
,
85 const ParamType
* peType
,
87 FuncData(const FuncData
& rData
);
88 virtual ScDataObject
* Clone() const { return new FuncData(*this); }
90 const String
& GetModuleName() const;
91 const String
& GetInternalName() const { return aInternalName
; }
92 const String
& GetFuncName() const { return aFuncName
; }
93 USHORT
GetParamCount() const { return nParamCount
; }
94 ParamType
GetParamType(USHORT nIndex
) const { return eParamType
[nIndex
]; }
95 ParamType
GetReturnType() const { return eParamType
[0]; }
96 ParamType
GetAsyncType() const { return eAsyncType
; }
97 BOOL
Call(void** ppParam
);
98 BOOL
Unadvice(double nHandle
);
100 // Name und Beschreibung des Parameters nParam.
101 // nParam==0 => Desc := Funktions-Beschreibung,
103 BOOL
GetParamDesc( String
& aName
, String
& aDesc
, USHORT nParam
);
107 //------------------------------------------------------------------------
108 class FuncCollection
: public ScSortedCollection
111 FuncCollection(USHORT nLim
= 4, USHORT nDel
= 4, BOOL bDup
= FALSE
) : ScSortedCollection ( nLim
, nDel
, bDup
) {}
112 FuncCollection(const FuncCollection
& rFuncCollection
) : ScSortedCollection ( rFuncCollection
) {}
114 virtual ScDataObject
* Clone() const { return new FuncCollection(*this); }
115 FuncData
* operator[]( const USHORT nIndex
) const {return (FuncData
*)At(nIndex
);}
116 virtual short Compare(ScDataObject
* pKey1
, ScDataObject
* pKey2
) const;
117 BOOL
SearchFunc( const String
& rName
, USHORT
& rIndex
) const;
121 BOOL
InitExternalFunc(const rtl::OUString
& rModuleName
);
122 void ExitExternalFunc();