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.

136 lines
4.7 KiB

  1. #ifndef __DSKQUOTA_USER_PROPSHEET_H
  2. #define __DSKQUOTA_USER_PROPSHEET_H
  3. ///////////////////////////////////////////////////////////////////////////////
  4. /* File: userprop.h
  5. Description: Provides declarations for quota user property page.
  6. Revision History:
  7. Date Description Programmer
  8. -------- --------------------------------------------------- ----------
  9. 08/15/96 Initial creation. BrianAu
  10. 06/25/98 Replaced AddUserPropSheet with AddUserDialog. BrianAu
  11. Now that we're getting user info from the DS
  12. object picker, the prop sheet idea doesn't work
  13. so well. A std dialog is better.
  14. */
  15. ///////////////////////////////////////////////////////////////////////////////
  16. #ifndef _INC_DSKQUOTA_H
  17. # include "dskquota.h"
  18. #endif
  19. #ifndef _INC_DSKQUOTA_USER_H
  20. # include "user.h"
  21. #endif
  22. #ifndef _INC_DSKQUOTA_UNDO_H
  23. # include "undo.h"
  24. #endif
  25. #ifndef _INC_DSKQUOTA_DETAILS_H
  26. # include "details.h" // For LVSelection
  27. #endif
  28. #ifndef __OBJSEL_H_
  29. # include <objsel.h>
  30. #endif
  31. #include "resource.h"
  32. //
  33. // User property page.
  34. //
  35. class UserPropSheet
  36. {
  37. private:
  38. enum { iICON_USER_SINGLE,
  39. iICON_USER_MULTIPLE,
  40. cUSER_ICONS };
  41. enum { iICON_STATUS_OK,
  42. iICON_STATUS_OVER_THRESHOLD,
  43. iICON_STATUS_OVER_LIMIT,
  44. cSTATUS_ICONS };
  45. //
  46. // Prevent copying.
  47. //
  48. UserPropSheet(const UserPropSheet&);
  49. void operator = (const UserPropSheet&);
  50. LONGLONG m_cVolumeMaxBytes;
  51. LONGLONG m_llQuotaUsed;
  52. LONGLONG m_llQuotaLimit;
  53. LONGLONG m_llQuotaThreshold;
  54. int m_idCtlNextFocus;
  55. PDISKQUOTA_CONTROL m_pQuotaControl;
  56. UndoList& m_UndoList;
  57. LVSelection& m_LVSelection;
  58. HWND m_hWndParent;
  59. CVolumeID m_idVolume;
  60. CString m_strPageTitle;
  61. BOOL m_bIsDirty;
  62. BOOL m_bHomogeneousSelection; // All selected, same limit/threshold.
  63. HICON m_hIconUser[cUSER_ICONS]; // 0=Single, 1=Multi-user.
  64. HICON m_hIconStatus[cSTATUS_ICONS]; // 0=OK,1=Warn,2=Error
  65. XBytes *m_pxbQuotaLimit;
  66. XBytes *m_pxbQuotaThreshold;
  67. static INT_PTR OnInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam);
  68. INT_PTR OnCommand(HWND hDlg, WPARAM wParam, LPARAM lParam);
  69. INT_PTR OnNotify(HWND hDlg, WPARAM wParam, LPARAM lParam);
  70. INT_PTR OnHelp(HWND hDlg, WPARAM wParam, LPARAM lParam);
  71. INT_PTR OnContextMenu(HWND hwndItem, int xPos, int yPos);
  72. //
  73. // PSN_xxxx handlers.
  74. //
  75. INT_PTR OnSheetNotifyApply(HWND hDlg, WPARAM wParam, LPARAM lParam);
  76. INT_PTR OnSheetNotifyKillActive(HWND hDlg, WPARAM wParam, LPARAM lParam);
  77. INT_PTR OnSheetNotifySetActive(HWND hDlg, WPARAM wParam, LPARAM lParam);
  78. //
  79. // EN_xxxx handlers.
  80. //
  81. INT_PTR OnEditNotifyUpdate(HWND hDlg, WPARAM wParam, LPARAM lParam);
  82. INT_PTR OnEditNotifyKillFocus(HWND hDlg, WPARAM wParam, LPARAM lParam);
  83. //
  84. // CBN_xxxx handlers.
  85. //
  86. INT_PTR OnComboNotifySelChange(HWND hDlg, WPARAM wParam, LPARAM lParam);
  87. HRESULT UpdateControls(HWND hDlg) const;
  88. HRESULT InitializeControls(HWND hDlg);
  89. HRESULT RefreshCachedUserQuotaInfo(VOID);
  90. HRESULT ApplySettings(HWND hDlg, bool bUndo = true);
  91. HRESULT RefreshCachedQuotaInfo(VOID);
  92. VOID UpdateSpaceUsed(HWND hDlg, LONGLONG iUsed, LONGLONG iLimit, INT cUsers);
  93. VOID UpdateUserName(HWND hDlg, PDISKQUOTA_USER pUser);
  94. VOID UpdateUserName(HWND hDlg, INT cUsers);
  95. VOID UpdateUserStatusIcon(HWND hDlg, LONGLONG iUsed, LONGLONG iThreshold, LONGLONG iLimit);
  96. INT QueryUserIcon(HWND hDlg) const;
  97. INT QueryUserStatusIcon(HWND hDlg) const;
  98. public:
  99. //
  100. // Prop sheet for editing users.
  101. //
  102. UserPropSheet(PDISKQUOTA_CONTROL pQuotaControl,
  103. const CVolumeID& idVolume,
  104. HWND hWndParent,
  105. LVSelection& LVSelection,
  106. UndoList& UndoList);
  107. ~UserPropSheet(VOID);
  108. HRESULT Run(VOID);
  109. //
  110. // Dialog Proc callback.
  111. //
  112. static INT_PTR APIENTRY DlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
  113. };
  114. #endif // __DSKQUOTA_USER_PROPSHEET_H