xref: /aoo42x/main/sc/addin/inc/addin.h (revision feb022d5)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _ADDIN_H
25 #define _ADDIN_H
26 
27 #ifndef _SOLAR_H
28 
29 #ifndef TRUE
30 #define TRUE            1
31 #endif
32 #ifndef FALSE
33 #define FALSE           0
34 #endif
35 
36 #undef NULL
37 #define NULL            0
38 
39 typedef unsigned char		BOOL;
40 typedef unsigned char		BYTE;
41 typedef unsigned short		USHORT;
42 typedef unsigned long		ULONG;
43 
44 #endif
45 
46 #ifndef SUPD
47 /* enable all new interface features */
48 #define SUPD 9999
49 #endif
50 
51 /* all character string returns are limited to 255+1 chars */
52 #define SO_CHARSTRING_MAX		256
53 #define SO_StringCopy( dst, src ) \
54 	(strncpy( dst, src, SO_CHARSTRING_MAX ), dst[SO_CHARSTRING_MAX-1] = '\0')
55 
56 typedef enum
57 {
58 	PTR_DOUBLE,
59 	PTR_STRING,
60 	PTR_DOUBLE_ARR,
61 	PTR_STRING_ARR,
62 	PTR_CELL_ARR,
63 	NONE
64 } ParamType;
65 
66 #ifdef WNT
67 #define CALLTYPE		__cdecl
68 #else
69 #define CALLTYPE
70 #endif
71 
72 #ifdef __cplusplus
73 
74 extern "C" {
75 
76 typedef void (CALLTYPE* AdvData)( double& nHandle, void* pData );
77 
78 extern void CALLTYPE GetFunctionCount( USHORT& nCount );
79 
80 extern void CALLTYPE GetFunctionData( USHORT&    nNo,
81 				   char*      pFuncName,
82 				   USHORT&    nParamCount,
83 				   ParamType* peType,
84 				   char*      pInternalName );
85 
86 extern void CALLTYPE IsAsync( USHORT& nNo, ParamType* peType );
87 
88 extern void CALLTYPE Advice( USHORT& nNo, AdvData& pfCallback );
89 
90 extern void CALLTYPE Unadvice( double& nHandle );
91 
92 
93 /* new in StarOffice 5.0 */
94 
95 extern void CALLTYPE GetParameterDescription( USHORT& nNo, USHORT& nParam,
96 char* pName, char* pDesc );
97 
98 /* new in StarOffice 5.1 */
99 
100 extern void CALLTYPE SetLanguage( USHORT& nLanguage );
101 
102 
103 };
104 
105 #else
106 
107 typedef void (CALLTYPE* AdvData)( double* nHandle, void* pData );
108 
109 extern void CALLTYPE GetFunctionCount( USHORT * nCount );
110 
111 extern void CALLTYPE GetFunctionData( USHORT * nNo,
112 				   char *      pFuncName,
113 				   USHORT *    nParamCount,
114 				   ParamType *  peType,
115 				   char *      pInternalName );
116 
117 extern void CALLTYPE IsAsync( USHORT * nNo, ParamType * peType );
118 
119 extern void CALLTYPE Advice( USHORT * nNo, AdvData * pfCallback );
120 
121 extern void CALLTYPE Unadvice( double * nHandle );
122 
123 /* new in StarOffice 5.0 */
124 
125 extern void CALLTYPE GetParameterDescription( USHORT* nNo, USHORT* nParam,
126 			char* pName, char* pDesc );
127 
128 
129 /* new in StarOffice 5.1 */
130 
131 extern void CALLTYPE SetLanguage( USHORT* nLanguage );
132 
133 
134 #endif
135 
136 #endif
137