Update ooo320-m1
[ooovba.git] / ucb / source / ucp / odma / odma.h
blobe3ab8acc4adcc90c3a8d4d6efd0b1aea6c209561
1 /* odma.h - Definitions, prototypes, etc. for Open Document Managment API
2 (ODMA) version 2.0.
4 COPYRIGHT (C) 1994, 1995
5 AIIM International
6 All Right Reserved
7 */
9 #ifndef ODMA_H
10 #define ODMA_H
12 /* Type definitions */
13 typedef LPVOID ODMHANDLE;
14 typedef LPSTR (*ODMSAVEASCALLBACK)(DWORD dwEnvData, LPSTR lpszFormat, LPVOID pInstanceData);
15 typedef int ODMSTATUS;
17 /* Constants */
18 #define ODM_API_VERSION 200 /* Version of the API */
20 #ifdef WIN32
21 #define ODM_DOCID_MAX 255 /* Win32 */
23 #elif defined( _WINDOWS_ ) || defined( _MSDOS )
24 #define ODM_DOCID_MAX 80 /* Windows 3.x */
26 #else
27 #define ODM_DOCID_MAX 255 /* Other platforms */
28 #endif
30 #define ODM_DMSID_MAX 9 /* Max length of a DMS ID including the
31 /* terminating NULL character. */
33 #define ODM_APPID_MAX 16 /* Max length of a application ID including
34 /* the terminating NULL character. */
36 // ODMA 2.0
37 #define ODM_QUERYID_MAX 255 // Max length of a query ID including
38 // the terminating NULL character.
40 #define ODM_FORMAT_MAX 81 // Max length of a format including
41 // the terminating NULL character.
43 // Maximum length of a filename returned by ODMA including the terminating
44 // NULL character. Platform dependent.
46 #ifdef WIN32
47 #define ODM_FILENAME_MAX 255 /* Win32 */
49 #elif defined( _WINDOWS_ ) || defined( _MSDOS )
50 #define ODM_FILENAME_MAX 128 /* Windows 3.x */
52 #elif defined( unix ) || defined( _UNIX )
53 #define ODM_FILENAME_MAX 1024 /* Unix */
55 #else
56 #define ODM_FILENAME_MAX 255 /* Other platforms */
57 #endif
60 /* Common format type names */
61 #define ODM_FORMAT_TEXT "Text"
62 #define ODM_FORMAT_RTF "Rich text format"
63 #define ODM_FORMAT_DCA "DCA RFT" /* IBM DCA Rich Format Text */
64 #define ODM_FORMAT_TIFF "Tiff"
65 #define ODM_FORMAT_GIF "Gif" /* Compuserve Graphics Interchange Format */
66 #define ODM_FORMAT_BMP "Windows bitmap"
67 #define ODM_FORMAT_PCX "PCX"
68 #define ODM_FORMAT_CGM "CGM" /* Computer Graphics Metafile */
69 #define ODM_FORMAT_EXE "Executable file"
70 #define ODM_FORMAT_PCL "PCL" /* HP Printer Control Language */
71 #define ODM_FORMAT_PS "PostScript"
74 /* Error returns */
75 #define ODM_SUCCESS 0 // Success!
76 #define ODM_E_FAIL 1 /* Unspecified failure */
77 #define ODM_E_CANCEL 2 /* Action was cancelled at user's request */
78 #define ODM_E_NODMS 3 /* DMS not registered */
79 #define ODM_E_CANTINIT 4 /* DMS failed to initalize */
80 #define ODM_E_VERSION 5 /* DMS doesn't support the requested
81 version of ODMA */
82 #define ODM_E_APPSELECT 6 /* User has indicated that he wants to use
83 the application's file selection
84 capabilities rather than those of the
85 DMS. */
86 #define ODM_E_USERINT 7 /* Requested action cannot be performed
87 without user interaction, but silent
88 mode was specified. */
89 #define ODM_E_HANDLE 8 /* The DMHANDLE argument was invalid. */
90 #define ODM_E_ACCESS 9 /* User does not have requested access
91 rights to specified document. */
92 #define ODM_E_INUSE 10 /* Document is currently in use and cannot
93 be accessed in specified mode. */
94 #define ODM_E_DOCID 11 /* Invalid document ID */
95 #define ODM_E_OPENMODE 12 /* The specified action is incompatible
96 with the mode in which the document was
97 opened. */
98 #define ODM_E_NOOPEN 13 /* The specified document is not open. */
99 #define ODM_E_ITEM 14 /* Invalid item specifier. */
100 #define ODM_E_OTHERAPP 15 /* Selected document was for another app. */
101 #define ODM_E_NOMOREDATA 16 /* No more data is available */
102 #define ODM_E_PARTIALSUCCESS 17 /* */
103 // Additional Error code from ODMA 2.0
104 #define ODM_E_REQARG 18 /* */
105 #define ODM_E_NOSUPPORT 19 /* */
106 #define ODM_E_TRUNCATED 20 /* */
107 #define ODM_E_INVARG 21
108 #define ODM_E_OFFLINE 22 /* */
111 // ODMOpenDoc modes
112 #define ODM_MODIFYMODE 1 /* Open document in a modifiable mode. */
113 #define ODM_VIEWMODE 2 /* Open document in non-modifiable mode. */
114 // ODMA 2.0
115 #define ODM_REFCOPY 3
118 // Actions for ODMActivate
119 #define ODM_NONE 0 /* No specific action is requested. */
120 #define ODM_DELETE 1 /* Delete the specified document. */
121 #define ODM_SHOWATTRIBUTES 2 /* Display the specified document's profile
122 or attributes. */
123 #define ODM_EDITATTRIBUTES 3 /* Edit the specified document's profile or
124 attributes. */
125 #define ODM_VIEWDOC 4 /* Display the specified document in a
126 viewer window. */
127 #define ODM_OPENDOC 5 /* Open the specified document in its
128 native application. */
129 // ODMA 2.0
130 #define ODM_NEWDOC 6
131 #define ODM_CHECKOUT 7
132 #define ODM_CANCELCHECKOUT 8
133 #define ODM_CHECKIN 9
134 #define ODM_SHOWHISTORY 10
137 // Item selectors for ODMGetDocInfo and ODMSetDocInfo
138 #define ODM_AUTHOR 1 /* Author of the document. */
139 #define ODM_NAME 2 /* Descriptive name of the document. */
140 #define ODM_TYPE 3 /* Type of the document. */
141 #define ODM_TITLETEXT 4 /* Suggested text to display in the
142 document window's title bar. */
143 #define ODM_DMS_DEFINED 5 /* DMS defined data. */
144 #define ODM_CONTENTFORMAT 6 /* String describing document's format */
145 // ODMA 2.0
146 #define ODM_ALTERNATE_RENDERINGS 7
147 #define ODM_CHECKEDOUTBY 8
148 #define ODM_CHECKOUTCOMMENT 9
149 #define ODM_CHECKOUTDATE 10
150 #define ODM_CREATEDBY 11
151 #define ODM_CREATEDDATE 12
152 #define ODM_DOCID_LATEST 13
153 #define ODM_DOCID_RELEASED 14
154 #define ODM_DOCVERSION 15
155 #define ODM_DOCVERSION_LATEST 16
156 #define ODM_DOCVERSION_RELEASED 17
157 #define ODM_LOCATION 18
158 #define ODM_KEYWORDS 19
159 #define ODM_LASTCHECKINBY 20
160 #define ODM_LASTCHECKINDATE 21
161 #define ODM_MODIFYDATE 22
162 #define ODM_MODIFYDATE_LATEST 23
163 #define ODM_MODIFYDATE_RELEASED 24
164 #define ODM_OWNER 25
165 #define ODM_SUBJECT 26
166 #define ODM_TITLETEXT_RO 27
167 #define ODM_URL 28
170 // Item selectors for ODMQueryCapability ODMA 2.0
171 #define ODM_QC_ACTIVATE 1
172 #define ODM_QC_CLOSEDOC 2
173 #define ODM_QC_CLOSEDOCEX 3
174 #define ODM_QC_GETALTERNATECONTENT 4
175 #define ODM_QC_GETDMSINFO 5
176 #define ODM_QC_GETDOCINFO 6
177 #define ODM_QC_GETDOCRELATION 7
178 #define ODM_QC_GETLEADMONIKER 8
179 #define ODM_QC_NEWDOC 9
180 #define ODM_QC_OPENDOC 10
181 #define ODM_QC_QUERYCLOSE 11
182 #define ODM_QC_QUERYEXECUTE 12
183 #define ODM_QC_QUERYGETRESULTS 13
184 #define ODM_QC_SAVEAS 14
185 #define ODM_QC_SAVEASEX 15
186 #define ODM_QC_SAVEDOC 16
187 #define ODM_QC_SAVEDOCEX 17
188 #define ODM_QC_SELECTDOC 18
189 #define ODM_QC_SELECTDOCEX 19
190 #define ODM_QC_SETALTERNATECONTENT 20
191 #define ODM_QC_SETDOCEVENT 21
192 #define ODM_QC_SETDOCRELATION 22
193 #define ODM_QC_SETDOCINFO 23
196 // Misc. modes, flags
197 #define ODM_SILENT 16 /* Don't interact with the user while
198 fulfilling this request. */
199 //ODMA 2.0
200 #define ODM_VERSION_SAME 1
201 #define ODM_VERSION_MAJOR 2
202 #define ODM_VERSION_MINOR 4
203 #define ODM_VERSION_CHANGED 8
204 #define ODM_ALT_DELETE 32
206 //ODMA 2.0 DMS Info Flags
207 #define ODM_EXT_QUERY 1
208 #define ODM_EXT_WORKFLOW 2
210 // Flags for Query Interface
211 #define ODM_ALL 1 // All DMS's should be searched
212 #define ODM_SPECIFIC 2 // Only specific DMS's should be searched
215 // Function prototypes
216 #ifdef __cplusplus
217 extern "C" {
218 #endif
220 ODMSTATUS WINAPI ODMRegisterApp(ODMHANDLE FAR *pOdmHandle, WORD version,
221 LPSTR lpszAppId, DWORD dwEnvData, LPVOID pReserved);
223 void WINAPI ODMUnRegisterApp(ODMHANDLE odmHandle);
225 ODMSTATUS WINAPI ODMSelectDoc(ODMHANDLE odmHandle, LPSTR lpszDocId,
226 LPDWORD pdwFlags);
228 ODMSTATUS WINAPI ODMOpenDoc(ODMHANDLE odmHandle, DWORD flags,
229 LPSTR lpszDocId, LPSTR lpszDocLocation);
231 ODMSTATUS WINAPI ODMSaveDoc(ODMHANDLE odmHandle, LPSTR lpszDocId,
232 LPSTR lpszNewDocId);
234 ODMSTATUS WINAPI ODMCloseDoc(ODMHANDLE odmHandle, LPSTR lpszDocId,
235 DWORD activeTime, DWORD pagesPrinted, LPVOID sessionData, WORD dataLen);
237 ODMSTATUS WINAPI ODMNewDoc(ODMHANDLE odmHandle, LPSTR lpszDocId,
238 DWORD dwFlags, LPSTR lpszFormat, LPSTR lpszDocLocation);
240 ODMSTATUS WINAPI ODMSaveAs(ODMHANDLE odmHandle, LPSTR lpszDocId,
241 LPSTR lpszNewDocId, LPSTR lpszFormat, ODMSAVEASCALLBACK pcbCallBack,
242 LPVOID pInstanceData);
244 ODMSTATUS WINAPI ODMActivate(ODMHANDLE odmHandle, WORD action,
245 LPSTR lpszDocId);
247 ODMSTATUS WINAPI ODMGetDocInfo(ODMHANDLE odmHandle, LPSTR lpszDocId,
248 WORD item, LPSTR lpszData, WORD dataLen);
250 ODMSTATUS WINAPI ODMSetDocInfo(ODMHANDLE odmHandle, LPSTR lpszDocId,
251 WORD item, LPSTR lpszData);
253 ODMSTATUS WINAPI ODMGetDMSInfo(ODMHANDLE odmHandle, LPSTR lpszDmsId,
254 LPWORD pwVerNo, LPDWORD pdwExtensions);
256 /* Query Enhancements */
257 WORD WINAPI ODMGetDMSCount();
259 WORD WINAPI ODMGetDMSList( LPSTR buffer, WORD buffer_size );
261 ODMSTATUS WINAPI ODMGetDMS( LPCSTR lpszAppId, LPSTR lpszDMSId );
263 ODMSTATUS WINAPI ODMSetDMS( LPCSTR lpszAppId, LPCSTR lpszDMSId );
265 ODMSTATUS WINAPI ODMQueryExecute(ODMHANDLE odmHandle, LPCSTR lpszQuery,
266 DWORD flags, LPCSTR lpszDMSList, LPSTR queryId );
268 ODMSTATUS WINAPI ODMQueryGetResults(ODMHANDLE odmHandle, LPCSTR queryId,
269 LPSTR lpszDocId, LPSTR lpszDocName, WORD docNameLen,
270 WORD *docCount );
272 ODMSTATUS WINAPI ODMQueryClose(ODMHANDLE odmHandle, LPCSTR queryId );
274 /* ODMA 2.0 Enhancements */
275 ODMSTATUS WINAPI ODMCloseDocEx(ODMHANDLE odmHandle, LPSTR lpszDocId,
276 LPDWORD pdwFlags, DWORD activeTime, DWORD pagesPrinted,
277 LPVOID sessionData, WORD dataLen);
279 ODMSTATUS WINAPI ODMSaveAsEx(ODMHANDLE odmHandle, LPSTR lpszDocId,
280 LPSTR lpszNewDocId, LPSTR lpszFormat, ODMSAVEASCALLBACK pcbCallBack,
281 LPVOID pInstanceData, LPDWORD pdwFlags);
283 ODMSTATUS WINAPI ODMSaveDocEx(ODMHANDLE odmHandle, LPSTR lpszDocId,
284 LPSTR lpszNewDocId, LPDWORD pdwFlags);
286 ODMSTATUS WINAPI ODMSelectDocEx(ODMHANDLE odmHandle, LPSTR lpszDocIds,
287 LPWORD pwDocIdsLen, LPWORD pwDocCount, LPDWORD pdwFlags,
288 LPSTR lpszFormatFilter);
290 ODMSTATUS WINAPI ODMQueryCapability(ODMHANDLE odmHandle, LPCSTR lpszDmsId,
291 DWORD function, DWORD item, DWORD flags);
293 ODMSTATUS WINAPI ODMSetDocEvent(ODMHANDLE odmHandle, LPSTR lpszDocId,
294 DWORD flags, DWORD event, LPVOID lpData, DWORD dwDataLen,
295 LPSTR lpszComment);
297 ODMSTATUS WINAPI ODMGetAlternateContent(ODMHANDLE odmHandle, LPSTR lpszDocId,
298 LPDWORD pdwFlags, LPSTR lpszFormat, LPSTR lpszDocLocation);
300 ODMSTATUS WINAPI ODMSetAlternateContent(ODMHANDLE odmHandle, LPSTR lpszDocId,
301 LPDWORD pdwFlags, LPSTR lpszFormat, LPSTR lpszDocLocation);
303 ODMSTATUS WINAPI ODMGetDocRelation(ODMHANDLE odmHandle, LPSTR lpszDocId,
304 LPDWORD pdwFlags, LPSTR lpszLinkedId, LPSTR lpszFormat,
305 LPSTR lpszPreviousId);
307 ODMSTATUS WINAPI ODMSetDocRelation(ODMHANDLE odmHandle, LPSTR lpszDocId,
308 LPDWORD pdwFlags, LPSTR lpszLinkedId, LPSTR lpszFormat,
309 LPSTR lpszPreviousId);
311 #ifdef __cplusplus
313 #endif
315 #endif