xref: /trunk/main/ucb/source/ucp/odma/odma.h (revision 6347c3c7)
1 /* odma.h - Definitions, prototypes, etc. for Open Document Managment API
2 	(ODMA) version 2.0.
3                OPEN DOCUMENT MANAGEMENT API LICENSE 1.0
4 
5                  ODMA 2.0 SPECIFICATIONS AND SOFTWARE
6                  ------------------------------------
7 
8                Copyright � 1994-1998 AIIM International
9 
10 LICENSE:
11 
12     Redistribution and use in source and binary forms, with or
13     without modifications, are permitted provided that the
14     following conditions are met:
15 
16       * Redistributions of source code must retain the above
17         copyright notice, this list of conditions and the
18         following disclaimer.
19 
20       * Redistributions in binary form must reproduce the
21         above copyright notice, this list of conditions and
22         the following disclaimer in the documentation and/or
23         other materials provided with the distribution.
24 
25       * Neither the name of AIIM International nor the names
26         of its contributors may be used to endorse or promote
27         products derived from this software without specific
28         prior written permission.
29 
30 DISCLAIMER:
31 
32     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
33     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
34     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
35     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
36     DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
37     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
38     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
39     BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
40     SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
41     INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
42     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
43     NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
44     OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
45     SUCH DAMAGE.
46 
47 	COPYRIGHT (C) 1994, 1995
48 	AIIM International
49 	All Right Reserved
50 */
51 
52 #ifndef ODMA_H
53 #define ODMA_H
54 
55 /* Type definitions */
56 typedef LPVOID ODMHANDLE;
57 typedef LPSTR (*ODMSAVEASCALLBACK)(DWORD dwEnvData, LPSTR lpszFormat, LPVOID pInstanceData);
58 typedef int ODMSTATUS;
59 
60 /* Constants */
61 #define ODM_API_VERSION			200		/* Version of the API */
62 
63 #ifdef WIN32
64 	#define ODM_DOCID_MAX		255		/* Win32 */
65 
66 #elif defined( _WINDOWS_ ) || defined( _MSDOS )
67 	#define ODM_DOCID_MAX		80		/* Windows 3.x */
68 
69 #else
70 	#define ODM_DOCID_MAX		255		/* Other platforms */
71 #endif
72 
73 #define ODM_DMSID_MAX			9		/* Max length of a DMS ID including the
74 										/* terminating NULL character.  */
75 
76 #define ODM_APPID_MAX			16		/* Max length of a application ID including
77 										/* the terminating NULL character.  */
78 
79 // ODMA 2.0
80 #define ODM_QUERYID_MAX			255		// Max length of a query ID including
81 													// the terminating NULL character.
82 
83 #define ODM_FORMAT_MAX			81 // Max length of a format including
84 													// the terminating NULL character.
85 
86 // Maximum length of a filename returned by ODMA including the terminating
87 //	NULL character.  Platform dependent.
88 
89 #ifdef WIN32
90 	#define ODM_FILENAME_MAX	255		/* Win32 */
91 
92 #elif defined( _WINDOWS_ ) || defined( _MSDOS )
93 	#define ODM_FILENAME_MAX	128		/* Windows 3.x */
94 
95 #elif defined( unix ) || defined( _UNIX )
96 	#define ODM_FILENAME_MAX	1024	/* Unix */
97 
98 #else
99 	#define ODM_FILENAME_MAX	255		/* Other platforms */
100 #endif
101 
102 
103 /* Common format type names */
104 #define ODM_FORMAT_TEXT	"Text"
105 #define ODM_FORMAT_RTF	"Rich text format"
106 #define ODM_FORMAT_DCA	"DCA RFT"		/* IBM DCA Rich Format Text */
107 #define ODM_FORMAT_TIFF	"Tiff"
108 #define ODM_FORMAT_GIF	"Gif"				/* Compuserve Graphics Interchange Format */
109 #define ODM_FORMAT_BMP	"Windows bitmap"
110 #define ODM_FORMAT_PCX	"PCX"
111 #define ODM_FORMAT_CGM	"CGM"				/* Computer Graphics Metafile */
112 #define ODM_FORMAT_EXE	"Executable file"
113 #define ODM_FORMAT_PCL	"PCL"				/* HP Printer Control Language */
114 #define ODM_FORMAT_PS	"PostScript"
115 
116 
117 /* Error returns */
118 #define ODM_SUCCESS			0		// Success!
119 #define ODM_E_FAIL			1		/* Unspecified failure */
120 #define ODM_E_CANCEL		2		/* Action was cancelled at user's request */
121 #define ODM_E_NODMS			3		/* DMS not registered */
122 #define ODM_E_CANTINIT		4		/* DMS failed to initalize */
123 #define ODM_E_VERSION		5		/* DMS doesn't support the requested
124 									           version of ODMA */
125 #define ODM_E_APPSELECT		6        /* User has indicated that he wants to use
126                                        the application's file selection
127                                        capabilities rather than those of the
128                                        DMS. */
129 #define ODM_E_USERINT		7        /* Requested action cannot be performed
130                                        without user interaction, but silent
131                                        mode was specified. */
132 #define ODM_E_HANDLE		8        /* The DMHANDLE argument was invalid. */
133 #define ODM_E_ACCESS		9        /* User does not have requested access
134                                        rights to specified document. */
135 #define ODM_E_INUSE			10        /* Document is currently in use and cannot
136                                        be accessed in specified mode. */
137 #define ODM_E_DOCID			11        /* Invalid document ID */
138 #define ODM_E_OPENMODE		12        /* The specified action is incompatible
139                                        with the mode in which the document was
140                                        opened. */
141 #define ODM_E_NOOPEN		13        /* The specified document is not open. */
142 #define ODM_E_ITEM			14        /* Invalid item specifier. */
143 #define ODM_E_OTHERAPP		15        /* Selected document was for another app. */
144 #define ODM_E_NOMOREDATA	16		/* No more data is available */
145 #define ODM_E_PARTIALSUCCESS 17		/* */
146 // Additional Error code from ODMA 2.0
147 #define ODM_E_REQARG		18		/* */
148 #define ODM_E_NOSUPPORT		19		/* */
149 #define ODM_E_TRUNCATED		20		/* */
150 #define ODM_E_INVARG  21
151 #define ODM_E_OFFLINE  22		/* */
152 
153 
154 // ODMOpenDoc modes
155 #define ODM_MODIFYMODE		1        /* Open document in a modifiable mode. */
156 #define ODM_VIEWMODE		2        /* Open document in non-modifiable mode. */
157 // ODMA 2.0
158 #define ODM_REFCOPY			3
159 
160 
161 // Actions for ODMActivate
162 #define ODM_NONE			0        /* No specific action is requested.  */
163 #define ODM_DELETE			1        /* Delete the specified document.  */
164 #define ODM_SHOWATTRIBUTES	2        /* Display the specified document's profile
165                                        or attributes. */
166 #define ODM_EDITATTRIBUTES	3        /* Edit the specified document's profile or
167                                        attributes. */
168 #define ODM_VIEWDOC			4        /* Display the specified document in a
169                                        viewer window. */
170 #define ODM_OPENDOC			5        /* Open the specified document in its
171                                        native application.  */
172 // ODMA 2.0
173 #define ODM_NEWDOC			6
174 #define ODM_CHECKOUT		7
175 #define ODM_CANCELCHECKOUT	8
176 #define ODM_CHECKIN			9
177 #define ODM_SHOWHISTORY		10
178 
179 
180 // Item selectors for ODMGetDocInfo and ODMSetDocInfo
181 #define ODM_AUTHOR			1        /* Author of the document. */
182 #define ODM_NAME			2        /* Descriptive name of the document.  */
183 #define ODM_TYPE			3        /* Type of the document.  */
184 #define ODM_TITLETEXT		4        /* Suggested text to display in the
185                                        document window's title bar. */
186 #define ODM_DMS_DEFINED		5        /* DMS defined data. */
187 #define ODM_CONTENTFORMAT	6        /* String describing document's format */
188 // ODMA 2.0
189 #define ODM_ALTERNATE_RENDERINGS	7
190 #define ODM_CHECKEDOUTBY	8
191 #define ODM_CHECKOUTCOMMENT	9
192 #define ODM_CHECKOUTDATE	10
193 #define ODM_CREATEDBY		11
194 #define ODM_CREATEDDATE		12
195 #define ODM_DOCID_LATEST	13
196 #define ODM_DOCID_RELEASED	14
197 #define ODM_DOCVERSION		15
198 #define ODM_DOCVERSION_LATEST	16
199 #define ODM_DOCVERSION_RELEASED	17
200 #define ODM_LOCATION		18
201 #define ODM_KEYWORDS		19
202 #define ODM_LASTCHECKINBY	20
203 #define ODM_LASTCHECKINDATE	21
204 #define ODM_MODIFYDATE		22
205 #define ODM_MODIFYDATE_LATEST	23
206 #define ODM_MODIFYDATE_RELEASED	24
207 #define ODM_OWNER			25
208 #define ODM_SUBJECT			26
209 #define ODM_TITLETEXT_RO	27
210 #define ODM_URL				28
211 
212 
213 // Item selectors for ODMQueryCapability ODMA 2.0
214 #define ODM_QC_ACTIVATE				1
215 #define ODM_QC_CLOSEDOC				2
216 #define ODM_QC_CLOSEDOCEX			3
217 #define ODM_QC_GETALTERNATECONTENT	4
218 #define ODM_QC_GETDMSINFO			5
219 #define ODM_QC_GETDOCINFO			6
220 #define ODM_QC_GETDOCRELATION		7
221 #define ODM_QC_GETLEADMONIKER		8
222 #define ODM_QC_NEWDOC				9
223 #define ODM_QC_OPENDOC				10
224 #define ODM_QC_QUERYCLOSE			11
225 #define ODM_QC_QUERYEXECUTE			12
226 #define ODM_QC_QUERYGETRESULTS		13
227 #define ODM_QC_SAVEAS				14
228 #define ODM_QC_SAVEASEX				15
229 #define ODM_QC_SAVEDOC				16
230 #define ODM_QC_SAVEDOCEX			17
231 #define ODM_QC_SELECTDOC			18
232 #define ODM_QC_SELECTDOCEX			19
233 #define ODM_QC_SETALTERNATECONTENT	20
234 #define ODM_QC_SETDOCEVENT			21
235 #define ODM_QC_SETDOCRELATION		22
236 #define ODM_QC_SETDOCINFO			23
237 
238 
239 // Misc. modes, flags
240 #define ODM_SILENT			16        /* Don't interact with the user while
241                                        fulfilling this request. */
242 //ODMA 2.0
243 #define ODM_VERSION_SAME	1
244 #define ODM_VERSION_MAJOR	2
245 #define ODM_VERSION_MINOR	4
246 #define ODM_VERSION_CHANGED	8
247 #define ODM_ALT_DELETE		32
248 
249 //ODMA 2.0 DMS Info Flags
250 #define ODM_EXT_QUERY		1
251 #define ODM_EXT_WORKFLOW 	2
252 
253 // Flags for Query Interface
254 #define ODM_ALL				1		// All DMS's should be searched
255 #define ODM_SPECIFIC		2		// Only specific DMS's should be searched
256 
257 
258 // Function prototypes
259 #ifdef __cplusplus
260 extern "C" {
261 #endif
262 
263 ODMSTATUS WINAPI ODMRegisterApp(ODMHANDLE FAR *pOdmHandle, WORD version,
264 	LPSTR lpszAppId, DWORD dwEnvData, LPVOID pReserved);
265 
266 void WINAPI ODMUnRegisterApp(ODMHANDLE odmHandle);
267 
268 ODMSTATUS WINAPI ODMSelectDoc(ODMHANDLE odmHandle, LPSTR lpszDocId,
269 	LPDWORD pdwFlags);
270 
271 ODMSTATUS WINAPI ODMOpenDoc(ODMHANDLE odmHandle, DWORD flags,
272 	LPSTR lpszDocId, LPSTR lpszDocLocation);
273 
274 ODMSTATUS WINAPI ODMSaveDoc(ODMHANDLE odmHandle, LPSTR lpszDocId,
275 	LPSTR lpszNewDocId);
276 
277 ODMSTATUS WINAPI ODMCloseDoc(ODMHANDLE odmHandle, LPSTR lpszDocId,
278 	DWORD activeTime, DWORD pagesPrinted, LPVOID sessionData, WORD dataLen);
279 
280 ODMSTATUS WINAPI ODMNewDoc(ODMHANDLE odmHandle, LPSTR lpszDocId,
281 	DWORD dwFlags, LPSTR lpszFormat, LPSTR lpszDocLocation);
282 
283 ODMSTATUS WINAPI ODMSaveAs(ODMHANDLE odmHandle, LPSTR lpszDocId,
284 	LPSTR lpszNewDocId, LPSTR lpszFormat, ODMSAVEASCALLBACK pcbCallBack,
285 	LPVOID pInstanceData);
286 
287 ODMSTATUS WINAPI ODMActivate(ODMHANDLE odmHandle, WORD action,
288 	LPSTR lpszDocId);
289 
290 ODMSTATUS WINAPI ODMGetDocInfo(ODMHANDLE odmHandle, LPSTR lpszDocId,
291 	WORD item, LPSTR lpszData, WORD dataLen);
292 
293 ODMSTATUS WINAPI ODMSetDocInfo(ODMHANDLE odmHandle, LPSTR lpszDocId,
294 	WORD item, LPSTR lpszData);
295 
296 ODMSTATUS WINAPI ODMGetDMSInfo(ODMHANDLE odmHandle, LPSTR lpszDmsId,
297 	LPWORD pwVerNo, LPDWORD pdwExtensions);
298 
299 /* Query Enhancements */
300 WORD WINAPI ODMGetDMSCount();
301 
302 WORD WINAPI ODMGetDMSList( LPSTR buffer, WORD buffer_size );
303 
304 ODMSTATUS WINAPI ODMGetDMS( LPCSTR lpszAppId, LPSTR lpszDMSId );
305 
306 ODMSTATUS WINAPI ODMSetDMS( LPCSTR lpszAppId, LPCSTR lpszDMSId );
307 
308 ODMSTATUS WINAPI ODMQueryExecute(ODMHANDLE odmHandle, LPCSTR lpszQuery,
309 								 DWORD flags, LPCSTR lpszDMSList, LPSTR queryId );
310 
311 ODMSTATUS WINAPI ODMQueryGetResults(ODMHANDLE odmHandle, LPCSTR queryId,
312 									LPSTR lpszDocId, LPSTR lpszDocName, WORD docNameLen,
313 									WORD *docCount );
314 
315 ODMSTATUS WINAPI ODMQueryClose(ODMHANDLE odmHandle, LPCSTR queryId );
316 
317 /* ODMA 2.0 Enhancements */
318 ODMSTATUS WINAPI ODMCloseDocEx(ODMHANDLE odmHandle, LPSTR lpszDocId,
319 							LPDWORD pdwFlags, DWORD activeTime, DWORD pagesPrinted,
320 							LPVOID sessionData, WORD dataLen);
321 
322 ODMSTATUS WINAPI ODMSaveAsEx(ODMHANDLE odmHandle, LPSTR lpszDocId,
323 							LPSTR lpszNewDocId, LPSTR lpszFormat, ODMSAVEASCALLBACK pcbCallBack,
324 							LPVOID pInstanceData, LPDWORD pdwFlags);
325 
326 ODMSTATUS WINAPI ODMSaveDocEx(ODMHANDLE odmHandle, LPSTR lpszDocId,
327 							LPSTR lpszNewDocId,	LPDWORD pdwFlags);
328 
329 ODMSTATUS WINAPI ODMSelectDocEx(ODMHANDLE odmHandle, LPSTR lpszDocIds,
330 							LPWORD pwDocIdsLen, LPWORD pwDocCount, LPDWORD pdwFlags,
331 							LPSTR lpszFormatFilter);
332 
333 ODMSTATUS WINAPI ODMQueryCapability(ODMHANDLE odmHandle, LPCSTR lpszDmsId,
334 							DWORD function, DWORD item, DWORD flags);
335 
336 ODMSTATUS WINAPI ODMSetDocEvent(ODMHANDLE odmHandle, LPSTR lpszDocId,
337 							DWORD flags, DWORD event, LPVOID lpData, DWORD dwDataLen,
338 							LPSTR lpszComment);
339 
340 ODMSTATUS WINAPI ODMGetAlternateContent(ODMHANDLE odmHandle, LPSTR lpszDocId,
341 							LPDWORD pdwFlags, LPSTR lpszFormat, LPSTR lpszDocLocation);
342 
343 ODMSTATUS WINAPI ODMSetAlternateContent(ODMHANDLE odmHandle, LPSTR lpszDocId,
344 							LPDWORD pdwFlags, LPSTR lpszFormat, LPSTR lpszDocLocation);
345 
346 ODMSTATUS WINAPI ODMGetDocRelation(ODMHANDLE odmHandle, LPSTR lpszDocId,
347 							LPDWORD pdwFlags, LPSTR lpszLinkedId, LPSTR lpszFormat,
348 							LPSTR lpszPreviousId);
349 
350 ODMSTATUS WINAPI ODMSetDocRelation(ODMHANDLE odmHandle, LPSTR lpszDocId,
351 							LPDWORD pdwFlags, LPSTR lpszLinkedId, LPSTR lpszFormat,
352 							LPSTR lpszPreviousId);
353 
354 #ifdef __cplusplus
355 }
356 #endif
357 
358 #endif
359