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.

288 lines
4.8 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1995 - 1998
  3. All rights reserved.
  4. Module Name:
  5. forms.hxx
  6. Abstract:
  7. Printer Forms
  8. Author:
  9. Steve Kiraly (SteveKi) 11/20/95
  10. Lazar Ivanov (LazarI) Jun-2000 (major changes)
  11. Revision History:
  12. --*/
  13. #ifndef _FORMS_HXX
  14. #define _FORMS_HXX
  15. #define HANDLE_FIXED_NEW_HANDLE_RETURNED 0
  16. #define HANDLE_NEEDS_FIXING_NO_PRINTERS_FOUND 1
  17. #define HANDLE_FIX_NOT_NEEDED 2
  18. #define HANDLE_FIXED_NEW_HANDLE_RETURNED_ACCESS_CHANGED 3
  19. #define FORMS_NAME_MAX (CCHFORMNAME-1)
  20. #define FORMS_PARAM_MAX 32
  21. #define MAX_INPUT_CONTROLS 6
  22. #define CCH_MAX_UNITS 16
  23. #define SETUNITS( hwnd, fMetric ) \
  24. CheckRadioButton( hwnd, IDD_FM_RB_METRIC, IDD_FM_RB_ENGLISH, \
  25. ( (fMetric) ? IDD_FM_RB_METRIC : IDD_FM_RB_ENGLISH ) )
  26. #define GETUNITS( hwnd ) \
  27. IsDlgButtonChecked( hwnd, IDD_FM_RB_METRIC )
  28. typedef struct _FORMS_DLG_DATA
  29. {
  30. DWORD AccessGranted;
  31. LPTSTR pServerName;
  32. HANDLE hPrinter;
  33. PFORM_INFO_1 pFormInfo;
  34. DWORD cForms;
  35. BOOL Units; // TRUE == metric
  36. BOOL bNeedClose;
  37. LPCTSTR pszComputerName;
  38. UINT uMetricMeasurement;
  39. TCHAR szDecimalPoint[2];
  40. // use this when in prop sheet to know when to
  41. // convert "Cancel" to "Close" and when to hold
  42. // closing the property sheet in case of an error.
  43. BOOL bFormChanged;
  44. DWORD dwLastError;
  45. } FORMS_DLG_DATA, *PFORMS_DLG_DATA;
  46. BOOL
  47. FormsInitDialog(
  48. HWND hwnd,
  49. PFORMS_DLG_DATA pFormsDlgData
  50. );
  51. BOOL
  52. FormsCommandOK(
  53. HWND hwnd
  54. );
  55. BOOL
  56. FormsCommandCancel(
  57. HWND hwnd
  58. );
  59. BOOL
  60. FormsCommandAddForm(
  61. HWND hwnd
  62. );
  63. BOOL
  64. FormsCommandDelForm(
  65. HWND hwnd
  66. );
  67. BOOL
  68. FormsCommandFormsSelChange(
  69. HWND hwnd
  70. );
  71. BOOL
  72. FormsCommandUnits(
  73. HWND hwnd
  74. );
  75. VOID
  76. InitializeFormsData(
  77. HWND hwnd,
  78. PFORMS_DLG_DATA
  79. pFormsDlgData,
  80. BOOL ResetList
  81. );
  82. LPFORM_INFO_1
  83. GetFormsList(
  84. HANDLE hPrinter,
  85. PDWORD pNumberOfForms
  86. );
  87. INT _cdecl
  88. CompareFormNames(
  89. const VOID *p1,
  90. const VOID *p2 );
  91. VOID
  92. SetFormsComputerName(
  93. HWND hwnd,
  94. PFORMS_DLG_DATA pFormsDlgData
  95. );
  96. VOID
  97. SetFormDescription(
  98. HWND hwnd,
  99. LPFORM_INFO_1 pFormInfo,
  100. BOOL Metric
  101. );
  102. BOOL
  103. GetFormDescription(
  104. IN HWND hwnd,
  105. OUT LPFORM_INFO_1 pFormInfo,
  106. IN BOOL bDefaultMetric,
  107. OUT PUINT puIDFailed
  108. );
  109. INT
  110. GetFormIndex(
  111. LPTSTR pFormName,
  112. LPFORM_INFO_1 pFormInfo,
  113. DWORD cForms );
  114. LPTSTR
  115. GetFormName(
  116. HWND hwnd
  117. );
  118. BOOL
  119. SetValue(
  120. HWND hwnd,
  121. DWORD uID,
  122. LONG lValueInPoint001mm,
  123. BOOL bMetric
  124. );
  125. BOOL
  126. GetValue(
  127. HWND hwnd,
  128. DWORD uID,
  129. LONG lCurrentValueInPoint001mm,
  130. BOOL bDefaultMetric,
  131. PLONG plValueInPoint001mm
  132. );
  133. VOID
  134. SetDlgItemTextFromResID(
  135. HWND hwnd,
  136. INT idCtl,
  137. INT idRes
  138. );
  139. VOID
  140. EnableDialogFields(
  141. HWND hwnd,
  142. PFORMS_DLG_DATA pFormsDlgData
  143. );
  144. LPTSTR
  145. AllocStr(
  146. LPCTSTR pszStr
  147. );
  148. VOID
  149. FreeStr(
  150. LPTSTR pszStr
  151. );
  152. LONG FrameCommandForms(
  153. IN HWND hWnd,
  154. IN LPCTSTR pszServerName
  155. );
  156. BOOL APIENTRY
  157. FormsDlg(
  158. HWND hwnd,
  159. UINT msg,
  160. WPARAM wparam,
  161. LPARAM lparam
  162. );
  163. PVOID
  164. FormsInit(
  165. IN LPCTSTR pszServerName,
  166. IN HANDLE hPrintserver,
  167. IN BOOL bAdministrator,
  168. IN LPCTSTR pszComputerName
  169. );
  170. VOID
  171. FormsFini(
  172. IN PVOID p
  173. );
  174. BOOL
  175. bEnumForms(
  176. IN HANDLE hPrinter,
  177. IN DWORD dwLevel,
  178. IN PBYTE *ppBuff,
  179. IN PDWORD pcReturned
  180. );
  181. BOOL
  182. FormsNewForms(
  183. IN HWND hWnd
  184. );
  185. VOID
  186. vFormsEnableEditFields(
  187. IN HWND hWnd,
  188. IN BOOL bState
  189. );
  190. BOOL
  191. FormsCommandNameChange(
  192. IN HWND hWnd,
  193. IN WPARAM wParam,
  194. IN LPARAM lParam
  195. );
  196. UINT
  197. sFormsFixServerHandle(
  198. IN HANDLE hPrintServer,
  199. IN LPCTSTR pszServerName,
  200. IN BOOL bAdministrator,
  201. IN HANDLE *phPrinter
  202. );
  203. BOOL
  204. String2Value(
  205. IN PFORMS_DLG_DATA pFormsDlgData,
  206. IN LPCTSTR pszValue,
  207. IN BOOL bDefaultMetric,
  208. IN LONG lCurrentValueInPoint001mm,
  209. OUT PLONG plValueInPoint001mm
  210. );
  211. BOOL
  212. Value2String(
  213. IN PFORMS_DLG_DATA pFormsDlgData,
  214. IN LONG lValueInPoint001mm,
  215. IN BOOL bMetric,
  216. IN BOOL bAppendMetric,
  217. IN UINT cchMaxChars,
  218. OUT LPTSTR szOutBuffer
  219. );
  220. VOID
  221. FormChanged(
  222. IN OUT PFORMS_DLG_DATA pFormsDlgData
  223. );
  224. BOOL
  225. Forms_IsThereCommitedChanges(
  226. IN PVOID pFormsData
  227. );
  228. DWORD
  229. Forms_GetLastError(
  230. IN PVOID pFormsData
  231. );
  232. #endif