merge the formfield patch from ooo-build
[ooovba.git] / svtools / source / svdde / ddeimp.hxx
blob6353c24574e3966ca987a04e6813a60c317a56be
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: ddeimp.hxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _DDEIMP_HXX
32 #define _DDEIMP_HXX
34 #ifdef OS2
36 #include "ddemlos2.h"
38 #define WORD USHORT
39 #define DWORD ULONG
40 #define LPBYTE BYTE*
41 #define LPWORD USHORT*
42 #define LPDWORD ULONG*
43 #define LPCTSTR PCSZ
45 #else
47 #include <tools/prewin.h>
48 #include <ddeml.h>
49 #include <tools/postwin.h>
50 #include "ddewrap.hxx"
53 extern "C"
55 #define BOOL WIN_BOOL
56 #define BYTE WIN_BYTE
57 #undef BOOL
58 #undef BYTE
62 #endif
63 #include <tools/string.hxx>
64 #include <tools/list.hxx>
65 #include <tools/shl.hxx>
67 class DdeService;
68 class DdeTopic;
69 class DdeItem;
70 class DdeTopics;
71 class DdeItems;
73 // ----------------
74 // - Conversation -
75 // ----------------
77 struct Conversation
79 HCONV hConv;
80 DdeTopic* pTopic;
83 DECLARE_LIST( ConvList, Conversation* );
85 // ---------------
86 // - DdeInternal -
87 // ---------------
89 class DdeInternal
91 public:
92 #ifdef WNT
93 static HDDEDATA CALLBACK CliCallback
94 ( WORD, WORD, HCONV, HSZ, HSZ, HDDEDATA, DWORD, DWORD );
95 static HDDEDATA CALLBACK SvrCallback
96 ( WORD, WORD, HCONV, HSZ, HSZ, HDDEDATA, DWORD, DWORD );
97 static HDDEDATA CALLBACK InfCallback
98 ( WORD, WORD, HCONV, HSZ, HSZ, HDDEDATA, DWORD, DWORD );
99 #else
100 #if defined ( MTW ) || ( defined ( GCC ) && defined ( OS2 )) || defined( ICC )
101 static HDDEDATA CALLBACK __EXPORT CliCallback
102 ( WORD, WORD, HCONV, HSZ, HSZ, HDDEDATA, DWORD, DWORD );
103 static HDDEDATA CALLBACK __EXPORT SvrCallback
104 ( WORD, WORD, HCONV, HSZ, HSZ, HDDEDATA, DWORD, DWORD );
105 static HDDEDATA CALLBACK __EXPORT InfCallback
106 ( WORD, WORD, HCONV, HSZ, HSZ, HDDEDATA, DWORD, DWORD );
107 #else
108 static HDDEDATA CALLBACK _export CliCallback
109 ( WORD, WORD, HCONV, HSZ, HSZ, HDDEDATA, DWORD, DWORD );
110 static HDDEDATA CALLBACK _export SvrCallback
111 ( WORD, WORD, HCONV, HSZ, HSZ, HDDEDATA, DWORD, DWORD );
112 static HDDEDATA CALLBACK _export InfCallback
113 ( WORD, WORD, HCONV, HSZ, HSZ, HDDEDATA, DWORD, DWORD );
114 #endif
115 #endif
116 static DdeService* FindService( HSZ );
117 static DdeTopic* FindTopic( DdeService&, HSZ );
118 static DdeItem* FindItem( DdeTopic&, HSZ );
121 // -------------
122 // - DdeString -
123 // -------------
125 class DdeString : public String
127 protected:
128 HSZ hString;
129 DWORD hInst;
131 public:
132 DdeString( DWORD, const sal_Unicode* );
133 DdeString( DWORD, const String& );
134 ~DdeString();
136 int operator==( HSZ );
137 operator HSZ();
140 // --------------
141 // - DdeDataImp -
142 // --------------
144 struct DdeDataImp
146 HDDEDATA hData;
147 LPBYTE pData;
148 long nData;
149 ULONG nFmt;
152 class DdeConnections;
153 class DdeServices;
155 struct DdeInstData
157 USHORT nRefCount;
158 DdeConnections* pConnections;
159 // Server
160 long hCurConvSvr;
161 ULONG hDdeInstSvr;
162 short nInstanceSvr;
163 DdeServices* pServicesSvr;
164 // Client
165 ULONG hDdeInstCli;
166 short nInstanceCli;
169 #ifndef SHL_SVDDE
170 #define SHL_SVDDE SHL_SHL2
171 #endif
173 inline DdeInstData* ImpGetInstData()
175 return (DdeInstData*)(*GetAppData( SHL_SVDDE ));
177 DdeInstData* ImpInitInstData();
178 void ImpDeinitInstData();
180 #endif // _DDEIMP_HXX