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.

330 lines
8.9 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows NT **/
  3. /** Copyright(c) Microsoft Corp., 1993 **/
  4. /**********************************************************************/
  5. /*
  6. ftpmgr.hxx
  7. Class declarations for the FTP_SVCMGR_DIALOG
  8. FILE HISTORY:
  9. YiHsinS 17-Mar-1992 Created
  10. */
  11. #ifndef _FTPMGR_HXX_
  12. #define _FTPMGR_HXX_
  13. #include <ctime.hxx> // for WIN_TIME
  14. #include <intlprof.hxx> // for INTL_PROF
  15. /*************************************************************************
  16. NAME: FTP_USER_LBI
  17. SYNOPSIS: This LBI contains the information about a user connected
  18. to the FTP service.
  19. INTERFACE: FTP_USER_LBI() - Class constructor.
  20. ~FTP_USER_LBI() - Class destructor.
  21. Paint() - Draw an item.
  22. Compare() - Compare two items.
  23. QueryLeadingChar() - Query the first character for
  24. the keyboard interface.
  25. QueryUserName() - Query the user name for this item.
  26. QueryUserID() - Returns the User ID for this item.
  27. IsAnonymous() - TRUE if the user logs on as anonymous,
  28. FALSE otherwise.
  29. QueryInternetAddressString() - Get the internet address
  30. where this user is connected from
  31. QueryConnectTimeString() - Get the duration of time this
  32. user is connected
  33. PARENT: LBI
  34. USES: NLS_STR
  35. HISTORY:
  36. Yi-HsinS 17-Mar-1992 Created
  37. **************************************************************************/
  38. class FTP_USER_LBI : public LBI
  39. {
  40. protected:
  41. //
  42. // These data members represent the various
  43. // columns to be displayed in the listbox.
  44. //
  45. NLS_STR _nlsUserName;
  46. ULONG _ulUserID;
  47. BOOL _fAnonymous;
  48. NLS_STR _nlsInternetAddress;
  49. NLS_STR _nlsConnectTimeString;
  50. public:
  51. FTP_USER_LBI( const TCHAR *pszUserName,
  52. ULONG ulUserID,
  53. BOOL fAnonymous,
  54. const TCHAR *pszInternetAddress,
  55. const TCHAR *pszConnectTimeString );
  56. virtual ~FTP_USER_LBI() ;
  57. virtual VOID Paint( LISTBOX *plb, HDC hdc, const RECT *prect,
  58. GUILTT_INFO *pGUILTT ) const;
  59. virtual INT Compare( const LBI *plbi ) const;
  60. virtual WCHAR QueryLeadingChar( VOID ) const;
  61. const NLS_STR *QueryUserName( VOID ) const
  62. { return &_nlsUserName; }
  63. ULONG QueryUserID( VOID ) const
  64. { return _ulUserID; }
  65. BOOL IsAnonymousUser( VOID ) const
  66. { return _fAnonymous; }
  67. const NLS_STR *QueryInternetAddressString( VOID ) const
  68. { return &_nlsInternetAddress; }
  69. const NLS_STR *QueryConnectTimeString( VOID ) const
  70. { return &_nlsConnectTimeString; }
  71. };
  72. /*************************************************************************
  73. NAME: FTP_USER_LISTBOX
  74. SYNOPSIS: This listbox displays the users connected to the FTP service
  75. INTERFACE: FTP_USER_LISTBOX() - Class constructor.
  76. ~FTP_USER_LISTBOX() - Class destructor.
  77. QueryColumnWidths() - Called by FTP_USER_LBI::Paint(),
  78. this is the column width table
  79. used for painting the listbox
  80. items.
  81. QueryUserBitmap() - Returns the normal user bitmap
  82. QueryAnonymousBitmap() - Returns the anonymous user bitmap
  83. Refresh() - Refresh the listbox
  84. PARENT: BLT_LISTBOX
  85. USES: NLS_STR, INTL_PROFILE, DMID_DTE
  86. HISTORY:
  87. YiHsinS 17-Mar-1993 Created
  88. **************************************************************************/
  89. class FTP_USER_LISTBOX : public BLT_LISTBOX
  90. {
  91. private:
  92. //
  93. // This array stores the calculated column widths
  94. // for use while painting the listbox item.
  95. //
  96. UINT _adx[4];
  97. //
  98. // Stores the server name
  99. //
  100. NLS_STR _nlsServer;
  101. //
  102. // Stores the "unknown" string
  103. //
  104. RESOURCE_STR _nlsUnknown;
  105. //
  106. // Pointer to the user bitmaps
  107. //
  108. DMID_DTE *_pdmdteUser;
  109. DMID_DTE *_pdmdteAnonymous;
  110. //
  111. // For use in printing out the connection time in the right format
  112. //
  113. INTL_PROFILE _intlProf;
  114. //
  115. // Format the given time to a displayable string.
  116. //
  117. APIERR QueryTimeString( ULONG ulTime, NLS_STR *pnlsTime );
  118. //
  119. // This method actually does the enumeration of users
  120. // and adds them to the listbox.
  121. //
  122. APIERR Fill( VOID );
  123. public:
  124. FTP_USER_LISTBOX( OWNER_WINDOW *powOwner,
  125. CID cid,
  126. const TCHAR *pszServer );
  127. ~FTP_USER_LISTBOX();
  128. DECLARE_LB_QUERY_ITEM( FTP_USER_LBI )
  129. //
  130. // This method is called by the FTP_USER_LBI::Paint()
  131. // method for retrieving the column width table.
  132. //
  133. const UINT *QueryColumnWidths() const
  134. { return _adx; }
  135. //
  136. // The following two methods returns the user bitmaps
  137. //
  138. const DMID_DTE *QueryUserBitmap( VOID ) const
  139. { return _pdmdteUser; }
  140. const DMID_DTE *QueryAnonymousBitmap( VOID ) const
  141. { return _pdmdteAnonymous; }
  142. //
  143. // Method that refresh the contents of the listbox.
  144. //
  145. APIERR Refresh( VOID );
  146. };
  147. /*************************************************************************
  148. NAME: FTP_SVCMGR_DIALOG
  149. SYNOPSIS: This is the FTP User Sessions dialog.
  150. INTERFACE: FTP_SVCMGR_DIALOG() - Class constructor.
  151. ~FTP_SVCMGR_DIALOG() - Class destructor.
  152. PARENT: DIALOG_WINDOW
  153. USES: FTP_USER_LISTBOX, PUSH_BUTTON
  154. HISTORY:
  155. YiHsinS 17-Mar-1992 Created
  156. **************************************************************************/
  157. class FTP_SVCMGR_DIALOG: public DIALOG_WINDOW
  158. {
  159. private:
  160. FTP_USER_LISTBOX _lbUser;
  161. PUSH_BUTTON _pbuttonDisconnect;
  162. PUSH_BUTTON _pbuttonDisconnectAll;
  163. //
  164. // Store the server name we are focusing on
  165. //
  166. NLS_STR _nlsServer;
  167. //
  168. // This method is used to refresh the contents of the user listbox
  169. //
  170. APIERR Refresh( VOID );
  171. protected:
  172. virtual BOOL OnCommand( const CONTROL_EVENT & event );
  173. virtual ULONG QueryHelpContext( VOID );
  174. public:
  175. FTP_SVCMGR_DIALOG( HWND hwndOwner,
  176. const TCHAR *pszServer );
  177. ~FTP_SVCMGR_DIALOG();
  178. };
  179. /*************************************************************************
  180. NAME: FTP_SECURITY_DIALOG
  181. SYNOPSIS: This dialog manages the security on the drives for
  182. the FTP service.
  183. INTERFACE: FTP_SECURITY_DIALOG() - Class constructor.
  184. ~FTP_SECURITY_DIALOG() - Class destructor.
  185. PARENT: DIALOG_WINDOW
  186. USES: COMBOBOX, SLT, CHECKBOX, NLS_STR
  187. HISTORY:
  188. YiHsinS 17-Mar-1992 Created
  189. **************************************************************************/
  190. class FTP_SECURITY_DIALOG: public DIALOG_WINDOW
  191. {
  192. private:
  193. COMBOBOX _cbPartition;
  194. SLT _sltFileSysInfo;
  195. CHECKBOX _checkbReadAccess;
  196. CHECKBOX _checkbWriteAccess;
  197. //
  198. // Keep the server name we are focusing on
  199. //
  200. NLS_STR _nlsServer;
  201. //
  202. // Flag indicating whether we are focusing on the local computer or not.
  203. // TRUE if we are, FALSE otherwise.
  204. //
  205. BOOL _fLocal;
  206. //
  207. // Place to store the security read mask and write mask
  208. //
  209. ULONG _ulReadAccess;
  210. ULONG _ulWriteAccess;
  211. //
  212. // Store the index for the current selected partition
  213. // 0 for A:, 1 for B:, ..., and 25 for Z:
  214. //
  215. INT _nCurrentDiskIndex;
  216. //
  217. // Method to get all available drives on the given server
  218. // and then add them to the combo.
  219. //
  220. APIERR AddDrives( VOID );
  221. //
  222. // Get the file system information about the given device.
  223. // e.g. FAT, NTFS
  224. //
  225. APIERR GetFileSystemInfo( const TCHAR *pszDevice,
  226. NLS_STR *pnlsFileSysInfo );
  227. //
  228. // Show the file system info, read/write access of the
  229. // currently selected partition in the combo
  230. //
  231. APIERR ShowCurrentPartitionInfo( VOID );
  232. //
  233. // Save the read/write access for the previous selected partition
  234. //
  235. VOID SaveDriveSecurity( VOID );
  236. protected:
  237. virtual BOOL OnOK( VOID );
  238. virtual BOOL OnCommand( const CONTROL_EVENT &event );
  239. virtual ULONG QueryHelpContext( VOID );
  240. public:
  241. FTP_SECURITY_DIALOG( HWND hwndOwner,
  242. const TCHAR *pszServer );
  243. ~FTP_SECURITY_DIALOG();
  244. };
  245. #endif // _FTPMGR_HXX_