Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

274 lines
5.2 KiB

  1. /*
  2. Microsoft Corp. (C) Copyright 1994
  3. Developed under contract by Numbers & Co.
  4. ----------------------------------------------------------------------------
  5. name: Elliot Viewer - Chicago Viewer Utility
  6. Cloned from the IFAX Message Viewing Utility
  7. file: oleutils.h
  8. comments: Functions to support OLE2 interactions
  9. NOTE: This header must be used with the LARGE memory model
  10. ----------------------------------------------------------------------------
  11. Microsoft Corp. (C) Copyright 1994
  12. Developed under contract by Numbers & Co.
  13. */
  14. #ifndef OLEUTILS_H
  15. #define OLEUTILS_H
  16. #include <ole2.h>
  17. /*
  18. Version constants
  19. */
  20. #define AWD_SIGNATURE 0
  21. #define AWD_SIGNATURE_STR "0"
  22. /*
  23. This has the "current" version. As new ones come along shift this
  24. down to a new AWD_VERxx... set and add a check to
  25. CViewer::get_awd_version. Add a new version check and any code
  26. needed to handle whatever is different with the new version to
  27. appropriate places in oleutils.cpp, etc...
  28. */
  29. #define AWD_VERSION 1
  30. #define AWD_VERSION_STR "1"
  31. // this is same as AWD_VERSION, used by the transport
  32. #define AWD_VER1A 1
  33. #define AWD_VER1A_STR "1.0 (pages = docs)"
  34. /*
  35. Recognized extensions
  36. */
  37. #define BMP_EXT _T("bmp")
  38. #define DIB_EXT _T("dib")
  39. #define DCX_EXT _T("dcx")
  40. #define RBA_EXT _T("rba")
  41. #define RMF_EXT _T("rmf")
  42. #define AWD_EXT _T("awd")
  43. /*
  44. AWD flags
  45. */
  46. #define AWD_FIT_WIDTH 0x00000001
  47. #define AWD_FIT_HEIGHT 0x00000002
  48. #define AWD_INVERT 0x00000010
  49. #define AWD_WASINVERTED 0x40000000
  50. #define AWD_IGNORE 0x80000000
  51. /*
  52. AWD file structures
  53. */
  54. #pragma pack( 1 ) // THESE STRUCTS MUST BE BYTE ALIGNED
  55. typedef struct
  56. {
  57. WORD Signature;
  58. WORD Version;
  59. DATE dtLastChange;
  60. DWORD awdFlags;
  61. WORD Rotation;
  62. WORD ScaleX;
  63. WORD ScaleY;
  64. }
  65. PAGE_INFORMATION;
  66. typedef struct
  67. {
  68. WORD Signature;
  69. WORD Version;
  70. PAGE_INFORMATION PageInformation;
  71. }
  72. DOCUMENT_INFORMATION;
  73. typedef struct
  74. {
  75. WORD Signature;
  76. WORD Version;
  77. DATE dtLastChange;
  78. DWORD awdFlags;
  79. WORD Author_bufferlen; // includes the UNICODE '\0' terminator
  80. WCHAR Author[1]; // UNICODE !!!
  81. }
  82. OVERLAY_INFORMATION;
  83. // defs for summary stream- must be 32bit aligned
  84. #pragma pack( 4 )
  85. #define SUMMARY_FMTID( fmtid ) \
  86. CLSID fmtid = \
  87. {0xF29F85E0, 0x4FF9, 0x1068, {0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9}}
  88. #define PID_TITLE 0x00000002
  89. #define PID_SUBJECT 0x00000003
  90. #define PID_AUTHOR 0x00000004
  91. #define PID_KEYWORDS 0x00000005
  92. #define PID_COMMENTS 0x00000006
  93. #define PID_TEMPLATE 0x00000007
  94. #define PID_LASTAUTHOR 0x00000008
  95. #define PID_REVNUMBER 0x00000009
  96. #define PID_EDITTIME 0x0000000a
  97. #define PID_LASTPRINTED 0x0000000b
  98. #define PID_CREATE_DTM 0x0000000c
  99. #define PID_LASTSAVE_DTM 0x0000000d
  100. #define PID_PAGECOUNT 0x0000000e
  101. #define PID_WORDCOUNT 0x0000000f
  102. #define PID_CHARCOUNT 0x00000010
  103. #define PID_THUMBNAIL 0x00000011
  104. #define PID_APPNAME 0x00000012
  105. // BKD 1997-7-9: done to disable warning message. This is probably bad that the oleutils
  106. // uses a macro that's now been reserved and probably should be changed.
  107. // FIXBKD
  108. #ifdef PID_SECURITY
  109. #undef PID_SECURITY
  110. #endif // PID_SECURITY
  111. #define PID_SECURITY 0x00000013
  112. typedef struct
  113. {
  114. DWORD dwType;
  115. DATE date;
  116. }
  117. date_prop_t;
  118. typedef struct
  119. {
  120. DWORD dwType;
  121. DWORD wval;
  122. }
  123. wval_prop_t;
  124. typedef struct
  125. {
  126. DWORD dwType;
  127. DWORD numbytes;
  128. char string[80];
  129. }
  130. string_prop_t;
  131. typedef struct
  132. {
  133. DWORD PropertyID;
  134. DWORD dwOffset;
  135. }
  136. PROPERTYIDOFFSET;
  137. typedef struct
  138. {
  139. DWORD cbSection;
  140. DWORD cProperties;
  141. PROPERTYIDOFFSET revnum_pair;
  142. PROPERTYIDOFFSET lastprt_pair;
  143. PROPERTYIDOFFSET create_dtm_pair;
  144. PROPERTYIDOFFSET lastsaved_dtm_pair;
  145. PROPERTYIDOFFSET numpages_pair;
  146. PROPERTYIDOFFSET appname_pair;
  147. PROPERTYIDOFFSET security_pair;
  148. PROPERTYIDOFFSET author_pair;
  149. string_prop_t revnum;
  150. date_prop_t lastprt;
  151. date_prop_t create_dtm;
  152. date_prop_t lastsaved_dtm;
  153. wval_prop_t numpages;
  154. string_prop_t appname;
  155. wval_prop_t security;
  156. string_prop_t author;
  157. }
  158. summaryPROPERTYSECTION;
  159. typedef struct
  160. {
  161. GUID FormatID;
  162. DWORD dwOffset;
  163. }
  164. FORMATIDOFFSET;
  165. // quick and dirty summary stream. Not all properties are used
  166. typedef struct
  167. {
  168. WORD wByteOrder;
  169. WORD wFormat;
  170. DWORD dwOSVer;
  171. CLSID clsID;
  172. DWORD cSections;
  173. FORMATIDOFFSET section1_pair;
  174. summaryPROPERTYSECTION section1;
  175. }
  176. summaryPROPERTYSET;
  177. #define NUM_USED_PROPS 8
  178. /*
  179. The def for summary_info_t was moved to viewerob.h so that
  180. every module doesn't have to pull in oleutils.h because of the
  181. summary_info_t variable that is in CViewer.
  182. */
  183. //typedef struct
  184. // {
  185. // :
  186. // :
  187. // }
  188. // summary_info_t;
  189. // structs for reading summary stream
  190. typedef struct
  191. {
  192. WORD wByteOrder;
  193. WORD wFormat;
  194. DWORD dwOSVer;
  195. CLSID clsID;
  196. DWORD cSections;
  197. }
  198. summary_header_t;
  199. typedef struct
  200. {
  201. DWORD cbSection;
  202. DWORD cProperties;
  203. }
  204. summary_section_t;
  205. #pragma pack() // go back to default packing
  206. // BKD: I snipped the prototypes, since they're not used
  207. // in the awd converter.
  208. #endif