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.

277 lines
7.0 KiB

  1. /*++
  2. Copyright (c) 1990-1995 Microsoft Corporation
  3. Module Name:
  4. apilayer.h
  5. Abstract:
  6. This module contains all API layer's definiton
  7. Author:
  8. 02-Jan-1996 Tue 13:28:08 created -by- Daniel Chou (danielc)
  9. [Environment:]
  10. NT Windows - Common Printer Driver UI DLL
  11. [Notes:]
  12. Revision History:
  13. --*/
  14. #ifndef CPSUI_APILAYER
  15. #define CPSUI_APILAYER
  16. //================= Internal Data structures =============================
  17. //
  18. #define TABTABLE_COUNT (MAXPROPPAGES + 3)
  19. #define TAB_MODE_INIT 0
  20. #define TAB_MODE_FIND 1
  21. #define TAB_MODE_INSERT 2
  22. #define TAB_MODE_DELETE 3
  23. #define TAB_MODE_DELETE_ALL 4
  24. #define GET_REAL_INSIDX(ptbl) ((ptbl)->TabInfo[(ptbl)->InsIdx].OrgInsIdx)
  25. #define DP_STD_INT_TVPAGE DP_STD_RESERVED_START
  26. #define COUNT_POSTSETCURSEL 32
  27. typedef struct _TABINFO {
  28. SHORT OrgInsIdx;
  29. WORD HandleIdx;
  30. HWND hDlg;
  31. } TABINFO, *PTABINFO;
  32. #define TTF_POST_SETCURSEL 0x0001
  33. typedef struct _TABTABLE {
  34. struct _TABTABLE *pTabTable;
  35. HWND hPSDlg;
  36. HWND hWndTab;
  37. WNDPROC WndProc;
  38. WORD cPostSetCurSel;
  39. SHORT iPostSetCurSel;
  40. WORD cTab;
  41. WORD CurSel;
  42. WORD InsIdx;
  43. WORD HandleIdx;
  44. TABINFO TabInfo[TABTABLE_COUNT];
  45. } TABTABLE, *PTABTABLE;
  46. #define CPSUIPAGE_ID 0x43444955
  47. #define CPF_ROOT 0x00000001
  48. #define CPF_PARENT 0x00000002
  49. #define CPF_PFNPROPSHEETUI 0x00000004
  50. #define CPF_COMPROPSHEETUI 0x00000008
  51. #define CPF_USER_GROUP 0x00000010
  52. #define CPF_DLL 0x00000020
  53. #define CPF_CALLER_HPSPAGE 0x00000040
  54. #define CPF_ANSI_CALL 0x00000080
  55. #define CPF_DONE_PROPSHEET 0x00000100
  56. #define CPF_DONE_PROPSHEETPROC 0x00000200
  57. #define CPF_SHOW_PROPSHEET 0x00000400
  58. #define CPF_DOCPROP 0x00000800
  59. #define CPF_ADVDOCPROP 0x00001000
  60. #define CPF_PRINTERPROP 0x00002000
  61. #define CPF_CALL_TV_DIRECT 0x00004000
  62. #define CPF_NO_PSN_APPLY 0x00008000
  63. #define CPF_HAS_CPSUI 0x00010000
  64. #define CPF_NO_APPLY_BUTTON 0x00020000
  65. #define CPF_ACTIVATED 0x00040000
  66. #define CPF_DLGPROC_CHANGED 0x00080000
  67. #define CPF_PSZ_PSTARTPAGE 0x00100000
  68. typedef struct _CPSUIPAGE;
  69. typedef struct _MYDATABLOCK {
  70. struct _MYDATABLOCK *pNext;
  71. DWORD ID;
  72. DWORD cb;
  73. } MYDATABLOCK, *PMYDATABLOCK;
  74. #define SIZE_DB(c) (sizeof(MYDATABLOCK) + (c))
  75. typedef struct _ROOTINFO {
  76. HWND hDlg;
  77. LPDWORD pResult;
  78. PTABTABLE pTabTable;
  79. struct _CPSUIPAGE *pStartPage;
  80. WORD cPage;
  81. WORD cCPSUIPage;
  82. DWORD DMPubHideBits;
  83. PMYDATABLOCK pMyDB;
  84. } ROOTINFO, *PROOTINFO;
  85. typedef struct _PFNINFO {
  86. HINSTANCE hInst;
  87. PFNPROPSHEETUI pfnPSUI;
  88. LPARAM lParamInit;
  89. ULONG_PTR UserData;
  90. ULONG_PTR Result;
  91. } PFNINFO, *PPFNINFO;
  92. typedef struct _CPSUIINFO {
  93. PTVWND pTVWnd;
  94. LONG Result;
  95. LONG TVPageIdx;
  96. LONG StdPageIdx1;
  97. LONG StdPageIdx2;
  98. } CPSUIINFO, PCPSUIINFO;
  99. typedef struct _HPAGEINFO {
  100. HWND hDlg;
  101. DLGPROC DlgProc;
  102. LPFNPSPCALLBACK pspCB;
  103. LPARAM lParam;
  104. HICON hIcon;
  105. DWORD dwSize;
  106. } HPAGEINFO, *PHPAGEINFO;
  107. typedef struct _CPSUIPAGE {
  108. DWORD ID;
  109. DWORD cLock;
  110. DWORD Flags;
  111. HANDLE hCPSUIPage;
  112. HANDLE hActCtx;
  113. struct _CPSUIPAGE *pParent;
  114. struct _CPSUIPAGE *pPrev;
  115. struct _CPSUIPAGE *pNext;
  116. union {
  117. struct _CPSUIPAGE *pChild;
  118. HPROPSHEETPAGE hPage;
  119. } DUMMYUNIONNAME;
  120. union {
  121. ROOTINFO RootInfo;
  122. PFNINFO pfnInfo;
  123. CPSUIINFO CPSUIInfo;
  124. HPAGEINFO hPageInfo;
  125. } DUMMYUNIONNAME2;
  126. } CPSUIPAGE, *PCPSUIPAGE;
  127. typedef BOOL (CALLBACK *CPSUIPAGEENUMPROC)(PCPSUIPAGE pRootPage,
  128. PCPSUIPAGE pCPSUIPage,
  129. LPARAM lParam);
  130. #define SET_APPLY_BUTTON(pTVWnd, hDlg) \
  131. { \
  132. if (!(*((pTVWnd)->pRootFlags) & CPF_NO_APPLY_BUTTON)) { \
  133. \
  134. if (CountRevertOptItem((pTVWnd), \
  135. NULL, \
  136. TreeView_GetRoot((pTVWnd)->hWndTV), \
  137. 0)) { \
  138. \
  139. PropSheet_Changed(GetParent(hDlg), hDlg); \
  140. \
  141. } else { \
  142. \
  143. PropSheet_UnChanged(GetParent(hDlg), hDlg); \
  144. } \
  145. } \
  146. }
  147. #define HINSPSUIPAGE_2_IDX(h) ((UINT)LOWORD(LODWORD(h)))
  148. #define ARRAYSIZE(x) (sizeof(x)/sizeof(x[0]))
  149. //
  150. // Local structure
  151. //
  152. typedef struct _PSPEX {
  153. PROPSHEETPAGE psp;
  154. PSPINFO pspInfo;
  155. } PSPEX, *PPSPEX;
  156. typedef struct _PSHINFO {
  157. WCHAR CaptionName[MAX_RES_STR_CHARS];
  158. } PSHINFO, *PPSHINFO;
  159. typedef struct _PAGEPROCINFO {
  160. PTABTABLE pTabTable;
  161. HPROPSHEETPAGE *phPage;
  162. HANDLE *pHandle;
  163. WORD cPage;
  164. WORD iPage;
  165. } PAGEPROCINFO, *PPAGEPROCINFO;
  166. typedef struct _INSPAGEIDXINFO {
  167. PCPSUIPAGE pCPSUIPage;
  168. PTABTABLE pTabTable;
  169. } INSPAGEIDXINFO, *PINSPAGEIDXINFO;
  170. //
  171. // Function prototypes
  172. //
  173. DWORD
  174. FilterException(
  175. HANDLE hPage,
  176. LPEXCEPTION_POINTERS pExceptionPtr
  177. );
  178. BOOL
  179. CALLBACK
  180. SetInsPageIdxProc(
  181. PCPSUIPAGE pRootPage,
  182. PCPSUIPAGE pCPSUIPage,
  183. LPARAM lParam
  184. );
  185. LONG_PTR
  186. CALLBACK
  187. CPSUICallBack(
  188. HANDLE hComPropSheet,
  189. UINT Function,
  190. LPARAM lParam1,
  191. LPARAM lParam2
  192. );
  193. LONG
  194. AddComPropSheetPage(
  195. PCPSUIPAGE pCPSUIPage,
  196. UINT PageIdx
  197. );
  198. BOOL
  199. EnumCPSUIPagesSeq(
  200. PCPSUIPAGE pRootPage,
  201. PCPSUIPAGE pCPSUIPage,
  202. CPSUIPAGEENUMPROC CPSUIPageEnumProc,
  203. LPARAM lParam
  204. );
  205. BOOL
  206. GetPageActivationContext(
  207. PCPSUIPAGE pCPSUIPage,
  208. HANDLE *phActCtx
  209. );
  210. #endif // CPSUI_APILAYER