home *** CD-ROM | disk | FTP | other *** search
/ Network Support Encyclopedia 96-1 / novell-nsepro-1996-1-cd2.iso / download / gw / oddev.exe / ODMA.H < prev    next >
C/C++ Source or Header  |  1994-07-21  |  7KB  |  140 lines

  1. /* odma.h - Definitions, prototypes, etc. for Open Document Managment API
  2.    (ODMA) version 1.0. */
  3.  
  4. #ifndef ODMA_H
  5.  
  6. /* Avoid multiple inclusion of this file. */
  7. #define ODMA_H
  8.  
  9.  
  10. /* Type definitions */
  11. typedef LPVOID ODMHANDLE;
  12. typedef LPSTR (*ODMSAVEASCALLBACK)(DWORD dwEnvData, LPSTR lpszFormat, LPVOID pInstanceData);
  13. typedef int ODMSTATUS;
  14.  
  15.  
  16. /* Constants */
  17. #define ODM_API_VERSION      100   /* Version of the API */
  18. #define ODM_DOCID_MAX        80    /* Maximum length of a document ID including
  19.                                       the terminating NULL character. */
  20. #define ODM_DMSID_MAX        9     /* Maximum length of a DMS ID including the
  21.                                       terminating NULL character. */
  22.                                                                          
  23. /* Maximum length of a filename returned by ODMA including the terminating
  24.    NULL character.  Platform dependent. */
  25. #ifdef __WIN32__
  26. #define ODM_FILENAME_MAX    255         /* Win32 */
  27. #elif defined( _WINDOWS ) || defined( _MSDOS )
  28. #define ODM_FILENAME_MAX    128         /* Windows 3.x */
  29. #elif defined( unix ) || defined( _UNIX )
  30. #define ODM_FILENAME_MAX    1024        /* Unix */
  31. #else
  32. #define ODM_FILENAME_MAX    255         /* Other platforms */
  33. #endif
  34.  
  35.  
  36. /* Common format type names */
  37. #define ODM_FORMAT_TEXT       "Text"
  38. #define ODM_FORMAT_RTF        "Rich text format"
  39. #define ODM_FORMAT_DCA        "DCA RFT"            /* IBM DCA Rich Format Text */
  40. #define ODM_FORMAT_TIFF       "Tiff"
  41. #define ODM_FORMAT_GIF        "Gif"                /* Compuserve Graphics Interchange Format */
  42. #define ODM_FORMAT_BMP        "Windows bitmap"
  43. #define ODM_FORMAT_PCX        "PCX"
  44. #define ODM_FORMAT_CGM          "CGM"                /* Computer Graphics Metafile */
  45. #define ODM_FORMAT_EXE          "Executable file"
  46. #define ODM_FORMAT_PCL          "PCL"                /* HP Printer Control Language */
  47. #define ODM_FORMAT_PS          "PostScript"
  48.  
  49.  
  50. /* Error returns */
  51. #define ODM_E_FAIL         1        /* Unspecified failure */
  52. #define ODM_E_CANCEL       2        /* Action was cancelled at user's request */
  53. #define ODM_E_NODMS        3        /* DMS not registered */
  54. #define ODM_E_CANTINIT     4        /* DMS failed to initalize */
  55. #define ODM_E_VERSION      5        /* DMS doesn't support the requested 
  56.                                        version of ODMA */
  57. #define ODM_E_APPSELECT    6        /* User has indicated that he wants to use 
  58.                                        the application's file selection 
  59.                                        capabilities rather than those of the 
  60.                                        DMS. */
  61. #define ODM_E_USERINT      7        /* Requested action cannot be performed 
  62.                                        without user interaction, but silent 
  63.                                        mode was specified. */
  64. #define ODM_E_HANDLE       8        /* The DMHANDLE argument was invalid. */
  65. #define ODM_E_ACCESS       9        /* User does not have requested access 
  66.                                        rights to specified document. */
  67. #define ODM_E_INUSE       10        /* Document is currently in use and cannot 
  68.                                        be accessed in specified mode. */
  69. #define ODM_E_DOCID       11        /* Invalid document ID */
  70. #define ODM_E_OPENMODE    12        /* The specified action is incompatible 
  71.                                        with the mode in which the document was
  72.                                        opened. */
  73. #define ODM_E_NOOPEN      13        /* The specified document is not open. */
  74. #define ODM_E_ITEM        14        /* Invalid item specifier. */
  75. #define ODM_E_OTHERAPP    15        /* Selected document was for another app. */
  76.  
  77. /* ODMOpenDoc modes */
  78. #define ODM_MODIFYMODE     1        /* Open document in a modifiable mode. */
  79. #define ODM_VIEWMODE       2        /* Open document in non-modifiable mode. */
  80.  
  81. /* Actions for ODMActivate */
  82. #define ODM_NONE           0        /* No specific action is requested.  */
  83. #define ODM_DELETE         1        /* Delete the specified document.  */
  84. #define ODM_SHOWATTRIBUTES 2        /* Display the specified document's profile 
  85.                                        or attributes. */
  86. #define ODM_EDITATTRIBUTES 3        /* Edit the specified document's profile or
  87.                                        attributes. */
  88. #define ODM_VIEWDOC        4        /* Display the specified document in a 
  89.                                        viewer window. */
  90. #define ODM_OPENDOC        5        /* Open the specified document in its 
  91.                                        native application.  */
  92.  
  93. /* Item selectors for ODMGetDocInfo and ODMSetDocInfo */
  94. #define ODM_AUTHOR         1        /* Author of the document. */
  95. #define ODM_NAME           2        /* Descriptive name of the document.  */
  96. #define ODM_TYPE           3        /* Type of the document.  */
  97. #define ODM_TITLETEXT      4        /* Suggested text to display in the 
  98.                                        document window's title bar. */
  99. #define ODM_DMS_DEFINED    5        /* DMS defined data. */
  100. #define ODM_CONTENTFORMAT  6        /* String describing document's format */
  101.  
  102. /* Misc. modes, flags */
  103. #define ODM_SILENT        16        /* Don't interact with the user while
  104.                                        fulfilling this request. */
  105.  
  106. /* Function prototypes */
  107. #ifdef __cplusplus
  108. extern "C" {
  109. #endif
  110.  
  111. ODMSTATUS FAR PASCAL ODMRegisterApp( ODMHANDLE FAR *pOdmHandle, WORD version,
  112.     LPSTR lpszAppId, DWORD dwEnvData, LPVOID pReserved );
  113. void FAR PASCAL ODMUnRegisterApp( ODMHANDLE odmHandle );
  114. ODMSTATUS FAR PASCAL ODMSelectDoc( ODMHANDLE odmHandle, LPSTR lpszDocId,
  115.     LPDWORD pdwFlags );
  116. ODMSTATUS FAR PASCAL ODMOpenDoc( ODMHANDLE odmHandle, DWORD flags,
  117.     LPSTR lpszDocId, LPSTR lpszDocLocation );
  118. ODMSTATUS FAR PASCAL ODMSaveDoc( ODMHANDLE odmHandle, LPSTR lpszDocId,
  119.     LPSTR lpszNewDocId );
  120. ODMSTATUS FAR PASCAL ODMCloseDoc( ODMHANDLE odmHandle, LPSTR lpszDocId,
  121.     DWORD activeTime, DWORD pagesPrinted, LPVOID sessionData, WORD dataLen );
  122. ODMSTATUS FAR PASCAL ODMNewDoc( ODMHANDLE odmHandle, LPSTR lpszDocId,
  123.     DWORD dwFlags, LPSTR lpszFormat, LPSTR lpszDocLocation );
  124. ODMSTATUS FAR PASCAL ODMSaveAs( ODMHANDLE odmHandle, LPSTR lpszDocId,
  125.     LPSTR lpszNewDocId, LPSTR lpszFormat, ODMSAVEASCALLBACK pcbCallBack,
  126.     LPVOID pInstanceData );
  127. ODMSTATUS FAR PASCAL ODMActivate( ODMHANDLE odmHandle, WORD action,
  128.     LPSTR lpszDocId );
  129. ODMSTATUS FAR PASCAL ODMGetDocInfo( ODMHANDLE odmHandle, LPSTR lpszDocId,
  130.     WORD item, LPSTR lpszData, WORD dataLen );
  131. ODMSTATUS FAR PASCAL ODMSetDocInfo( ODMHANDLE odmHandle, LPSTR lpszDocId,
  132.     WORD item, LPSTR lpszData );
  133. ODMSTATUS FAR PASCAL ODMGetDMSInfo( ODMHANDLE odmHandle, LPSTR lpszDmsId,
  134.     LPWORD pwVerNo, LPDWORD pdwExtensions );
  135. #ifdef __cplusplus
  136. }
  137. #endif
  138.  
  139. #endif
  140.