LibreOffice Module sc (master)  1
callform.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #ifndef INCLUDED_SC_INC_CALLFORM_HXX
21 #define INCLUDED_SC_INC_CALLFORM_HXX
22 
23 #include <rtl/ustring.hxx>
24 
25 #include <memory>
26 #include <map>
27 
28 #define MAXFUNCPARAM 16
29 #define MAXARRSIZE 0xfffe
30 
31 #ifndef _WIN32
32 #define CALLTYPE
33 #else
34 #define CALLTYPE __cdecl
35 #endif
36 
37 extern "C" {
38 typedef void (CALLTYPE* AdvData)( double& nHandle, void* pData );
39 }
40 
41 enum class ParamType
42 {
43  PTR_DOUBLE,
44  PTR_STRING,
48  NONE
49 };
50 
51 class ModuleData;
52 
54 {
55  friend class LegacyFuncCollection;
56 
58  OUString aInternalName;
59  OUString aFuncName;
60  sal_uInt16 nNumber;
61  sal_uInt16 nParamCount;
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);
73 
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);
81 
85  void getParamDesc( OUString& aName, OUString& aDesc, sal_uInt16 nParam ) const;
86 };
87 
89 {
90  typedef std::map<OUString, std::unique_ptr<LegacyFuncData>> MapType;
91  MapType m_Data;
92 
93 public:
94  typedef MapType::const_iterator const_iterator;
95 
98 
99  const LegacyFuncData* findByName(const OUString& rName) const;
100  LegacyFuncData* findByName(const OUString& rName);
101  void insert(LegacyFuncData* pNew);
102 
103  const_iterator begin() const;
104  const_iterator end() const;
105 };
106 
107 bool InitExternalFunc(const OUString& rModuleName);
108 void ExitExternalFunc();
109 
110 #endif
111 
112 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void(CALLTYPE * AdvData)(double &nHandle, void *pData)
Definition: callform.hxx:38
MapType::const_iterator const_iterator
Definition: callform.hxx:94
sal_uInt16 GetParamCount() const
Definition: callform.hxx:76
sal_uInt16 nNumber
Definition: callform.hxx:60
const_iterator end() const
Definition: callform.cxx:407
std::map< OUString, std::unique_ptr< LegacyFuncData > > MapType
Definition: callform.hxx:90
std::unique_ptr< ContentProperties > pData
OUString aFuncName
Definition: callform.hxx:59
sal_uInt16 nParamCount
Definition: callform.hxx:61
OUString aInternalName
Definition: callform.hxx:58
const_iterator begin() const
Definition: callform.cxx:402
#define MAXFUNCPARAM
Definition: callform.hxx:28
const LegacyFuncData * findByName(const OUString &rName) const
Definition: callform.cxx:384
void ExitExternalFunc()
Definition: callform.cxx:240
ParamType GetAsyncType() const
Definition: callform.hxx:78
LegacyFuncData(const ModuleData *pModule, const OUString &rIName, const OUString &rFName, sal_uInt16 nNo, sal_uInt16 nCount, const ParamType *peType, ParamType eType)
Definition: callform.cxx:93
sal_Int32 nHandle
char sal_uInt16 ParamType * peType
Definition: callform.cxx:54
void insert(LegacyFuncData *pNew)
Definition: callform.cxx:396
void getParamDesc(OUString &aName, OUString &aDesc, sal_uInt16 nParam) const
name and description of parameter nParam.
Definition: callform.cxx:343
sal_uInt16 & nParam
Definition: callform.cxx:58
const OUString & GetInternalName() const
Definition: callform.hxx:75
ParamType GetParamType(sal_uInt16 nIndex) const
Definition: callform.hxx:77
ParamType
Definition: callform.hxx:41
const ModuleData * pModuleData
Definition: callform.hxx:57
ParamType eAsyncType
Definition: callform.hxx:62
void Unadvice(double nHandle)
Definition: callform.cxx:324
void Call(void **ppParam) const
Definition: callform.cxx:245
#define CALLTYPE
Definition: callform.hxx:32
ParamType eParamType[MAXFUNCPARAM]
Definition: callform.hxx:63
const OUString & GetModuleName() const
Definition: callform.cxx:338
bool InitExternalFunc(const OUString &rModuleName)
Definition: callform.cxx:161
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo