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.

194 lines
6.5 KiB

  1. #ifndef _INC_DSKQUOTA_VOLPROP_H
  2. #define _INC_DSKQUOTA_VOLPROP_H
  3. ///////////////////////////////////////////////////////////////////////////////
  4. /* File: volprop.h
  5. Description: Provides declarations for quota property pages.
  6. Revision History:
  7. Date Description Programmer
  8. -------- --------------------------------------------------- ----------
  9. 08/15/96 Initial creation. BrianAu
  10. */
  11. ///////////////////////////////////////////////////////////////////////////////
  12. #ifndef _INC_DSKQUOTA_PRSHTEXT_H
  13. # include "prshtext.h"
  14. #endif
  15. #ifndef _INC_DSKQUOTA_DETAILS_H
  16. # include "details.h"
  17. #endif
  18. #include "resource.h"
  19. const DWORD IDT_STATUS_UPDATE = 1;
  20. const DWORD STATUS_UPDATE_TIMER_PERIOD = 2000; // Update every 2 sec.
  21. #define TLM_SETSTATE (WM_USER + 100) // TLM = Traffic Light Message.
  22. //
  23. // Volume property page.
  24. //
  25. class VolumePropPage : public DiskQuotaPropSheetExt
  26. {
  27. protected:
  28. class TrafficLight
  29. {
  30. private:
  31. HWND m_hwndAnimateCtl;
  32. INT m_idAviClipRes;
  33. //
  34. // Prevent copy.
  35. //
  36. TrafficLight(const TrafficLight& rhs);
  37. TrafficLight& operator = (const TrafficLight& rhs);
  38. public:
  39. TrafficLight(VOID)
  40. : m_hwndAnimateCtl(NULL),
  41. m_idAviClipRes(-1)
  42. { }
  43. TrafficLight(HWND hwndAnimateCtl, INT idAviClipRes)
  44. : m_hwndAnimateCtl(hwndAnimateCtl),
  45. m_idAviClipRes(idAviClipRes)
  46. {
  47. Initialize(hwndAnimateCtl, idAviClipRes);
  48. }
  49. VOID Initialize(HWND hwndAnimateCtl, INT idAviClipRes);
  50. ~TrafficLight(VOID)
  51. { Animate_Close(m_hwndAnimateCtl); }
  52. enum { YELLOW, OFF, RED, GREEN, FLASHING_YELLOW };
  53. VOID Show(INT eShow);
  54. INT_PTR ForwardMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
  55. };
  56. DWORD m_dwQuotaState;
  57. DWORD m_dwQuotaLogFlags;
  58. LONGLONG m_llDefaultQuotaThreshold;
  59. LONGLONG m_llDefaultQuotaLimit;
  60. UINT64 m_cVolumeMaxBytes;
  61. UINT_PTR m_idStatusUpdateTimer;
  62. DWORD m_dwLastStatusMsgID;
  63. int m_idCtlNextFocus;
  64. DetailsView *m_pDetailsView;
  65. XBytes *m_pxbDefaultLimit;
  66. XBytes *m_pxbDefaultThreshold;
  67. TrafficLight m_TrafficLight;
  68. virtual INT_PTR OnInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam);
  69. INT_PTR OnCommand(HWND hDlg, WPARAM wParam, LPARAM lParam);
  70. INT_PTR OnNotify(HWND hDlg, WPARAM wParam, LPARAM lParam);
  71. INT_PTR OnContextMenu(HWND hwndItem, int xPos, int yPos);
  72. INT_PTR OnHelp(HWND hDlg, WPARAM wParam, LPARAM lParam);
  73. INT_PTR OnTimer(HWND hDlg, WPARAM wParam, LPARAM lParam);
  74. INT_PTR OnButtonDetails(HWND hDlg, WPARAM wParam, LPARAM lParam);
  75. //
  76. // PSN_xxxx handlers.
  77. //
  78. virtual INT_PTR OnSheetNotifyApply(HWND hDlg, WPARAM wParam, LPARAM lParam);
  79. virtual INT_PTR OnSheetNotifyKillActive(HWND hDlg, WPARAM wParam, LPARAM lParam);
  80. virtual INT_PTR OnSheetNotifyReset(HWND hDlg, WPARAM wParam, LPARAM lParam);
  81. virtual INT_PTR OnSheetNotifySetActive(HWND hDlg, WPARAM wParam, LPARAM lParam);
  82. //
  83. // EN_xxxx handlers.
  84. //
  85. INT_PTR OnEditNotifyUpdate(HWND hDlg, WPARAM wParam, LPARAM lParam);
  86. INT_PTR OnEditNotifyKillFocus(HWND hDlg, WPARAM wParam, LPARAM lParam);
  87. INT_PTR OnEditNotifySetFocus(HWND hDlg, WPARAM wParam, LPARAM lParam);
  88. //
  89. // CBN_xxxx handlers.
  90. //
  91. INT_PTR OnComboNotifySelChange(HWND hDlg, WPARAM wParam, LPARAM lParam);
  92. HRESULT UpdateControls(HWND hDlg) const;
  93. HRESULT InitializeControls(HWND hDlg);
  94. HRESULT EnableControls(HWND hDlg);
  95. HRESULT RefreshCachedVolumeQuotaInfo(VOID);
  96. HRESULT ApplySettings(HWND hDlg);
  97. HRESULT QuotaStateFromControls(HWND hDlg, LPDWORD pdwState) const;
  98. HRESULT LogFlagsFromControls(HWND hDlg, LPDWORD pdwLogFlags) const;
  99. BOOL ActivateExistingDetailsView(VOID) const;
  100. bool SetByPolicy(LPCTSTR pszPolicyValue);
  101. HRESULT UpdateStatusIndicators(HWND hDlg);
  102. VOID SetStatusUpdateTimer(HWND hDlg)
  103. {
  104. if (0 == m_idStatusUpdateTimer)
  105. m_idStatusUpdateTimer = SetTimer(hDlg,
  106. IDT_STATUS_UPDATE,
  107. STATUS_UPDATE_TIMER_PERIOD,
  108. NULL);
  109. }
  110. VOID KillStatusUpdateTimer(HWND hDlg)
  111. {
  112. if (0 != m_idStatusUpdateTimer)
  113. {
  114. KillTimer(hDlg, m_idStatusUpdateTimer);
  115. m_idStatusUpdateTimer = 0;
  116. }
  117. }
  118. //
  119. // Prevent copy.
  120. //
  121. VolumePropPage(const VolumePropPage& rhs);
  122. VolumePropPage& operator = (const VolumePropPage& rhs);
  123. public:
  124. VolumePropPage(VOID);
  125. ~VolumePropPage(VOID);
  126. //
  127. // Dialog Proc callback.
  128. //
  129. static INT_PTR APIENTRY DlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
  130. };
  131. #ifdef PER_DIRECTORY_QUOTAS
  132. //
  133. // Folder property page.
  134. //
  135. class FolderPropPage : public DiskQuotaPropSheetExt
  136. {
  137. //
  138. // This class has not been implemented.
  139. // At some future date, we may implement per-directory quota management.
  140. // If such support is required, look at class VolumePropPage.
  141. // You should be able to provide a similar implementation only with
  142. // directory-specific features. All features common to volumes and
  143. // directories are in class DiskQuotaPropSheetExt.
  144. //
  145. public:
  146. //
  147. // Dialog Proc callback.
  148. //
  149. static INT_PTR APIENTRY DlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
  150. { return FALSE; }
  151. };
  152. #endif // PER_DIRECTORY_QUOTAS
  153. #endif // __DSKQUOTA_PROPSHEET_EXT_H