Bump version to 6.4-15
[LibreOffice.git] / sc / inc / callform.hxx
blobd64f9dfd5fe0255242c70c611b402cd46e58c031
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 <memory>
26 #include <map>
28 #define MAXFUNCPARAM 16
29 #define MAXARRSIZE 0xfffe
31 #ifndef _WIN32
32 #define CALLTYPE
33 #else
34 #define CALLTYPE __cdecl
35 #endif
37 extern "C" {
38 typedef void (CALLTYPE* AdvData)( double& nHandle, void* pData );
41 enum class ParamType
43 PTR_DOUBLE,
44 PTR_STRING,
45 PTR_DOUBLE_ARR,
46 PTR_STRING_ARR,
47 PTR_CELL_ARR,
48 NONE
51 class ModuleData;
53 class LegacyFuncData
55 friend class LegacyFuncCollection;
57 const ModuleData* pModuleData;
58 OUString const aInternalName;
59 OUString const aFuncName;
60 sal_uInt16 const nNumber;
61 sal_uInt16 const nParamCount;
62 ParamType const eAsyncType;
63 ParamType eParamType[MAXFUNCPARAM];
64 public:
65 LegacyFuncData(const ModuleData*pModule,
66 const OUString& rIName,
67 const OUString& rFName,
68 sal_uInt16 nNo,
69 sal_uInt16 nCount,
70 const ParamType* peType,
71 ParamType eType);
72 LegacyFuncData(const LegacyFuncData& rData);
74 const OUString& GetModuleName() const;
75 const OUString& GetInternalName() const { return aInternalName; }
76 sal_uInt16 GetParamCount() const { return nParamCount; }
77 ParamType GetParamType(sal_uInt16 nIndex) const { return eParamType[nIndex]; }
78 ParamType GetAsyncType() const { return eAsyncType; }
79 void Call(void** ppParam) const;
80 void Unadvice(double nHandle);
82 /** name and description of parameter nParam.
83 nParam==0 => Desc := function description,
84 Name := n/a */
85 void getParamDesc( OUString& aName, OUString& aDesc, sal_uInt16 nParam ) const;
88 class LegacyFuncCollection
90 typedef std::map<OUString, std::unique_ptr<LegacyFuncData>> MapType;
91 MapType m_Data;
93 public:
94 typedef MapType::const_iterator const_iterator;
96 LegacyFuncCollection();
97 LegacyFuncCollection(const LegacyFuncCollection& r);
99 const LegacyFuncData* findByName(const OUString& rName) const;
100 LegacyFuncData* findByName(const OUString& rName);
101 void insert(LegacyFuncData* pNew);
103 const_iterator begin() const;
104 const_iterator end() const;
107 bool InitExternalFunc(const OUString& rModuleName);
108 void ExitExternalFunc();
110 #endif
112 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */