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.

385 lines
6.9 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1995 - 1998
  3. All rights reserved.
  4. Module Name:
  5. docprop.hxx
  6. Abstract:
  7. Document properties header.
  8. Author:
  9. Albert Ting (AlbertT) 17-Aug-1995
  10. Revision History:
  11. --*/
  12. #ifndef _DOCPROP_HXX
  13. #define _DOCPROP_HXX
  14. //
  15. // HACK: private export from winspool.drv.
  16. //
  17. extern "C" {
  18. LONG
  19. DocumentPropertySheets(
  20. PPROPSHEETUI_INFO pPSUIInfo,
  21. LPARAM lParam
  22. );
  23. }
  24. /********************************************************************
  25. Class forward references.
  26. ********************************************************************/
  27. class TDocumentData;
  28. /********************************************************************
  29. DocumentProp.
  30. Base class for document property sheets. This class should not
  31. not contain any information/services that is not generic to all
  32. derived classes.
  33. The document property sheets should inherit from this class.
  34. bHandleMessage (which is not overriden here) should be
  35. defined in derived classes.
  36. ********************************************************************/
  37. class TDocumentProp : public MGenericProp {
  38. SIGNATURE( 'prpr' )
  39. ALWAYS_VALID
  40. SAFE_NEW
  41. public:
  42. TDocumentProp::
  43. TDocumentProp(
  44. TDocumentData* pDocumentData
  45. );
  46. virtual
  47. TDocumentProp::
  48. ~TDocumentProp(
  49. VOID
  50. );
  51. BOOL
  52. TDocumentProp::
  53. bHandleMessage(
  54. UINT uMsg,
  55. WPARAM wParam,
  56. LPARAM lParam
  57. );
  58. virtual
  59. BOOL
  60. TDocumentProp::
  61. _bHandleMessage(
  62. UINT uMsg,
  63. WPARAM wParam,
  64. LPARAM lParam
  65. ) = 0;
  66. virtual
  67. BOOL
  68. TDocumentProp::
  69. bSetUI(
  70. VOID
  71. ) = 0;
  72. virtual
  73. BOOL
  74. TDocumentProp::
  75. bReadUI(
  76. VOID
  77. ) = 0;
  78. virtual
  79. BOOL
  80. TDocumentProp::
  81. bSaveUI(
  82. VOID
  83. ) = 0;
  84. protected:
  85. VAR( TDocumentData*, pDocumentData );
  86. private:
  87. //
  88. // Operator = and copy not defined.
  89. //
  90. TDocumentProp &
  91. TDocumentProp::
  92. operator =(
  93. const TDocumentProp &
  94. );
  95. TDocumentProp::
  96. TDocumentProp(
  97. const TDocumentProp &
  98. );
  99. BOOL _bApplyData;
  100. };
  101. /********************************************************************
  102. General document property page.
  103. ********************************************************************/
  104. class TDocumentGeneral : public TDocumentProp {
  105. SIGNATURE( 'gedo' )
  106. SAFE_NEW
  107. public:
  108. TDocumentGeneral(
  109. TDocumentData* pDocumentData
  110. );
  111. ~TDocumentGeneral(
  112. VOID
  113. );
  114. BOOL
  115. bValid(
  116. VOID
  117. );
  118. BOOL
  119. _bHandleMessage(
  120. UINT uMsg,
  121. WPARAM wParam,
  122. LPARAM lParam
  123. );
  124. BOOL
  125. bSetUI(
  126. VOID
  127. );
  128. BOOL
  129. bReadUI(
  130. VOID
  131. );
  132. BOOL
  133. bSaveUI(
  134. VOID
  135. );
  136. VOID
  137. vEnableAvailable(
  138. IN BOOL bEnable
  139. );
  140. BOOL
  141. bSetStartAndUntilTime(
  142. VOID
  143. );
  144. VOID
  145. vSetActive(
  146. VOID
  147. );
  148. private:
  149. //
  150. // Operator = and copy not defined.
  151. //
  152. TDocumentGeneral &
  153. TDocumentGeneral::
  154. operator =(
  155. const TDocumentGeneral &
  156. );
  157. TDocumentGeneral::
  158. TDocumentGeneral(
  159. const TDocumentGeneral &
  160. );
  161. BOOL
  162. TDocumentGeneral::
  163. bCheckForChange(
  164. VOID
  165. );
  166. BOOL _bSetUIDone;
  167. };
  168. /********************************************************************
  169. Document property windows.
  170. ********************************************************************/
  171. class TDocumentWindows : public TPropertySheetManager {
  172. SIGNATURE( 'down' )
  173. SAFE_NEW
  174. public:
  175. TDocumentWindows::
  176. TDocumentWindows(
  177. IN TDocumentData* pDocumentData
  178. );
  179. TDocumentWindows::
  180. ~TDocumentWindows(
  181. );
  182. BOOL
  183. TDocumentWindows::
  184. bValid(
  185. VOID
  186. );
  187. BOOL
  188. TDocumentWindows::
  189. bBuildPages(
  190. IN PPROPSHEETUI_INFO pCPSUIInfo
  191. );
  192. BOOL
  193. TDocumentWindows::
  194. bSetHeader(
  195. IN PPROPSHEETUI_INFO pCPSUIInfo,
  196. IN PPROPSHEETUI_INFO_HEADER pPSUInfoHeader
  197. );
  198. private:
  199. //
  200. // Operator = and copy not defined.
  201. //
  202. TDocumentWindows &
  203. TDocumentWindows::
  204. operator =(
  205. const TDocumentWindows &
  206. );
  207. TDocumentWindows::
  208. TDocumentWindows(
  209. const TDocumentWindows &
  210. );
  211. private:
  212. TDocumentData *_pDocumentData; // Pointer to document property sheet data set
  213. TDocumentGeneral _General; // General document property sheet
  214. DOCUMENTPROPERTYHEADER _dph; // Document prorety header
  215. };
  216. /********************************************************************
  217. Document properties UI (driver UI)
  218. ********************************************************************/
  219. class TDocumentProperties: public TPropertySheetManager
  220. {
  221. SIGNATURE( 'dopr' )
  222. SAFE_NEW
  223. public:
  224. TDocumentProperties::
  225. TDocumentProperties(
  226. IN HWND hwnd,
  227. IN HANDLE hPrinter,
  228. IN LPCTSTR pszPrinter,
  229. IN PDEVMODE pDevModeIn,
  230. OUT PDEVMODE pDevModeOut,
  231. IN DWORD dwHideBits,
  232. IN DWORD dwFlags
  233. );
  234. LONG
  235. TDocumentProperties::
  236. lGetResult(
  237. VOID
  238. ) const;
  239. BOOL
  240. TDocumentProperties::
  241. bBuildPages(
  242. IN PPROPSHEETUI_INFO pCPSUIInfo
  243. );
  244. BOOL
  245. TDocumentProperties::
  246. bSetHeader(
  247. IN PPROPSHEETUI_INFO pCPSUIInfo,
  248. IN PPROPSHEETUI_INFO_HEADER pPSUInfoHeader
  249. );
  250. private:
  251. DOCUMENTPROPERTYHEADER _dph;
  252. HWND _hwnd;
  253. HANDLE _hPrinter;
  254. LPCTSTR _pszPrinter;
  255. PDEVMODE _pDevModeIn;
  256. PDEVMODE _pDevModeOut;
  257. DWORD _dwHideBits;
  258. DWORD _dwFlags;
  259. LONG _lResult;
  260. TString _strTitle;
  261. };
  262. /********************************************************************
  263. Global scoped functions.
  264. ********************************************************************/
  265. VOID
  266. vDocumentPropSelections(
  267. IN HWND hWnd,
  268. IN LPCTSTR pszPrinterName,
  269. IN TSelection *pSelection
  270. );
  271. VOID
  272. vDocumentPropPages(
  273. IN HWND hWnd,
  274. IN LPCTSTR pszDocumentName,
  275. IN IDENT JobId,
  276. IN INT iCmdShow,
  277. IN LPARAM lParam
  278. );
  279. LONG
  280. DocumentPropertiesWrap(
  281. HWND hwnd, // handle to parent window
  282. HANDLE hPrinter, // handle to printer object
  283. LPTSTR pDeviceName, // device name
  284. PDEVMODE pDevModeOutput, // modified device mode
  285. PDEVMODE pDevModeInput, // original device mode
  286. DWORD fMode, // mode options
  287. DWORD fExclusionFlags // exclusion flags
  288. );
  289. INT
  290. iDocumentPropPagesProc(
  291. TDocumentData* pDocumentData
  292. );
  293. #endif