Bump version to 4.3-4
[LibreOffice.git] / sc / inc / callform.hxx
bloba86deaec5220a3e0a65bb5be16b0ac4ae3d24b31
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SC_INC_CALLFORM_HXX
21 #define INCLUDED_SC_INC_CALLFORM_HXX
23 #include <rtl/ustring.hxx>
25 #include <boost/ptr_container/ptr_map.hpp>
27 #define MAXFUNCPARAM 16
28 #define MAXARRSIZE 0xfffe
30 #ifndef WNT
31 #define CALLTYPE
32 #else
33 #define CALLTYPE __cdecl
34 #endif
36 extern "C" {
37 typedef void (CALLTYPE* AdvData)( double& nHandle, void* pData );
40 enum ParamType
42 PTR_DOUBLE,
43 PTR_STRING,
44 PTR_DOUBLE_ARR,
45 PTR_STRING_ARR,
46 PTR_CELL_ARR,
47 NONE
50 class ModuleData;
52 class FuncData
54 friend class FuncCollection;
56 const ModuleData* pModuleData;
57 OUString aInternalName;
58 OUString aFuncName;
59 sal_uInt16 nNumber;
60 sal_uInt16 nParamCount;
61 ParamType eAsyncType;
62 ParamType eParamType[MAXFUNCPARAM];
63 public:
64 FuncData(const ModuleData*pModule,
65 const OUString& rIName,
66 const OUString& rFName,
67 sal_uInt16 nNo,
68 sal_uInt16 nCount,
69 const ParamType* peType,
70 ParamType eType);
71 FuncData(const FuncData& rData);
73 const OUString& GetModuleName() const;
74 const OUString& GetInternalName() const { return aInternalName; }
75 const OUString& GetFuncName() const { return aFuncName; }
76 sal_uInt16 GetParamCount() const { return nParamCount; }
77 ParamType GetParamType(sal_uInt16 nIndex) const { return eParamType[nIndex]; }
78 ParamType GetReturnType() const { return eParamType[0]; }
79 ParamType GetAsyncType() const { return eAsyncType; }
80 bool Call(void** ppParam) const;
81 bool Unadvice(double nHandle);
83 /** name and description of parameter nParam.
84 nParam==0 => Desc := function description,
85 Name := n/a */
86 bool getParamDesc( OUString& aName, OUString& aDesc, sal_uInt16 nParam ) const;
90 class FuncCollection
92 typedef boost::ptr_map<OUString, FuncData> MapType;
93 MapType maData;
94 public:
95 typedef MapType::const_iterator const_iterator;
97 FuncCollection();
98 FuncCollection(const FuncCollection& r);
100 const FuncData* findByName(const OUString& rName) const;
101 FuncData* findByName(const OUString& rName);
102 void insert(FuncData* pNew);
104 const_iterator begin() const;
105 const_iterator end() const;
109 bool InitExternalFunc(const OUString& rModuleName);
110 void ExitExternalFunc();
112 #endif
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */