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.

312 lines
7.8 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. faxcpl.h
  5. Abstract:
  6. Header file for fax configuration DLL
  7. Environment:
  8. Windows NT fax configuration DLL
  9. Revision History:
  10. 02/27/96 -davidx-
  11. Created it.
  12. dd-mm-yy -author-
  13. description
  14. --*/
  15. #ifndef _FAXCPL_H_
  16. #define _FAXCPL_H_
  17. #include <windows.h>
  18. #include <windowsx.h>
  19. #include <commctrl.h>
  20. #include "winfax.h"
  21. #include "winfaxp.h"
  22. #include "faxlib.h"
  23. #include "faxcfg.h"
  24. #include "registry.h"
  25. #include "timectrl.h"
  26. #include "resource.h"
  27. #include "coverpg.h"
  28. #include "util.h"
  29. #include "tapiutil.h"
  30. //
  31. // window mgmt
  32. //
  33. #define HideWindow(_hwnd) SetWindowLong((_hwnd),GWL_STYLE,GetWindowLong((_hwnd),GWL_STYLE)&~WS_VISIBLE)
  34. #define UnHideWindow(_hwnd) SetWindowLong((_hwnd),GWL_STYLE,GetWindowLong((_hwnd),GWL_STYLE)|WS_VISIBLE)
  35. //
  36. // Number of pages in fax client and/or server configuration property sheets
  37. //
  38. #define CLIENT_OPTIONS_PAGE 0
  39. #define CLIENT_COVERPG_PAGE 1
  40. #define USER_INFO_PAGE 2
  41. #define NUM_CLIENT_PAGES 3
  42. #define SERVER_OPTIONS_PAGE 3
  43. #define SERVER_COVERPG_PAGE 4
  44. #define SEND_OPTIONS_PAGE 5
  45. #define RECEIVE_OPTIONS_PAGE 6
  46. #define DEVICE_PRIORITY_PAGE 7
  47. #define DEVICE_STATUS_PAGE 8
  48. #define DIAG_LOG_PAGE 9
  49. #define GENERAL_PAGE 10
  50. #define STATUS_OPTIONS_PAGE 11
  51. #define NUM_SERVER_PAGES 8
  52. #define MAX_PAGES 12
  53. #define NUM_WORKSTATION_PAGES 8 // No "Server Cover Page" and "Priority" tab
  54. //
  55. // Pages which display a printer list:
  56. // fax options
  57. // server options
  58. // send options
  59. //
  60. #define PRINTERPAGE_MASK ((1 << CLIENT_OPTIONS_PAGE) | \
  61. (1 << SERVER_COVERPG_PAGE) | \
  62. (1 << SEND_OPTIONS_PAGE))
  63. //
  64. // Pages related to fax device configuration:
  65. // server options
  66. // send options
  67. // receive options
  68. // device priority
  69. // diagnostics logging
  70. //
  71. #define CONFIGPAGE_MASK ((1 << SERVER_OPTIONS_PAGE) | \
  72. (1 << SEND_OPTIONS_PAGE) | \
  73. (1 << RECEIVE_OPTIONS_PAGE) | \
  74. (1 << DEVICE_PRIORITY_PAGE) | \
  75. (1 << GENERAL_PAGE) | \
  76. (1 << DIAG_LOG_PAGE) | \
  77. (1 << STATUS_OPTIONS_PAGE))
  78. //
  79. // Data structure representing information about a fax printer
  80. //
  81. typedef struct _FAXPRINTERINFO {
  82. LPTSTR pPrinterName;
  83. BOOL isLocal;
  84. } FAXPRINTERINFO, *PFAXPRINTERINFO;
  85. //
  86. // Data structure representing information about a form supported by fax driver
  87. //
  88. typedef struct _FAXFORMINFO {
  89. LPTSTR pFormName;
  90. INT paperSizeIndex;
  91. } FAXFORMINFO, *PFAXFORMINFO;
  92. //
  93. // Auxiliary information about TAPI locations
  94. //
  95. typedef PDWORD PBITARRAY;
  96. #define BITARRAYALLOC(n) MemAllocZ((((n) + 31) / 32) * 4)
  97. #define BITARRAYFREE(p) MemFree(p)
  98. #define BITARRAYSET(p, n) (p)[(n) / 32] |= (1 << ((n) & 31))
  99. #define BITARRAYCLEAR(p, n) (p)[(n) / 32] &= ~(1 << ((n) & 31))
  100. #define BITARRAYCHECK(p, n) ((p)[(n) / 32] & (1 << ((n) & 31)))
  101. typedef struct _AUX_LOCATION_INFO {
  102. PBITARRAY pFlags;
  103. LPTSTR pPrefixes;
  104. } AUX_LOCATION_INFO, *PAUX_LOCATION_INFO;
  105. #define MIN_PREFIX 200
  106. #define MAX_PREFIX 999
  107. #define MAX_PREFIX_LEN 32
  108. #define PREFIX_SEPARATOR TEXT(',')
  109. //
  110. // private port info struct
  111. //
  112. typedef struct _CONFIG_PORT_INFO_2 {
  113. DWORD SizeOfStruct; // size of this structure
  114. DWORD DeviceId; //
  115. DWORD State; //
  116. DWORD Flags; //
  117. DWORD Rings;
  118. DWORD Priority; //
  119. LPWSTR DeviceName; //
  120. LPWSTR TSID; //
  121. DWORD Mask; // ROUTING: how to route an inbound fax
  122. LPWSTR PrinterName; // | printer name, NULL = default printer
  123. LPWSTR DirStore; // | dir to store fax into
  124. LPWSTR ProfileName; // | profile name for inbox storage
  125. LPWSTR CSID; // |----> receiving station's identifier
  126. } CONFIG_PORT_INFO_2, *PCONFIG_PORT_INFO_2;
  127. //
  128. // Fax configuration data structure
  129. //
  130. typedef struct _CONFIGDATA {
  131. PVOID startSign; // signature
  132. INT configType; // type of configuration
  133. HANDLE hFaxSvc; // handle to fax service
  134. INT changeFlag; // whether any dialog contents were changed
  135. INT faxDeviceSyncFlag; // whether fax device list view is in sync
  136. LPTSTR pServerName; // currently selected fax server name
  137. PCPDATA pCPInfo; // cover page information
  138. BOOL priorityChanged; // device priority was changed
  139. //
  140. // Devmode associated with the currently selected printer
  141. //
  142. DRVDEVMODE devmode;
  143. INT cForms;
  144. PFAXFORMINFO pFormInfo;
  145. //
  146. // Information about available fax devices
  147. //
  148. INT cDevices;
  149. PCONFIG_PORT_INFO_2 pDevInfo;
  150. //
  151. // Fax configuration information
  152. //
  153. PFAX_CONFIGURATION pFaxConfig;
  154. PFAX_LOG_CATEGORY pFaxLogging;
  155. DWORD NumberCategories;
  156. PVOID endSign;
  157. LPTSTR pMapiProfiles;
  158. } CONFIGDATA, *PCONFIGDATA;
  159. //
  160. // Validate fax configuration data structure
  161. //
  162. #define ValidConfigData(pData) \
  163. ((pData) && (pData) == (pData)->startSign && (pData) == (pData)->endSign)
  164. //
  165. // Determine whether the current page was modified at all
  166. //
  167. #define GetChangedFlag(pageIndex) (gConfigData->changeFlag & (1 << (pageIndex)))
  168. //
  169. // Determine whether the fax device list on the current page is in sync
  170. //
  171. #define IsFaxDeviceListInSync(pageIndex) (gConfigData->faxDeviceSyncFlag & (1 << (pageIndex)))
  172. //
  173. // Indicate the fax device list on the current page is now in sync
  174. //
  175. #define SetFaxDeviceListInSync(pageIndex) gConfigData->faxDeviceSyncFlag |= (1 << (pageIndex))
  176. //
  177. // Return the name of currently selected printer
  178. //
  179. #define GetPrinterSelName() \
  180. ((gConfigData->printerSel < gConfigData->cPrinters) ? \
  181. gConfigData->pPrinterInfo[gConfigData->printerSel].pPrinterName : NULL)
  182. //
  183. // Determine whether the currently selected printer is installed locally
  184. //
  185. #define IsPrinterSelLocal() \
  186. ((gConfigData->printerSel < gConfigData->cPrinters) && \
  187. gConfigData->pPrinterInfo[gConfigData->printerSel].isLocal)
  188. //
  189. // Allocate memory for fax configuration data structure
  190. //
  191. BOOL
  192. AllocConfigData(
  193. VOID
  194. );
  195. //
  196. // Dispose of fax configuration data structure
  197. //
  198. VOID
  199. FreeConfigData(
  200. VOID
  201. );
  202. //
  203. // Global variable declarations
  204. //
  205. extern HANDLE ghInstance; // DLL instance handle
  206. extern PCONFIGDATA gConfigData; // fax configuration data structure
  207. //
  208. // Dialog procedure for handling fax configuration property sheet tabs
  209. //
  210. BOOL FaxOptionsProc(HWND, UINT, UINT, LONG);
  211. BOOL ClientCoverPageProc(HWND, UINT, UINT, LONG);
  212. BOOL UserInfoProc(HWND, UINT, UINT, LONG);
  213. BOOL ServerOptionsProc(HWND, UINT, UINT, LONG);
  214. BOOL ServerCoverPageProc(HWND, UINT, UINT, LONG);
  215. BOOL SendOptionsProc(HWND, UINT, UINT, LONG);
  216. BOOL ReceiveOptionsProc(HWND, UINT, UINT, LONG);
  217. BOOL DevicePriorityProc(HWND, UINT, UINT, LONG);
  218. BOOL DeviceStatusProc(HWND, UINT, UINT, LONG);
  219. BOOL DiagLogProc(HWND, UINT, UINT, LONG);
  220. BOOL GeneralProc(HWND, UINT, UINT, LONG);
  221. BOOL StatusOptionsProc(HWND, UINT, UINT, LONG);
  222. //
  223. // Maximum allowable length for outgoing archiving and inbound routing directory
  224. //
  225. #define MAX_ARCHIVE_DIR (MAX_PATH - 16)
  226. #endif // !_FAXCPL_H_