xref: /aoo4110/main/ucb/source/ucp/odma/odma_lib.hxx (revision b1cdbd2c)
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 #ifndef ODMA_LIB_HXX
24 #define ODMA_LIB_HXX
25 
26 typedef void	            *LPVOID;
27 typedef char				*LPSTR,
28 							*PSTR;
29 typedef const char			*LPCSTR;
30 typedef unsigned long       DWORD;
31 typedef unsigned short      WORD;
32 typedef unsigned short      *LPWORD;
33 typedef DWORD		        *LPDWORD;
34 
35 #define WINAPI				__stdcall
36 #define FAR
37 
38 #include "odma.h"
39 
40 namespace odma
41 {
42 	typedef ODMSTATUS (WINAPI *TODMRegisterApp) (	ODMHANDLE FAR *pOdmHandle,
43 													WORD version,
44 													LPSTR lpszAppId,
45 													DWORD dwEnvData,
46 													LPVOID pReserved);
47 
48 	typedef void (WINAPI *TODMUnRegisterApp)(ODMHANDLE odmHandle);
49 
50 
51 	typedef ODMSTATUS (WINAPI *TODMSelectDoc)(		ODMHANDLE odmHandle,
52 													LPSTR lpszDocId,
53 													LPDWORD pdwFlags);
54 
55 
56 	typedef ODMSTATUS (WINAPI *TODMOpenDoc)(		ODMHANDLE odmHandle,
57 													DWORD flags,
58 													LPSTR lpszDocId,
59 													LPSTR lpszDocLocation);
60 
61 	typedef ODMSTATUS (WINAPI *TODMSaveDoc)(		ODMHANDLE odmHandle,
62 													LPSTR lpszDocId,
63 													LPSTR lpszNewDocId);
64 
65 	typedef ODMSTATUS (WINAPI *TODMCloseDoc)(		ODMHANDLE odmHandle,
66 													LPSTR lpszDocId,
67 													DWORD activeTime,
68 													DWORD pagesPrinted,
69 													LPVOID sessionData,
70 													WORD dataLen);
71 
72 	typedef ODMSTATUS (WINAPI *TODMNewDoc)(			ODMHANDLE odmHandle,
73 													LPSTR lpszDocId,
74 													DWORD dwFlags,
75 													LPSTR lpszFormat,
76 													LPSTR lpszDocLocation);
77 
78 	typedef ODMSTATUS (WINAPI *TODMSaveAs)(			ODMHANDLE odmHandle,
79 													LPSTR lpszDocId,
80 													LPSTR lpszNewDocId,
81 													LPSTR lpszFormat,
82 													ODMSAVEASCALLBACK pcbCallBack,
83 													LPVOID pInstanceData);
84 
85 	typedef ODMSTATUS (WINAPI *TODMActivate)(		ODMHANDLE odmHandle,
86 													WORD action,
87 													LPSTR lpszDocId);
88 
89 	typedef ODMSTATUS (WINAPI *TODMGetDocInfo)(		ODMHANDLE odmHandle,
90 													LPSTR lpszDocId,
91 													WORD item,
92 													LPSTR lpszData,
93 													WORD dataLen);
94 
95 	typedef ODMSTATUS (WINAPI *TODMSetDocInfo)(		ODMHANDLE odmHandle,
96 													LPSTR lpszDocId,
97 													WORD item,
98 													LPSTR lpszData);
99 
100 	typedef ODMSTATUS (WINAPI *TODMGetDMSInfo)(		ODMHANDLE odmHandle,
101 													LPSTR lpszDmsId,
102 													LPWORD pwVerNo,
103 													LPDWORD pdwExtensions);
104 
105 	/* Query Enhancements */
106 	typedef WORD (WINAPI *TODMGetDMSCount)();
107 
108 	typedef WORD (WINAPI *TODMGetDMSList)(			LPSTR buffer,
109 													WORD buffer_size );
110 
111 	typedef ODMSTATUS (WINAPI *TODMGetDMS)(			LPCSTR lpszAppId,
112 													LPSTR lpszDMSId );
113 
114 	typedef ODMSTATUS (WINAPI *TODMSetDMS)(			LPCSTR lpszAppId,
115 													LPCSTR lpszDMSId );
116 
117 	typedef ODMSTATUS (WINAPI *TODMQueryExecute)(	ODMHANDLE odmHandle,
118 													LPCSTR lpszQuery,
119 													DWORD flags,
120 													LPCSTR lpszDMSList,
121 													LPSTR queryId );
122 
123 	typedef ODMSTATUS (WINAPI *TODMQueryGetResults)(ODMHANDLE odmHandle,
124 													LPCSTR queryId,
125 													LPSTR lpszDocId,
126 													LPSTR lpszDocName,
127 													WORD docNameLen,
128 													WORD *docCount );
129 
130 	typedef ODMSTATUS (WINAPI *TODMQueryClose)(		ODMHANDLE odmHandle,
131 													LPCSTR queryId );
132 
133 	/* ODMA 2.0 Enhancements */
134 	typedef ODMSTATUS (WINAPI *TODMCloseDocEx)(		ODMHANDLE odmHandle,
135 													LPSTR lpszDocId,
136 													LPDWORD pdwFlags,
137 													DWORD activeTime,
138 													DWORD pagesPrinted,
139 													LPVOID sessionData,
140 													WORD dataLen);
141 
142 	typedef ODMSTATUS (WINAPI *TODMSaveAsEx)(		ODMHANDLE odmHandle,
143 													LPSTR lpszDocId,
144 													LPSTR lpszNewDocId,
145 													LPSTR lpszFormat,
146 													ODMSAVEASCALLBACK pcbCallBack,
147 													LPVOID pInstanceData,
148 													LPDWORD pdwFlags);
149 
150 	typedef ODMSTATUS (WINAPI *TODMSaveDocEx)(		ODMHANDLE odmHandle,
151 													LPSTR lpszDocId,
152 													LPSTR lpszNewDocId,
153 													LPDWORD pdwFlags);
154 
155 	typedef ODMSTATUS (WINAPI *TODMSelectDocEx)(	ODMHANDLE odmHandle,
156 													LPSTR lpszDocIds,
157 													LPWORD pwDocIdsLen,
158 													LPWORD pwDocCount,
159 													LPDWORD pdwFlags,
160 													LPSTR lpszFormatFilter);
161 
162 	typedef ODMSTATUS (WINAPI *TODMQueryCapability)(ODMHANDLE odmHandle,
163 													LPCSTR lpszDmsId,
164 													DWORD function,
165 													DWORD item,
166 													DWORD flags);
167 
168 	typedef ODMSTATUS (WINAPI *TODMSetDocEvent)(	ODMHANDLE odmHandle,
169 													LPSTR lpszDocId,
170 													DWORD flags,
171 													DWORD event,
172 													LPVOID lpData,
173 													DWORD dwDataLen,
174 													LPSTR lpszComment);
175 
176 	typedef ODMSTATUS (WINAPI *TODMGetAlternateContent)(ODMHANDLE odmHandle,
177 													LPSTR lpszDocId,
178 													LPDWORD pdwFlags,
179 													LPSTR lpszFormat,
180 													LPSTR lpszDocLocation);
181 
182 	typedef ODMSTATUS (WINAPI *TODMSetAlternateContent)(ODMHANDLE odmHandle,
183 													LPSTR lpszDocId,
184 													LPDWORD pdwFlags,
185 													LPSTR lpszFormat,
186 													LPSTR lpszDocLocation);
187 
188 	typedef ODMSTATUS (WINAPI *TODMGetDocRelation)(	ODMHANDLE odmHandle,
189 													LPSTR lpszDocId,
190 													LPDWORD pdwFlags,
191 													LPSTR lpszLinkedId,
192 													LPSTR lpszFormat,
193 													LPSTR lpszPreviousId);
194 
195 	typedef ODMSTATUS (WINAPI *TODMSetDocRelation)(	ODMHANDLE odmHandle,
196 													LPSTR lpszDocId,
197 													LPDWORD pdwFlags,
198 													LPSTR lpszLinkedId,
199 													LPSTR lpszFormat,
200 													LPSTR lpszPreviousId);
201 
202 	// now we define some macros
203 
204 	#define NODMRegisterApp(a,b,c,d,e)			(*(pODMRegisterApp))(a,b,c,d,e)
205 	#define NODMUnRegisterApp(a)				(*(pODMUnRegisterApp))(a)
206 	#define NODMSelectDoc(a,b,c)				(*(pODMSelectDoc))(a,b,c)
207 	#define NODMOpenDoc(a,b,c,d)				(*(pODMOpenDoc))(a,b,c,d)
208 	#define NODMSaveDoc(a,b,c)					(*(pODMSaveDoc))(a,b,c)
209 	#define NODMCloseDoc(a,b,c,d,e,f)			(*(pODMCloseDoc))(a,b,c,d,e,f)
210 	#define NODMNewDoc(a,b,c,d,e)				(*(pODMNewDoc))(a,b,c,d,e)
211 	#define NODMSaveAs(a,b,c,d,e,f)				(*(pODMSaveAs))(a,b,c,d,e,f)
212 	#define NODMActivate(a,b,c)					(*(pODMActivate))(a,b,c)
213 	#define NODMGetDocInfo(a,b,c,d,e)			(*(pODMGetDocInfo))(a,b,c,d,e)
214 	#define NODMSetDocInfo(a,b,c,d)				(*(pODMSetDocInfo))(a,b,c,d)
215 	#define NODMGetDMSInfo(a,b,c,d)				(*(pODMGetDMSInfo))(a,b,c,d)
216 	#define NODMGetDMSCount()					(*(pODMGetDMSCount))()
217 	#define NODMGetDMSList(a,b)					(*(pODMGetDMSList))(a,b)
218 	#define NODMGetDMS(a,b)						(*(pODMGetDMS))(a,b)
219 	#define NODMSetDMS(a,b)						(*(pODMSetDMS))(a,b)
220 	#define NODMQueryExecute(a,b,c,d,e)			(*(pODMQueryExecute))(a,b,c,d,e)
221 	#define NODMQueryGetResults(a,b,c,d,e,f)	(*(pODMQueryGetResults))(a,b,c,d,e,f)
222 	#define NODMQueryClose(a,b)					(*(pODMQueryClose))(a,b)
223 	#define NODMCloseDocEx(a,b,c,d,e,f,g)		(*(pODMCloseDocEx))(a,b,c,d,e,f,g)
224 	#define NODMSaveAsEx(a,b,c,d,e,f,g)			(*(pODMSaveAsEx))(a,b,c,d,e,f,g)
225 	#define NODMSaveDocEx(a,b,c,d)				(*(pODMSaveDocEx))(a,b,c,d)
226 	#define NODMSelectDocEx(a,b,c,d,e,f)		(*(pODMSelectDocEx))(a,b,c,d,e,f)
227 	#define NODMQueryCapability(a,b,c,d,e)		(*(pODMQueryCapability))(a,b,c,d,e)
228 	#define NODMSetDocEvent(a,b,c,d,e,f,g)		(*(pODMSetDocEvent))(a,b,c,d,e,f,g)
229 	#define NODMGetAlternateContent(a,b,c,d,e)	(*(pODMGetAlternateContent))(a,b,c,d,e)
230 	#define NODMSetAlternateContent(a,b,c,d,e)	(*(pODMSetAlternateContent))(a,b,c,d,e)
231 	#define NODMGetDocRelation(a,b,c,d,e,f)		(*(pODMGetDocRelation))(a,b,c,d,e,f)
232 	#define NODMSetDocRelation(a,b,c,d,e,f)		(*(pODMSetDocRelation))(a,b,c,d,e,f)
233 
234 	sal_Bool LoadLibrary();
235 
236 	extern TODMRegisterApp			pODMRegisterApp;
237 	extern TODMUnRegisterApp		pODMUnRegisterApp;
238 	extern TODMSelectDoc			pODMSelectDoc;
239 	extern TODMOpenDoc				pODMOpenDoc;
240 	extern TODMSaveDoc				pODMSaveDoc;
241 	extern TODMCloseDoc				pODMCloseDoc;
242 	extern TODMNewDoc				pODMNewDoc;
243 	extern TODMSaveAs				pODMSaveAs;
244 	extern TODMActivate				pODMActivate;
245 	extern TODMGetDocInfo			pODMGetDocInfo;
246 	extern TODMSetDocInfo			pODMSetDocInfo;
247 	extern TODMGetDMSInfo			pODMGetDMSInfo;
248 	extern TODMGetDMSCount			pODMGetDMSCount;
249 	extern TODMGetDMSList			pODMGetDMSList;
250 	extern TODMGetDMS				pODMGetDMS;
251 	extern TODMSetDMS				pODMSetDMS;
252 	extern TODMQueryExecute			pODMQueryExecute;
253 	extern TODMQueryGetResults		pODMQueryGetResults;
254 	extern TODMQueryClose			pODMQueryClose;
255 	extern TODMCloseDocEx			pODMCloseDocEx;
256 	extern TODMSaveAsEx				pODMSaveAsEx;
257 	extern TODMSaveDocEx			pODMSaveDocEx;
258 	extern TODMSelectDocEx			pODMSelectDocEx;
259 	extern TODMQueryCapability		pODMQueryCapability;
260 	extern TODMSetDocEvent			pODMSetDocEvent;
261 	extern TODMGetAlternateContent	pODMGetAlternateContent;
262 	extern TODMSetAlternateContent	pODMSetAlternateContent;
263 	extern TODMGetDocRelation		pODMGetDocRelation;
264 	extern TODMSetDocRelation		pODMSetDocRelation;
265 
266 }
267 
268 #endif // ODMA_LIB_HXX
269