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.

220 lines
4.9 KiB

  1. /*****************************************************************/
  2. /** Microsoft Windows NT **/
  3. /** Copyright(c) Microsoft Corp., 1991 **/
  4. /*****************************************************************/
  5. /*
  6. curusers.hxx
  7. Contains class definitions for the curent users dialog.
  8. CURRENT_USERS_WARNING_DIALOG
  9. CURRENT_USERS_LISTBOX
  10. CURRENT_USERS_LBI
  11. History:
  12. NarenG 11/13/92 Modified for AFPMGR
  13. */
  14. #ifndef _CURUSERS_HXX_
  15. #define _CURUSERS_HXX_
  16. //
  17. // Number of columns in VOLUME listbox
  18. //
  19. #define COLS_CU_LB_USERS 3
  20. /*************************************************************************
  21. NAME: CURRENT_USERS_LBI
  22. SYNOPSIS: Listbox items in the CURRENT_USERS_LISTBOX in
  23. CURRENT_USERS_WARNING_DIALOG
  24. INTERFACE: CURRENT_USERS_LBI() - Constructor
  25. ~CURRENT_USERS_LBI() - Destructor
  26. PARENT: LBI
  27. USES: NLS_STR
  28. CAVEATS:
  29. NOTES:
  30. HISTORY:
  31. NarenG 11/13/92 Modified for AFPMGR
  32. **************************************************************************/
  33. class CURRENT_USERS_LBI: public LBI
  34. {
  35. //
  36. // Name of the user
  37. //
  38. NLS_STR _nlsUserName;
  39. //
  40. // Number of open files the user has
  41. //
  42. DWORD _dwNumOpens;
  43. //
  44. // Elapsed time since the user connect to the share
  45. //
  46. ULONG _ulTime;
  47. //
  48. // Id of this connection.
  49. //
  50. DWORD _dwId;
  51. protected:
  52. virtual VOID Paint( LISTBOX *plb,
  53. HDC hdc,
  54. const RECT *prect,
  55. GUILTT_INFO *pGUILTT ) const;
  56. virtual INT Compare( const LBI *plbi ) const;
  57. //
  58. // Convert the time in seconds to the output string
  59. //
  60. APIERR ConvertTime( ULONG ulTime, NLS_STR *pnlsTime ) const;
  61. public:
  62. DWORD QueryId( VOID ) const
  63. { return _dwId; }
  64. CURRENT_USERS_LBI( const TCHAR * pszUserName,
  65. DWORD dwNumOpens,
  66. DWORD dwTime,
  67. DWORD dwId );
  68. };
  69. /*************************************************************************
  70. NAME: CURRENT_USERS_LISTBOX
  71. SYNOPSIS: The listbox that displays the user/file opens/elapsed of
  72. the users that have connection to the share to be deleted.
  73. Used by the CURRENT_USERS_WARNING_DIALOG
  74. INTERFACE: CRRENT_USERS_LISTBOX() - Constructor
  75. QueryItem() - Query the USERS_LBI
  76. QueryColumnWidths() - Return the array of column widths
  77. PARENT: BLT_LISTBOX
  78. USES:
  79. CAVEATS:
  80. NOTES:
  81. HISTORY:
  82. NarenG 11/13/92 Modified for AFPMGR
  83. **************************************************************************/
  84. class CURRENT_USERS_LISTBOX: public BLT_LISTBOX
  85. {
  86. private:
  87. //
  88. // Array of column widths
  89. //
  90. UINT _adx[COLS_CU_LB_USERS];
  91. public:
  92. CURRENT_USERS_LISTBOX( OWNER_WINDOW *powin, CID cid );
  93. DECLARE_LB_QUERY_ITEM( CURRENT_USERS_LBI );
  94. const UINT *QueryColumnWidths( VOID ) { return _adx; }
  95. APIERR Fill( PAFP_CONNECTION_INFO pAfpConnections,
  96. DWORD nConnections );
  97. };
  98. /*************************************************************************
  99. NAME: CURRENT_USERS_WARNING_DIALOG
  100. SYNOPSIS: This dialog pops up if there are users using the volume
  101. that is to be deleted. The listbox have three columns,
  102. listing the usernmame, the number of file opens, and the
  103. elapsed time since connection.
  104. INTERFACE: CURRENT_USERS_WARNING_DIALOG() - Constructor
  105. PARENT: DIALOG_WINDOW
  106. USES: CURRENT_USERS_LISTBOX, SLT
  107. CAVEATS:
  108. NOTES: OnOK and OnCancel is not redefined here. The default in the
  109. DIALOG_WINDOW class serves the purpose - Dismiss( FALSE )
  110. OnCancel and Dismiss(TRUE) OnOK.
  111. The list box in this dialog is a read-only listbox.
  112. HISTORY:
  113. NarenG 11/13/92 Modified for AFPMGR
  114. **************************************************************************/
  115. class CURRENT_USERS_WARNING_DIALOG: public DIALOG_WINDOW
  116. {
  117. private:
  118. //
  119. // Display the volume name to be deleted
  120. //
  121. SLT _sltVolumeText;
  122. //
  123. // Listbox for displaying the users connected to the volume
  124. //
  125. CURRENT_USERS_LISTBOX _lbUsers;
  126. //
  127. // Handle to the remote server.
  128. //
  129. AFP_SERVER_HANDLE _hServer;
  130. protected:
  131. virtual ULONG QueryHelpContext( VOID );
  132. virtual BOOL OnCommand( const CONTROL_EVENT & event );
  133. public:
  134. CURRENT_USERS_WARNING_DIALOG( HWND hwndParent,
  135. AFP_SERVER_HANDLE hServer,
  136. PAFP_CONNECTION_INFO pAfpConnections,
  137. DWORD nConnections,
  138. const TCHAR *pszVolumeName );
  139. ~CURRENT_USERS_WARNING_DIALOG();
  140. };
  141. #endif