1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* odma.h - Definitions, prototypes, etc. for Open Document Managment API
5 COPYRIGHT (C) 1994, 1995
13 /* Type definitions */
14 typedef LPVOID ODMHANDLE
;
15 typedef LPSTR (*ODMSAVEASCALLBACK
)(DWORD dwEnvData
, LPSTR lpszFormat
, LPVOID pInstanceData
);
16 typedef int ODMSTATUS
;
19 #define ODM_API_VERSION 200 /* Version of the API */
22 #define ODM_DOCID_MAX 255 /* Win32 */
24 #elif defined( _WINDOWS_ ) || defined( _MSDOS )
25 #define ODM_DOCID_MAX 80 /* Windows 3.x */
28 #define ODM_DOCID_MAX 255 /* Other platforms */
31 #define ODM_DMSID_MAX 9 /* Max length of a DMS ID including the
32 terminating NULL character. */
34 #define ODM_APPID_MAX 16 /* Max length of a application ID including
35 the terminating NULL character. */
38 #define ODM_QUERYID_MAX 255 // Max length of a query ID including
39 // the terminating NULL character.
41 #define ODM_FORMAT_MAX 81 // Max length of a format including
42 // the terminating NULL character.
44 // Maximum length of a filename returned by ODMA including the terminating
45 // NULL character. Platform dependent.
48 #define ODM_FILENAME_MAX 255 /* Win32 */
50 #elif defined( _WINDOWS_ ) || defined( _MSDOS )
51 #define ODM_FILENAME_MAX 128 /* Windows 3.x */
53 #elif defined( unix ) || defined( _UNIX )
54 #define ODM_FILENAME_MAX 1024 /* Unix */
57 #define ODM_FILENAME_MAX 255 /* Other platforms */
61 /* Common format type names */
62 #define ODM_FORMAT_TEXT "Text"
63 #define ODM_FORMAT_RTF "Rich text format"
64 #define ODM_FORMAT_DCA "DCA RFT" /* IBM DCA Rich Format Text */
65 #define ODM_FORMAT_TIFF "Tiff"
66 #define ODM_FORMAT_GIF "Gif" /* Compuserve Graphics Interchange Format */
67 #define ODM_FORMAT_BMP "Windows bitmap"
68 #define ODM_FORMAT_PCX "PCX"
69 #define ODM_FORMAT_CGM "CGM" /* Computer Graphics Metafile */
70 #define ODM_FORMAT_EXE "Executable file"
71 #define ODM_FORMAT_PCL "PCL" /* HP Printer Control Language */
72 #define ODM_FORMAT_PS "PostScript"
76 #define ODM_SUCCESS 0 // Success!
77 #define ODM_E_FAIL 1 /* Unspecified failure */
78 #define ODM_E_CANCEL 2 /* Action was cancelled at user's request */
79 #define ODM_E_NODMS 3 /* DMS not registered */
80 #define ODM_E_CANTINIT 4 /* DMS failed to initalize */
81 #define ODM_E_VERSION 5 /* DMS doesn't support the requested
83 #define ODM_E_APPSELECT 6 /* User has indicated that he wants to use
84 the application's file selection
85 capabilities rather than those of the
87 #define ODM_E_USERINT 7 /* Requested action cannot be performed
88 without user interaction, but silent
89 mode was specified. */
90 #define ODM_E_HANDLE 8 /* The DMHANDLE argument was invalid. */
91 #define ODM_E_ACCESS 9 /* User does not have requested access
92 rights to specified document. */
93 #define ODM_E_INUSE 10 /* Document is currently in use and cannot
94 be accessed in specified mode. */
95 #define ODM_E_DOCID 11 /* Invalid document ID */
96 #define ODM_E_OPENMODE 12 /* The specified action is incompatible
97 with the mode in which the document was
99 #define ODM_E_NOOPEN 13 /* The specified document is not open. */
100 #define ODM_E_ITEM 14 /* Invalid item specifier. */
101 #define ODM_E_OTHERAPP 15 /* Selected document was for another app. */
102 #define ODM_E_NOMOREDATA 16 /* No more data is available */
103 #define ODM_E_PARTIALSUCCESS 17 /* */
104 // Additional Error code from ODMA 2.0
105 #define ODM_E_REQARG 18 /* */
106 #define ODM_E_NOSUPPORT 19 /* */
107 #define ODM_E_TRUNCATED 20 /* */
108 #define ODM_E_INVARG 21
109 #define ODM_E_OFFLINE 22 /* */
113 #define ODM_MODIFYMODE 1 /* Open document in a modifiable mode. */
114 #define ODM_VIEWMODE 2 /* Open document in non-modifiable mode. */
116 #define ODM_REFCOPY 3
119 // Actions for ODMActivate
120 #define ODM_NONE 0 /* No specific action is requested. */
121 #define ODM_DELETE 1 /* Delete the specified document. */
122 #define ODM_SHOWATTRIBUTES 2 /* Display the specified document's profile
124 #define ODM_EDITATTRIBUTES 3 /* Edit the specified document's profile or
126 #define ODM_VIEWDOC 4 /* Display the specified document in a
128 #define ODM_OPENDOC 5 /* Open the specified document in its
129 native application. */
132 #define ODM_CHECKOUT 7
133 #define ODM_CANCELCHECKOUT 8
134 #define ODM_CHECKIN 9
135 #define ODM_SHOWHISTORY 10
138 // Item selectors for ODMGetDocInfo and ODMSetDocInfo
139 #define ODM_AUTHOR 1 /* Author of the document. */
140 #define ODM_NAME 2 /* Descriptive name of the document. */
141 #define ODM_TYPE 3 /* Type of the document. */
142 #define ODM_TITLETEXT 4 /* Suggested text to display in the
143 document window's title bar. */
144 #define ODM_DMS_DEFINED 5 /* DMS defined data. */
145 #define ODM_CONTENTFORMAT 6 /* String describing document's format */
147 #define ODM_ALTERNATE_RENDERINGS 7
148 #define ODM_CHECKEDOUTBY 8
149 #define ODM_CHECKOUTCOMMENT 9
150 #define ODM_CHECKOUTDATE 10
151 #define ODM_CREATEDBY 11
152 #define ODM_CREATEDDATE 12
153 #define ODM_DOCID_LATEST 13
154 #define ODM_DOCID_RELEASED 14
155 #define ODM_DOCVERSION 15
156 #define ODM_DOCVERSION_LATEST 16
157 #define ODM_DOCVERSION_RELEASED 17
158 #define ODM_LOCATION 18
159 #define ODM_KEYWORDS 19
160 #define ODM_LASTCHECKINBY 20
161 #define ODM_LASTCHECKINDATE 21
162 #define ODM_MODIFYDATE 22
163 #define ODM_MODIFYDATE_LATEST 23
164 #define ODM_MODIFYDATE_RELEASED 24
166 #define ODM_SUBJECT 26
167 #define ODM_TITLETEXT_RO 27
171 // Item selectors for ODMQueryCapability ODMA 2.0
172 #define ODM_QC_ACTIVATE 1
173 #define ODM_QC_CLOSEDOC 2
174 #define ODM_QC_CLOSEDOCEX 3
175 #define ODM_QC_GETALTERNATECONTENT 4
176 #define ODM_QC_GETDMSINFO 5
177 #define ODM_QC_GETDOCINFO 6
178 #define ODM_QC_GETDOCRELATION 7
179 #define ODM_QC_GETLEADMONIKER 8
180 #define ODM_QC_NEWDOC 9
181 #define ODM_QC_OPENDOC 10
182 #define ODM_QC_QUERYCLOSE 11
183 #define ODM_QC_QUERYEXECUTE 12
184 #define ODM_QC_QUERYGETRESULTS 13
185 #define ODM_QC_SAVEAS 14
186 #define ODM_QC_SAVEASEX 15
187 #define ODM_QC_SAVEDOC 16
188 #define ODM_QC_SAVEDOCEX 17
189 #define ODM_QC_SELECTDOC 18
190 #define ODM_QC_SELECTDOCEX 19
191 #define ODM_QC_SETALTERNATECONTENT 20
192 #define ODM_QC_SETDOCEVENT 21
193 #define ODM_QC_SETDOCRELATION 22
194 #define ODM_QC_SETDOCINFO 23
197 // Misc. modes, flags
198 #define ODM_SILENT 16 /* Don't interact with the user while
199 fulfilling this request. */
201 #define ODM_VERSION_SAME 1
202 #define ODM_VERSION_MAJOR 2
203 #define ODM_VERSION_MINOR 4
204 #define ODM_VERSION_CHANGED 8
205 #define ODM_ALT_DELETE 32
207 //ODMA 2.0 DMS Info Flags
208 #define ODM_EXT_QUERY 1
209 #define ODM_EXT_WORKFLOW 2
211 // Flags for Query Interface
212 #define ODM_ALL 1 // All DMS's should be searched
213 #define ODM_SPECIFIC 2 // Only specific DMS's should be searched
216 // Function prototypes
221 ODMSTATUS WINAPI
ODMRegisterApp(ODMHANDLE FAR
*pOdmHandle
, WORD version
,
222 LPSTR lpszAppId
, DWORD dwEnvData
, LPVOID pReserved
);
224 void WINAPI
ODMUnRegisterApp(ODMHANDLE odmHandle
);
226 ODMSTATUS WINAPI
ODMSelectDoc(ODMHANDLE odmHandle
, LPSTR lpszDocId
,
229 ODMSTATUS WINAPI
ODMOpenDoc(ODMHANDLE odmHandle
, DWORD flags
,
230 LPSTR lpszDocId
, LPSTR lpszDocLocation
);
232 ODMSTATUS WINAPI
ODMSaveDoc(ODMHANDLE odmHandle
, LPSTR lpszDocId
,
235 ODMSTATUS WINAPI
ODMCloseDoc(ODMHANDLE odmHandle
, LPSTR lpszDocId
,
236 DWORD activeTime
, DWORD pagesPrinted
, LPVOID sessionData
, WORD dataLen
);
238 ODMSTATUS WINAPI
ODMNewDoc(ODMHANDLE odmHandle
, LPSTR lpszDocId
,
239 DWORD dwFlags
, LPSTR lpszFormat
, LPSTR lpszDocLocation
);
241 ODMSTATUS WINAPI
ODMSaveAs(ODMHANDLE odmHandle
, LPSTR lpszDocId
,
242 LPSTR lpszNewDocId
, LPSTR lpszFormat
, ODMSAVEASCALLBACK pcbCallBack
,
243 LPVOID pInstanceData
);
245 ODMSTATUS WINAPI
ODMActivate(ODMHANDLE odmHandle
, WORD action
,
248 ODMSTATUS WINAPI
ODMGetDocInfo(ODMHANDLE odmHandle
, LPSTR lpszDocId
,
249 WORD item
, LPSTR lpszData
, WORD dataLen
);
251 ODMSTATUS WINAPI
ODMSetDocInfo(ODMHANDLE odmHandle
, LPSTR lpszDocId
,
252 WORD item
, LPSTR lpszData
);
254 ODMSTATUS WINAPI
ODMGetDMSInfo(ODMHANDLE odmHandle
, LPSTR lpszDmsId
,
255 LPWORD pwVerNo
, LPDWORD pdwExtensions
);
257 /* Query Enhancements */
258 WORD WINAPI
ODMGetDMSCount();
260 WORD WINAPI
ODMGetDMSList( LPSTR buffer
, WORD buffer_size
);
262 ODMSTATUS WINAPI
ODMGetDMS( LPCSTR lpszAppId
, LPSTR lpszDMSId
);
264 ODMSTATUS WINAPI
ODMSetDMS( LPCSTR lpszAppId
, LPCSTR lpszDMSId
);
266 ODMSTATUS WINAPI
ODMQueryExecute(ODMHANDLE odmHandle
, LPCSTR lpszQuery
,
267 DWORD flags
, LPCSTR lpszDMSList
, LPSTR queryId
);
269 ODMSTATUS WINAPI
ODMQueryGetResults(ODMHANDLE odmHandle
, LPCSTR queryId
,
270 LPSTR lpszDocId
, LPSTR lpszDocName
, WORD docNameLen
,
273 ODMSTATUS WINAPI
ODMQueryClose(ODMHANDLE odmHandle
, LPCSTR queryId
);
275 /* ODMA 2.0 Enhancements */
276 ODMSTATUS WINAPI
ODMCloseDocEx(ODMHANDLE odmHandle
, LPSTR lpszDocId
,
277 LPDWORD pdwFlags
, DWORD activeTime
, DWORD pagesPrinted
,
278 LPVOID sessionData
, WORD dataLen
);
280 ODMSTATUS WINAPI
ODMSaveAsEx(ODMHANDLE odmHandle
, LPSTR lpszDocId
,
281 LPSTR lpszNewDocId
, LPSTR lpszFormat
, ODMSAVEASCALLBACK pcbCallBack
,
282 LPVOID pInstanceData
, LPDWORD pdwFlags
);
284 ODMSTATUS WINAPI
ODMSaveDocEx(ODMHANDLE odmHandle
, LPSTR lpszDocId
,
285 LPSTR lpszNewDocId
, LPDWORD pdwFlags
);
287 ODMSTATUS WINAPI
ODMSelectDocEx(ODMHANDLE odmHandle
, LPSTR lpszDocIds
,
288 LPWORD pwDocIdsLen
, LPWORD pwDocCount
, LPDWORD pdwFlags
,
289 LPSTR lpszFormatFilter
);
291 ODMSTATUS WINAPI
ODMQueryCapability(ODMHANDLE odmHandle
, LPCSTR lpszDmsId
,
292 DWORD function
, DWORD item
, DWORD flags
);
294 ODMSTATUS WINAPI
ODMSetDocEvent(ODMHANDLE odmHandle
, LPSTR lpszDocId
,
295 DWORD flags
, DWORD event
, LPVOID lpData
, DWORD dwDataLen
,
298 ODMSTATUS WINAPI
ODMGetAlternateContent(ODMHANDLE odmHandle
, LPSTR lpszDocId
,
299 LPDWORD pdwFlags
, LPSTR lpszFormat
, LPSTR lpszDocLocation
);
301 ODMSTATUS WINAPI
ODMSetAlternateContent(ODMHANDLE odmHandle
, LPSTR lpszDocId
,
302 LPDWORD pdwFlags
, LPSTR lpszFormat
, LPSTR lpszDocLocation
);
304 ODMSTATUS WINAPI
ODMGetDocRelation(ODMHANDLE odmHandle
, LPSTR lpszDocId
,
305 LPDWORD pdwFlags
, LPSTR lpszLinkedId
, LPSTR lpszFormat
,
306 LPSTR lpszPreviousId
);
308 ODMSTATUS WINAPI
ODMSetDocRelation(ODMHANDLE odmHandle
, LPSTR lpszDocId
,
309 LPDWORD pdwFlags
, LPSTR lpszLinkedId
, LPSTR lpszFormat
,
310 LPSTR lpszPreviousId
);
318 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */