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 #pragma once
21 
22 #include <rtl/ustring.hxx>
23 
24 #include <memory>
25 #include <map>
26 
27 #define MAXFUNCPARAM 16
28 #define MAXARRSIZE 0xfffe
29 
30 #ifndef _WIN32
31 #define CALLTYPE
32 #else
33 #define CALLTYPE __cdecl
34 #endif
35 
36 extern "C" {
37 typedef void (CALLTYPE* AdvData)( double& nHandle, void* pData );
38 }
39 
40 enum class ParamType
41 {
42  PTR_DOUBLE,
43  PTR_STRING,
47  NONE
48 };
49 
50 class ModuleData;
51 
53 {
54  friend class LegacyFuncCollection;
55 
57  OUString aInternalName;
58  OUString aFuncName;
59  sal_uInt16 nNumber;
60  sal_uInt16 nParamCount;
63 public:
64  LegacyFuncData(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  LegacyFuncData(const LegacyFuncData& rData);
72 
73  const OUString& GetModuleName() const;
74  const OUString& GetInternalName() const { return aInternalName; }
75  sal_uInt16 GetParamCount() const { return nParamCount; }
76  ParamType GetParamType(sal_uInt16 nIndex) const { return eParamType[nIndex]; }
77  ParamType GetAsyncType() const { return eAsyncType; }
78  void Call(void** ppParam) const;
79  void Unadvice(double nHandle);
80 
84  void getParamDesc( OUString& aName, OUString& aDesc, sal_uInt16 nParam ) const;
85 };
86 
88 {
89  typedef std::map<OUString, std::unique_ptr<LegacyFuncData>> MapType;
90  MapType m_Data;
91 
92 public:
93  typedef MapType::const_iterator const_iterator;
94 
97 
98  const LegacyFuncData* findByName(const OUString& rName) const;
99  LegacyFuncData* findByName(const OUString& rName);
100  void insert(LegacyFuncData* pNew);
101 
102  const_iterator begin() const;
103  const_iterator end() const;
104 };
105 
106 bool InitExternalFunc(const OUString& rModuleName);
107 void ExitExternalFunc();
108 
109 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void(CALLTYPE * AdvData)(double &nHandle, void *pData)
Definition: callform.hxx:37
MapType::const_iterator const_iterator
Definition: callform.hxx:93
sal_uInt16 GetParamCount() const
Definition: callform.hxx:75
sal_uInt16 nNumber
Definition: callform.hxx:59
const_iterator end() const
Definition: callform.cxx:406
std::map< OUString, std::unique_ptr< LegacyFuncData > > MapType
Definition: callform.hxx:89
std::unique_ptr< ContentProperties > pData
OUString aFuncName
Definition: callform.hxx:58
sal_uInt16 nParamCount
Definition: callform.hxx:60
OUString aInternalName
Definition: callform.hxx:57
const_iterator begin() const
Definition: callform.cxx:401
#define MAXFUNCPARAM
Definition: callform.hxx:27
const LegacyFuncData * findByName(const OUString &rName) const
Definition: callform.cxx:383
void ExitExternalFunc()
Definition: callform.cxx:239
ParamType GetAsyncType() const
Definition: callform.hxx:77
LegacyFuncData(const ModuleData *pModule, const OUString &rIName, const OUString &rFName, sal_uInt16 nNo, sal_uInt16 nCount, const ParamType *peType, ParamType eType)
Definition: callform.cxx:92
sal_Int32 nHandle
char sal_uInt16 ParamType * peType
Definition: callform.cxx:53
void insert(LegacyFuncData *pNew)
Definition: callform.cxx:395
void getParamDesc(OUString &aName, OUString &aDesc, sal_uInt16 nParam) const
name and description of parameter nParam.
Definition: callform.cxx:342
sal_uInt16 & nParam
Definition: callform.cxx:57
const OUString & GetInternalName() const
Definition: callform.hxx:74
ParamType GetParamType(sal_uInt16 nIndex) const
Definition: callform.hxx:76
ParamType
Definition: callform.hxx:40
const ModuleData * pModuleData
Definition: callform.hxx:56
ParamType eAsyncType
Definition: callform.hxx:61
void Unadvice(double nHandle)
Definition: callform.cxx:323
void Call(void **ppParam) const
Definition: callform.cxx:244
#define CALLTYPE
Definition: callform.hxx:31
ParamType eParamType[MAXFUNCPARAM]
Definition: callform.hxx:62
const OUString & GetModuleName() const
Definition: callform.cxx:337
bool InitExternalFunc(const OUString &rModuleName)
Definition: callform.cxx:160
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo