home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2002 October / VPR0210A.ISO / OPENOFFICE / f_0302 / addin.h next >
C/C++ Source or Header  |  2000-09-18  |  5KB  |  191 lines

  1. /*************************************************************************
  2.  *
  3.  *  $RCSfile: addin.h,v $
  4.  *
  5.  *  $Revision: 1.1.1.1 $
  6.  *
  7.  *  last change: $Author: hr $ $Date: 2000/09/18 16:44:46 $
  8.  *
  9.  *  The Contents of this file are made available subject to the terms of
  10.  *  either of the following licenses
  11.  *
  12.  *         - GNU Lesser General Public License Version 2.1
  13.  *         - Sun Industry Standards Source License Version 1.1
  14.  *
  15.  *  Sun Microsystems Inc., October, 2000
  16.  *
  17.  *  GNU Lesser General Public License Version 2.1
  18.  *  =============================================
  19.  *  Copyright 2000 by Sun Microsystems, Inc.
  20.  *  901 San Antonio Road, Palo Alto, CA 94303, USA
  21.  *
  22.  *  This library is free software; you can redistribute it and/or
  23.  *  modify it under the terms of the GNU Lesser General Public
  24.  *  License version 2.1, as published by the Free Software Foundation.
  25.  *
  26.  *  This library is distributed in the hope that it will be useful,
  27.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  28.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  29.  *  Lesser General Public License for more details.
  30.  *
  31.  *  You should have received a copy of the GNU Lesser General Public
  32.  *  License along with this library; if not, write to the Free Software
  33.  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  34.  *  MA  02111-1307  USA
  35.  *
  36.  *
  37.  *  Sun Industry Standards Source License Version 1.1
  38.  *  =================================================
  39.  *  The contents of this file are subject to the Sun Industry Standards
  40.  *  Source License Version 1.1 (the "License"); You may not use this file
  41.  *  except in compliance with the License. You may obtain a copy of the
  42.  *  License at http://www.openoffice.org/license.html.
  43.  *
  44.  *  Software provided under this License is provided on an "AS IS" basis,
  45.  *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
  46.  *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
  47.  *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
  48.  *  See the License for the specific provisions governing your rights and
  49.  *  obligations concerning the Software.
  50.  *
  51.  *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
  52.  *
  53.  *  Copyright: 2000 by Sun Microsystems, Inc.
  54.  *
  55.  *  All Rights Reserved.
  56.  *
  57.  *  Contributor(s): _______________________________________
  58.  *
  59.  *
  60.  ************************************************************************/
  61.  
  62. #ifndef _ADDIN_H
  63. #define _ADDIN_H
  64.  
  65. #ifndef _SOLAR_H
  66.  
  67. #ifndef TRUE
  68. #define TRUE            1
  69. #endif
  70. #ifndef FALSE
  71. #define FALSE           0
  72. #endif
  73.  
  74. #undef NULL
  75. #define NULL            0
  76.  
  77. typedef unsigned char        BOOL;
  78. typedef unsigned char        BYTE;
  79. typedef unsigned short        USHORT;
  80. typedef unsigned long        ULONG;
  81.  
  82. #endif
  83.  
  84. #ifndef SUPD
  85. /* enable all new interface features */
  86. #define SUPD 9999
  87. #endif
  88.  
  89. /* all character string returns are limited to 255+1 chars */
  90. #define SO_CHARSTRING_MAX        256
  91. #define SO_StringCopy( dst, src ) \
  92.     (strncpy( dst, src, SO_CHARSTRING_MAX ), dst[SO_CHARSTRING_MAX-1] = '\0')
  93.  
  94. typedef enum
  95. {
  96.     PTR_DOUBLE,
  97.     PTR_STRING,
  98.     PTR_DOUBLE_ARR,
  99.     PTR_STRING_ARR,
  100.     PTR_CELL_ARR,
  101.     NONE
  102. } ParamType;
  103.  
  104. #ifndef WIN
  105. #ifdef WNT
  106. #define CALLTYPE        __cdecl
  107. #else
  108. #define CALLTYPE
  109. #endif
  110. #else
  111. #define PASCAL            _pascal
  112. #define FAR                _far
  113. #define CALLTYPE        FAR PASCAL
  114. #endif
  115.  
  116.  
  117. #ifdef __cplusplus
  118.  
  119. extern "C" {
  120.  
  121. typedef void (CALLTYPE* AdvData)( double& nHandle, void* pData );
  122.  
  123. extern void CALLTYPE GetFunctionCount( USHORT& nCount );
  124.  
  125. extern void CALLTYPE GetFunctionData( USHORT&    nNo,
  126.                    char*      pFuncName,
  127.                    USHORT&    nParamCount,
  128.                    ParamType* peType,
  129.                    char*      pInternalName );
  130.  
  131. extern void CALLTYPE IsAsync( USHORT& nNo, ParamType* peType );
  132.  
  133. extern void CALLTYPE Advice( USHORT& nNo, AdvData& pfCallback );
  134.  
  135. extern void CALLTYPE Unadvice( double& nHandle );
  136.  
  137.  
  138. #if (SUPD>=398)
  139. /* new in StarOffice 5.0 */
  140.  
  141. extern void CALLTYPE GetParameterDescription( USHORT& nNo, USHORT& nParam,
  142. char* pName, char* pDesc );
  143.  
  144. #endif
  145.  
  146. #if (SUPD>=506)
  147. /* new in StarOffice 5.1 */
  148.  
  149. extern void CALLTYPE SetLanguage( USHORT& nLanguage );
  150.  
  151. #endif
  152.  
  153. };
  154.  
  155. #else
  156.  
  157. typedef void (CALLTYPE* AdvData)( double* nHandle, void* pData );
  158.  
  159. extern void CALLTYPE GetFunctionCount( USHORT * nCount );
  160.  
  161. extern void CALLTYPE GetFunctionData( USHORT * nNo,
  162.                    char *      pFuncName,
  163.                    USHORT *    nParamCount,
  164.                    ParamType *  peType,
  165.                    char *      pInternalName );
  166.  
  167. extern void CALLTYPE IsAsync( USHORT * nNo, ParamType * peType );
  168.  
  169. extern void CALLTYPE Advice( USHORT * nNo, AdvData * pfCallback );
  170.  
  171. extern void CALLTYPE Unadvice( double * nHandle );
  172.  
  173. #if (SUPD>=398)
  174. /* new in StarOffice 5.0 */
  175.  
  176. extern void CALLTYPE GetParameterDescription( USHORT* nNo, USHORT* nParam,
  177.             char* pName, char* pDesc );
  178.  
  179. #endif
  180.  
  181. #if (SUPD>=506)
  182. /* new in StarOffice 5.1 */
  183.  
  184. extern void CALLTYPE SetLanguage( USHORT* nLanguage );
  185.  
  186. #endif
  187.  
  188. #endif
  189.  
  190. #endif
  191.