Leaked source code of windows server 2003
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.

334 lines
7.9 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corp., 1991 **/
  4. /**********************************************************************/
  5. /*
  6. dialogs.hxx
  7. Class declarations for the CONFIGURE_PORT_DIALOG and
  8. ADD_PORT_DIALOG.
  9. FILE HISTORY:
  10. NarenG 24-May-1993 Created for C version.
  11. */
  12. #ifndef _DIALOGS_HXX
  13. #define _DIALOGS_HXX
  14. enum SFM_OUTLINE_LB_LEVEL
  15. {
  16. //
  17. // Note, these numbers also indicate the indent level. Hence,
  18. // the order nor the starting point must not be tampered with.
  19. //
  20. SFM_OLLBL_ZONE,
  21. SFM_OLLBL_PRINTER
  22. };
  23. #define COL_WIDTH_OUTLINE_INDENT (12)
  24. /*************************************************************************
  25. NAME: CONFIGURE_PORT_DIALOG
  26. SYNOPSIS: The class represents the configure port dialog
  27. of the Print Manager.
  28. INTERFACE: CONFIGURE_PORT_DIALOG - Class constructor.
  29. ~CONFIGURE_PORT_DIALOG - Class destructor.
  30. QueryHelpContext - Called when the user presses "F1"
  31. or the "Help" button. Used for
  32. selecting the appropriate help
  33. text for display.
  34. OnOk - Called when user hits OK button.
  35. PARENT: DIALOG_WINDOW
  36. USES: CHECKBOX
  37. HISTORY:
  38. NarenG 24-May-1993 Created
  39. **************************************************************************/
  40. class CONFIGURE_PORT_DIALOG : public DIALOG_WINDOW
  41. {
  42. private:
  43. //
  44. // Checkbox that indicated whether or not to capture this printer
  45. //
  46. CHECKBOX _chkCapture;
  47. BOOL * _pfCapture;
  48. protected:
  49. //
  50. // Called during help processing to select the appropriate
  51. // help text for display.
  52. //
  53. virtual ULONG QueryHelpContext( VOID );
  54. //
  55. // Called when user hits OK button
  56. //
  57. virtual BOOL OnOK( VOID );
  58. public:
  59. //
  60. // Usual constructor\destructor goodies.
  61. //
  62. CONFIGURE_PORT_DIALOG( HWND hWndOwner, BOOL * pfCapture );
  63. }; // class CONFIGURE_PORT_DIALOG
  64. //
  65. // Forward references
  66. //
  67. class OUTLINE_LISTBOX;
  68. /*************************************************************************
  69. NAME: OLLB_ENTRY
  70. SYNOPSIS: Entry in an outline listbox.
  71. PARENT: LBI
  72. USES: NLS_STR
  73. NOTES:
  74. OLLB_ENTRY:OUTLINE_LISTBOX :: LBI:BLT_LISTBOX
  75. HISTORY:
  76. NarenG 1-June-1993 Stole from file manager
  77. **************************************************************************/
  78. class OLLB_ENTRY : public LBI
  79. {
  80. friend class OUTLINE_LISTBOX;
  81. private:
  82. SFM_OUTLINE_LB_LEVEL _ollbl;
  83. BOOL _fExpanded;
  84. NLS_STR _nlsZone;
  85. NLS_STR _nlsPrinter;
  86. WSH_ATALK_ADDRESS _wshAtalkAddress;
  87. //
  88. // called only by OUTLINE_LISTBOXBOX
  89. //
  90. VOID SetExpanded( BOOL f = TRUE )
  91. { _fExpanded = f; }
  92. public:
  93. OLLB_ENTRY( SFM_OUTLINE_LB_LEVEL ollbl,
  94. BOOL fExpanded,
  95. const TCHAR * pszZone,
  96. const TCHAR * pszPrinter,
  97. const PWSH_ATALK_ADDRESS pwshAtalkAddress );
  98. virtual ~OLLB_ENTRY();
  99. INT QueryLevel() const
  100. { return (INT) _ollbl; }
  101. //
  102. // Query the type of this LBI, currently returns an SFM_OUTLINE_LB_LEVEL
  103. //
  104. SFM_OUTLINE_LB_LEVEL QueryType() const
  105. { return _ollbl; }
  106. BOOL IsExpanded() const
  107. { return _fExpanded; }
  108. const TCHAR * QueryZone( VOID ) const
  109. { return _nlsZone.QueryPch(); }
  110. const TCHAR * QueryPrinter( VOID ) const
  111. { return _nlsPrinter.QueryPch(); }
  112. const PWSH_ATALK_ADDRESS QueryAddress( VOID )
  113. { return &_wshAtalkAddress; }
  114. virtual VOID Paint( LISTBOX * plb, HDC hdc, const RECT * prect,
  115. GUILTT_INFO * pGUILTT ) const;
  116. virtual INT Compare( const LBI * plbi ) const;
  117. virtual WCHAR QueryLeadingChar() const;
  118. };
  119. /*************************************************************************
  120. NAME: OUTLINE_LISTBOX
  121. SYNOPSIS: Listbox with outline-manipulation support
  122. PARENT: BLT_LISTBOX
  123. USES: DMID_DTE, DM_DTE
  124. HISTORY:
  125. NarenG 1-June-1993 Stole from file manager
  126. **************************************************************************/
  127. class OUTLINE_LISTBOX : public BLT_LISTBOX
  128. {
  129. private:
  130. SOCKET _hSocket;
  131. DMID_DTE * _pdmiddteZone;
  132. DMID_DTE * _pdmiddteZoneExpanded;
  133. DMID_DTE * _pdmiddtePrinter;
  134. INT _nS;
  135. INT AddZone( const TCHAR * pszZone,
  136. BOOL fExpanded = FALSE );
  137. INT AddPrinter( const TCHAR * pszZone,
  138. const TCHAR * pszPrinter,
  139. const PWSH_ATALK_ADDRESS pwshAtalkAddress );
  140. INT FindItem( const TCHAR * pszZone,
  141. const TCHAR * pszPrinter = NULL ) const;
  142. protected:
  143. INT AddItem( SFM_OUTLINE_LB_LEVEL ollbl,
  144. BOOL fExpanded,
  145. const TCHAR * pszZone,
  146. const TCHAR * pszPrinter,
  147. const PWSH_ATALK_ADDRESS pwshAtalkAddress );
  148. INT CD_Char( WCHAR wch, USHORT nLastPos );
  149. public:
  150. OUTLINE_LISTBOX( OWNER_WINDOW * powin, CID cid, SOCKET hSocket );
  151. ~OUTLINE_LISTBOX();
  152. DECLARE_LB_QUERY_ITEM( OLLB_ENTRY );
  153. APIERR FillZones( VOID );
  154. APIERR FillPrinters( const TCHAR * pszZone,
  155. UINT * pcServersAdded );
  156. VOID SetZoneExpanded( INT i, BOOL f = TRUE );
  157. BOOL IsS()
  158. { return ( _nS < 0 ); }
  159. APIERR ExpandZone( INT iZone );
  160. APIERR ExpandZone()
  161. { return ExpandZone(QueryCurrentItem()); }
  162. APIERR CollapseZone( INT iZone );
  163. APIERR CollapseZone()
  164. { return CollapseZone(QueryCurrentItem()); }
  165. //
  166. // The following method provides the listbox items with access to the
  167. // different display maps.
  168. //
  169. DM_DTE * QueryDmDte( SFM_OUTLINE_LB_LEVEL ollbl, BOOL fExpanded ) const;
  170. };
  171. /*************************************************************************
  172. NAME: ADD_PORT_DIALOG
  173. SYNOPSIS: The class represents the add port dialog
  174. of the Print Manager.
  175. INTERFACE: ADD_PORT_DIALOG - Class constructor.
  176. ~ADD_PORT_DIALOG - Class destructor.
  177. QueryHelpContext - Called when the user presses "F1"
  178. or the "Help" button. Used for
  179. selecting the appropriate help
  180. text for display.
  181. OnOk - Called when user hits OK button.
  182. PARENT: DIALOG_WINDOW
  183. USES: CHECKBOX
  184. HISTORY:
  185. NarenG 24-May-1993 Created
  186. **************************************************************************/
  187. class ADD_PORT_DIALOG : public DIALOG_WINDOW
  188. {
  189. private:
  190. PUSH_BUTTON _pbOK;
  191. PATALKPORT _pNewPort;
  192. OUTLINE_LISTBOX _ollb;
  193. protected:
  194. //
  195. // Called during help processing to select the appropriate
  196. // help text for display.
  197. //
  198. virtual ULONG QueryHelpContext( VOID );
  199. //
  200. // Called when user hits OK button
  201. //
  202. virtual BOOL OnOK( VOID );
  203. //
  204. // Called whenever a WM_COMMAND message is send to the dialog procedure.
  205. //
  206. virtual BOOL OnCommand( const CONTROL_EVENT & event );
  207. public:
  208. //
  209. // Usual constructor\destructor goodies.
  210. //
  211. ADD_PORT_DIALOG( HWND hWndOwner, PATALKPORT pAtalkPort );
  212. ~ADD_PORT_DIALOG( VOID );
  213. }; // class ADD_PORT_DIALOG
  214. #endif // _DIALOGS_HXX