xref: /trunk/main/ucb/source/ucp/odma/odma_lib.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef ODMA_LIB_HXX
28 #define ODMA_LIB_HXX
29 
30 typedef void	            *LPVOID;
31 typedef char				*LPSTR,
32 							*PSTR;
33 typedef const char			*LPCSTR;
34 typedef unsigned long       DWORD;
35 typedef unsigned short      WORD;
36 typedef unsigned short      *LPWORD;
37 typedef DWORD		        *LPDWORD;
38 
39 #define WINAPI				__stdcall
40 #define FAR
41 
42 #include "odma.h"
43 
44 namespace odma
45 {
46 	typedef ODMSTATUS (WINAPI *TODMRegisterApp) (	ODMHANDLE FAR *pOdmHandle,
47 													WORD version,
48 													LPSTR lpszAppId,
49 													DWORD dwEnvData,
50 													LPVOID pReserved);
51 
52 	typedef void (WINAPI *TODMUnRegisterApp)(ODMHANDLE odmHandle);
53 
54 
55 	typedef ODMSTATUS (WINAPI *TODMSelectDoc)(		ODMHANDLE odmHandle,
56 													LPSTR lpszDocId,
57 													LPDWORD pdwFlags);
58 
59 
60 	typedef ODMSTATUS (WINAPI *TODMOpenDoc)(		ODMHANDLE odmHandle,
61 													DWORD flags,
62 													LPSTR lpszDocId,
63 													LPSTR lpszDocLocation);
64 
65 	typedef ODMSTATUS (WINAPI *TODMSaveDoc)(		ODMHANDLE odmHandle,
66 													LPSTR lpszDocId,
67 													LPSTR lpszNewDocId);
68 
69 	typedef ODMSTATUS (WINAPI *TODMCloseDoc)(		ODMHANDLE odmHandle,
70 													LPSTR lpszDocId,
71 													DWORD activeTime,
72 													DWORD pagesPrinted,
73 													LPVOID sessionData,
74 													WORD dataLen);
75 
76 	typedef ODMSTATUS (WINAPI *TODMNewDoc)(			ODMHANDLE odmHandle,
77 													LPSTR lpszDocId,
78 													DWORD dwFlags,
79 													LPSTR lpszFormat,
80 													LPSTR lpszDocLocation);
81 
82 	typedef ODMSTATUS (WINAPI *TODMSaveAs)(			ODMHANDLE odmHandle,
83 													LPSTR lpszDocId,
84 													LPSTR lpszNewDocId,
85 													LPSTR lpszFormat,
86 													ODMSAVEASCALLBACK pcbCallBack,
87 													LPVOID pInstanceData);
88 
89 	typedef ODMSTATUS (WINAPI *TODMActivate)(		ODMHANDLE odmHandle,
90 													WORD action,
91 													LPSTR lpszDocId);
92 
93 	typedef ODMSTATUS (WINAPI *TODMGetDocInfo)(		ODMHANDLE odmHandle,
94 													LPSTR lpszDocId,
95 													WORD item,
96 													LPSTR lpszData,
97 													WORD dataLen);
98 
99 	typedef ODMSTATUS (WINAPI *TODMSetDocInfo)(		ODMHANDLE odmHandle,
100 													LPSTR lpszDocId,
101 													WORD item,
102 													LPSTR lpszData);
103 
104 	typedef ODMSTATUS (WINAPI *TODMGetDMSInfo)(		ODMHANDLE odmHandle,
105 													LPSTR lpszDmsId,
106 													LPWORD pwVerNo,
107 													LPDWORD pdwExtensions);
108 
109 	/* Query Enhancements */
110 	typedef WORD (WINAPI *TODMGetDMSCount)();
111 
112 	typedef WORD (WINAPI *TODMGetDMSList)(			LPSTR buffer,
113 													WORD buffer_size );
114 
115 	typedef ODMSTATUS (WINAPI *TODMGetDMS)(			LPCSTR lpszAppId,
116 													LPSTR lpszDMSId );
117 
118 	typedef ODMSTATUS (WINAPI *TODMSetDMS)(			LPCSTR lpszAppId,
119 													LPCSTR lpszDMSId );
120 
121 	typedef ODMSTATUS (WINAPI *TODMQueryExecute)(	ODMHANDLE odmHandle,
122 													LPCSTR lpszQuery,
123 													DWORD flags,
124 													LPCSTR lpszDMSList,
125 													LPSTR queryId );
126 
127 	typedef ODMSTATUS (WINAPI *TODMQueryGetResults)(ODMHANDLE odmHandle,
128 													LPCSTR queryId,
129 													LPSTR lpszDocId,
130 													LPSTR lpszDocName,
131 													WORD docNameLen,
132 													WORD *docCount );
133 
134 	typedef ODMSTATUS (WINAPI *TODMQueryClose)(		ODMHANDLE odmHandle,
135 													LPCSTR queryId );
136 
137 	/* ODMA 2.0 Enhancements */
138 	typedef ODMSTATUS (WINAPI *TODMCloseDocEx)(		ODMHANDLE odmHandle,
139 													LPSTR lpszDocId,
140 													LPDWORD pdwFlags,
141 													DWORD activeTime,
142 													DWORD pagesPrinted,
143 													LPVOID sessionData,
144 													WORD dataLen);
145 
146 	typedef ODMSTATUS (WINAPI *TODMSaveAsEx)(		ODMHANDLE odmHandle,
147 													LPSTR lpszDocId,
148 													LPSTR lpszNewDocId,
149 													LPSTR lpszFormat,
150 													ODMSAVEASCALLBACK pcbCallBack,
151 													LPVOID pInstanceData,
152 													LPDWORD pdwFlags);
153 
154 	typedef ODMSTATUS (WINAPI *TODMSaveDocEx)(		ODMHANDLE odmHandle,
155 													LPSTR lpszDocId,
156 													LPSTR lpszNewDocId,
157 													LPDWORD pdwFlags);
158 
159 	typedef ODMSTATUS (WINAPI *TODMSelectDocEx)(	ODMHANDLE odmHandle,
160 													LPSTR lpszDocIds,
161 													LPWORD pwDocIdsLen,
162 													LPWORD pwDocCount,
163 													LPDWORD pdwFlags,
164 													LPSTR lpszFormatFilter);
165 
166 	typedef ODMSTATUS (WINAPI *TODMQueryCapability)(ODMHANDLE odmHandle,
167 													LPCSTR lpszDmsId,
168 													DWORD function,
169 													DWORD item,
170 													DWORD flags);
171 
172 	typedef ODMSTATUS (WINAPI *TODMSetDocEvent)(	ODMHANDLE odmHandle,
173 													LPSTR lpszDocId,
174 													DWORD flags,
175 													DWORD event,
176 													LPVOID lpData,
177 													DWORD dwDataLen,
178 													LPSTR lpszComment);
179 
180 	typedef ODMSTATUS (WINAPI *TODMGetAlternateContent)(ODMHANDLE odmHandle,
181 													LPSTR lpszDocId,
182 													LPDWORD pdwFlags,
183 													LPSTR lpszFormat,
184 													LPSTR lpszDocLocation);
185 
186 	typedef ODMSTATUS (WINAPI *TODMSetAlternateContent)(ODMHANDLE odmHandle,
187 													LPSTR lpszDocId,
188 													LPDWORD pdwFlags,
189 													LPSTR lpszFormat,
190 													LPSTR lpszDocLocation);
191 
192 	typedef ODMSTATUS (WINAPI *TODMGetDocRelation)(	ODMHANDLE odmHandle,
193 													LPSTR lpszDocId,
194 													LPDWORD pdwFlags,
195 													LPSTR lpszLinkedId,
196 													LPSTR lpszFormat,
197 													LPSTR lpszPreviousId);
198 
199 	typedef ODMSTATUS (WINAPI *TODMSetDocRelation)(	ODMHANDLE odmHandle,
200 													LPSTR lpszDocId,
201 													LPDWORD pdwFlags,
202 													LPSTR lpszLinkedId,
203 													LPSTR lpszFormat,
204 													LPSTR lpszPreviousId);
205 
206 	// now we define some macros
207 
208 	#define NODMRegisterApp(a,b,c,d,e)			(*(pODMRegisterApp))(a,b,c,d,e)
209 	#define NODMUnRegisterApp(a)				(*(pODMUnRegisterApp))(a)
210 	#define NODMSelectDoc(a,b,c)				(*(pODMSelectDoc))(a,b,c)
211 	#define NODMOpenDoc(a,b,c,d)				(*(pODMOpenDoc))(a,b,c,d)
212 	#define NODMSaveDoc(a,b,c)					(*(pODMSaveDoc))(a,b,c)
213 	#define NODMCloseDoc(a,b,c,d,e,f)			(*(pODMCloseDoc))(a,b,c,d,e,f)
214 	#define NODMNewDoc(a,b,c,d,e)				(*(pODMNewDoc))(a,b,c,d,e)
215 	#define NODMSaveAs(a,b,c,d,e,f)				(*(pODMSaveAs))(a,b,c,d,e,f)
216 	#define NODMActivate(a,b,c)					(*(pODMActivate))(a,b,c)
217 	#define NODMGetDocInfo(a,b,c,d,e)			(*(pODMGetDocInfo))(a,b,c,d,e)
218 	#define NODMSetDocInfo(a,b,c,d)				(*(pODMSetDocInfo))(a,b,c,d)
219 	#define NODMGetDMSInfo(a,b,c,d)				(*(pODMGetDMSInfo))(a,b,c,d)
220 	#define NODMGetDMSCount()					(*(pODMGetDMSCount))()
221 	#define NODMGetDMSList(a,b)					(*(pODMGetDMSList))(a,b)
222 	#define NODMGetDMS(a,b)						(*(pODMGetDMS))(a,b)
223 	#define NODMSetDMS(a,b)						(*(pODMSetDMS))(a,b)
224 	#define NODMQueryExecute(a,b,c,d,e)			(*(pODMQueryExecute))(a,b,c,d,e)
225 	#define NODMQueryGetResults(a,b,c,d,e,f)	(*(pODMQueryGetResults))(a,b,c,d,e,f)
226 	#define NODMQueryClose(a,b)					(*(pODMQueryClose))(a,b)
227 	#define NODMCloseDocEx(a,b,c,d,e,f,g)		(*(pODMCloseDocEx))(a,b,c,d,e,f,g)
228 	#define NODMSaveAsEx(a,b,c,d,e,f,g)			(*(pODMSaveAsEx))(a,b,c,d,e,f,g)
229 	#define NODMSaveDocEx(a,b,c,d)				(*(pODMSaveDocEx))(a,b,c,d)
230 	#define NODMSelectDocEx(a,b,c,d,e,f)		(*(pODMSelectDocEx))(a,b,c,d,e,f)
231 	#define NODMQueryCapability(a,b,c,d,e)		(*(pODMQueryCapability))(a,b,c,d,e)
232 	#define NODMSetDocEvent(a,b,c,d,e,f,g)		(*(pODMSetDocEvent))(a,b,c,d,e,f,g)
233 	#define NODMGetAlternateContent(a,b,c,d,e)	(*(pODMGetAlternateContent))(a,b,c,d,e)
234 	#define NODMSetAlternateContent(a,b,c,d,e)	(*(pODMSetAlternateContent))(a,b,c,d,e)
235 	#define NODMGetDocRelation(a,b,c,d,e,f)		(*(pODMGetDocRelation))(a,b,c,d,e,f)
236 	#define NODMSetDocRelation(a,b,c,d,e,f)		(*(pODMSetDocRelation))(a,b,c,d,e,f)
237 
238 	sal_Bool LoadLibrary();
239 
240 	extern TODMRegisterApp			pODMRegisterApp;
241 	extern TODMUnRegisterApp		pODMUnRegisterApp;
242 	extern TODMSelectDoc			pODMSelectDoc;
243 	extern TODMOpenDoc				pODMOpenDoc;
244 	extern TODMSaveDoc				pODMSaveDoc;
245 	extern TODMCloseDoc				pODMCloseDoc;
246 	extern TODMNewDoc				pODMNewDoc;
247 	extern TODMSaveAs				pODMSaveAs;
248 	extern TODMActivate				pODMActivate;
249 	extern TODMGetDocInfo			pODMGetDocInfo;
250 	extern TODMSetDocInfo			pODMSetDocInfo;
251 	extern TODMGetDMSInfo			pODMGetDMSInfo;
252 	extern TODMGetDMSCount			pODMGetDMSCount;
253 	extern TODMGetDMSList			pODMGetDMSList;
254 	extern TODMGetDMS				pODMGetDMS;
255 	extern TODMSetDMS				pODMSetDMS;
256 	extern TODMQueryExecute			pODMQueryExecute;
257 	extern TODMQueryGetResults		pODMQueryGetResults;
258 	extern TODMQueryClose			pODMQueryClose;
259 	extern TODMCloseDocEx			pODMCloseDocEx;
260 	extern TODMSaveAsEx				pODMSaveAsEx;
261 	extern TODMSaveDocEx			pODMSaveDocEx;
262 	extern TODMSelectDocEx			pODMSelectDocEx;
263 	extern TODMQueryCapability		pODMQueryCapability;
264 	extern TODMSetDocEvent			pODMSetDocEvent;
265 	extern TODMGetAlternateContent	pODMGetAlternateContent;
266 	extern TODMSetAlternateContent	pODMSetAlternateContent;
267 	extern TODMGetDocRelation		pODMGetDocRelation;
268 	extern TODMSetDocRelation		pODMSetDocRelation;
269 
270 }
271 
272 #endif // ODMA_LIB_HXX
273