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.

292 lines
6.6 KiB

  1. /*****************************************************************/
  2. /** Microsoft Windows NT **/
  3. /** Copyright(c) Microsoft Corp., 1991 **/
  4. /*****************************************************************/
  5. /*
  6. vvolbase.hxx
  7. Contains the following classes used by the delete volume dialog
  8. and the volume management dialog.
  9. VIEW_VOLUMES_LBI
  10. VIEW_VOLUMES_LISTBOX
  11. VIEW_VOLUMES_DIALOG_BASE
  12. History:
  13. NarenG 11/11/92 Stole and modified sharestp.hxx
  14. */
  15. #ifndef _VVOLBASE_HXX
  16. #define _VVOLBASE_HXX
  17. //
  18. // Number of columns in VOLUME listbox
  19. //
  20. #define COLS_VV_LB_VOLUMES 3
  21. /*************************************************************************
  22. NAME: VIEW_VOLUMES_LBI
  23. SYNOPSIS: Items in the VIEW_VOLUMES_LISTBOX in VIEW_VOLUMES_DIALOG_BASE
  24. to display the volume name and path of the volume
  25. on the selected computer.
  26. INTERFACE: VIEW_VOLUMES_LBI() - Constructor
  27. ~VIEW_VOLUMES_LBI() - Destructor
  28. QueryVolumeName() - Query the volume name contained in the LBI
  29. QueryVolumePath() - Query the volume path contained in the LBI
  30. QueryVolumeId() - Query the volume Id.
  31. PARENT: LBI
  32. USES: NLS_STR
  33. CAVEATS:
  34. NOTES:
  35. HISTORY:
  36. NarenG 11/11/92 Modified for afpmgr.
  37. **************************************************************************/
  38. class VIEW_VOLUMES_LBI: public LBI
  39. {
  40. private:
  41. //
  42. // Id of the volume
  43. //
  44. DWORD _dwVolumeId;
  45. //
  46. // Name of the volume
  47. //
  48. NLS_STR _nlsVolumeName;
  49. //
  50. // Path that the volume represents
  51. //
  52. NLS_STR _nlsVolumePath;
  53. //
  54. // Indicated if this is a good or bad volume
  55. //
  56. BOOL _fGoodVolume;
  57. protected:
  58. virtual VOID Paint( LISTBOX *plb,
  59. HDC hdc,
  60. const RECT *prect,
  61. GUILTT_INFO *pGUILTT ) const;
  62. virtual INT Compare( const LBI *plbi ) const;
  63. public:
  64. VIEW_VOLUMES_LBI::VIEW_VOLUMES_LBI( DWORD dwVolumeId,
  65. const TCHAR * pszVolumeName,
  66. const TCHAR * pszVolumePath,
  67. BOOL fGoodVolume );
  68. ~VIEW_VOLUMES_LBI();
  69. virtual WCHAR QueryLeadingChar( VOID ) const;
  70. const TCHAR * QueryVolumeName( VOID ) const
  71. { return _nlsVolumeName.QueryPch(); }
  72. const TCHAR * QueryVolumePath( VOID ) const
  73. { return _nlsVolumePath.QueryPch(); }
  74. DWORD QueryVolumeId( VOID ) const { return _dwVolumeId; }
  75. BOOL IsVolumeValid( VOID ) const { return _fGoodVolume; }
  76. };
  77. /*************************************************************************
  78. NAME: VIEW_VOLUMES_LISTBOX
  79. SYNOPSIS: Listbox used in VIEW_VOLUMES_DIALOG_BASE to display the
  80. volume name and the path of the volume on the
  81. selected computer.
  82. INTERFACE: VIEW_VOLUMES_LISTBOX() - Constructor
  83. ~VIEW_VOLUME_LISTBOX() - Destructor
  84. QueryItem() - Query the VIEW_VOLUMES_LBI
  85. QueryColumnWidths() - Query the array of column widths
  86. QueryVolumeBitmap() - Query the volume bitmap
  87. Refresh() - Refresh the listbox
  88. PARENT: BLT_LISTBOX
  89. USES: DMID_DTE
  90. CAVEATS:
  91. NOTES:
  92. HISTORY:
  93. NarenG 11/11/92 Modified for afpmgr.
  94. **************************************************************************/
  95. class VIEW_VOLUMES_LISTBOX: public BLT_LISTBOX
  96. {
  97. private:
  98. //
  99. // Array storing the calculated column widths
  100. //
  101. UINT _adx[COLS_VV_LB_VOLUMES];
  102. //
  103. // Volume listbox bitmaps.
  104. //
  105. DMID_DTE _dmdteGoodVolume;
  106. DMID_DTE _dmdteBadVolume;
  107. AFP_SERVER_HANDLE _hServer;
  108. BOOL _fDisplayBadVolumes;
  109. public:
  110. VIEW_VOLUMES_LISTBOX::VIEW_VOLUMES_LISTBOX(
  111. OWNER_WINDOW *powin,
  112. BOOL fDisplayBadVolumes,
  113. CID cid,
  114. AFP_SERVER_HANDLE hServer );
  115. ~VIEW_VOLUMES_LISTBOX();
  116. DECLARE_LB_QUERY_ITEM( VIEW_VOLUMES_LBI );
  117. const UINT *QueryColumnWidths( VOID ) const { return _adx; }
  118. DMID_DTE *QueryGoodVolumeBitmap( VOID ) { return &_dmdteGoodVolume; }
  119. DMID_DTE *QueryBadVolumeBitmap( VOID ) { return &_dmdteBadVolume; }
  120. DWORD Refresh( VOID );
  121. };
  122. /*************************************************************************
  123. NAME: VIEW_VOLUMES_DIALOG_BASE
  124. SYNOPSIS: This is the base dialog for CLOSE_VOLUME_DIALOG in the
  125. file manager and VOLUME_MANAGEMENT_DIALOG in the
  126. server manager.
  127. INTERFACE:
  128. PARENT: DIALOG_WINDOW
  129. USES: SLT, VIEW_VOLUMES_LISTBOX
  130. CAVEATS:
  131. NOTES: This class contains all common routines called used
  132. by the volume management dialog and close volume dialog.
  133. HISTORY:
  134. NarenG 11/11/92 Modified for afpmgr.
  135. **************************************************************************/
  136. class VIEW_VOLUMES_DIALOG_BASE : public DIALOG_WINDOW
  137. {
  138. private:
  139. //
  140. // The title of the volumes listbox
  141. //
  142. SLT _sltVolumeTitle;
  143. //
  144. // Listbox for displaying the shares on the selected computer
  145. //
  146. VIEW_VOLUMES_LISTBOX _lbVolumes;
  147. //
  148. // Represents the target server.
  149. //
  150. AFP_SERVER_HANDLE _hServer;
  151. const TCHAR * _pszServerName;
  152. //
  153. // CID of the volumes listbox
  154. //
  155. DWORD _cidVolumesLb;
  156. protected:
  157. VIEW_VOLUMES_DIALOG_BASE::VIEW_VOLUMES_DIALOG_BASE(
  158. const IDRESOURCE &idrsrcDialog,
  159. const PWND2HWND &hwndOwner,
  160. AFP_SERVER_HANDLE hServer,
  161. const TCHAR *pszServerName,
  162. BOOL fDisplayBadVolumes,
  163. DWORD cidVolumeTitle,
  164. DWORD cidVolumesLb );
  165. ~VIEW_VOLUMES_DIALOG_BASE();
  166. virtual BOOL OnCommand( const CONTROL_EVENT & event );
  167. //
  168. // Virtual methods that are called when the user double clicks
  169. // on a volume in the listbox
  170. //
  171. virtual BOOL OnVolumeLbDblClk( VOID ) = 0;
  172. //
  173. // Refresh the listbox
  174. //
  175. DWORD Refresh( VOID );
  176. //
  177. // Return a pointer to the listbox
  178. //
  179. VIEW_VOLUMES_LISTBOX *QueryLBVolumes( VOID ) { return &_lbVolumes; }
  180. //
  181. // Query the computer name
  182. //
  183. const TCHAR *QueryComputerName( VOID ) const { return _pszServerName; }
  184. DWORD VolumeDelete( VIEW_VOLUMES_LBI * pvlbi, BOOL* pfCancel );
  185. APIERR SelectVolumeItem( const TCHAR * pszPath );
  186. BOOL IsFocusOnGoodVolume( VOID ) const;
  187. };
  188. #endif