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.

223 lines
4.3 KiB

  1. /*++
  2. Copyright (c) 1994-1998 Microsoft Corporation
  3. Module Name :
  4. errors.h
  5. Abstract:
  6. HTTP errors property page definitions
  7. Author:
  8. Ronald Meijer (ronaldm)
  9. Project:
  10. Internet Services Manager
  11. Revision History:
  12. --*/
  13. //
  14. // Forward definitions
  15. //
  16. class CCustomError;
  17. class CCustomErrorsListBox : public CHeaderListBox
  18. /*++
  19. Class Description:
  20. A listbox of CCustomError objects
  21. Public Interface:
  22. CCustomErrorsListBox : Constructor
  23. GetItem : Get error object at index
  24. AddItem : Add item to listbox
  25. InsertItem : Insert item into the listbox
  26. Initialize : Initialize the listbox
  27. --*/
  28. {
  29. DECLARE_DYNAMIC(CCustomErrorsListBox);
  30. public:
  31. static const nBitmaps; // Number of bitmaps
  32. public:
  33. CCustomErrorsListBox(UINT nIDDefault, UINT nIDFile, UINT nIDURL);
  34. public:
  35. CCustomError * GetItem(UINT nIndex);
  36. int AddItem(CCustomError * pItem);
  37. int InsertItem(int nPos, CCustomError * pItem);
  38. virtual BOOL Initialize();
  39. protected:
  40. virtual void DrawItemEx(CRMCListBoxDrawStruct & s);
  41. private:
  42. CString m_str[3];
  43. };
  44. class CHTTPErrorDescriptions : public CMetaProperties
  45. /*++
  46. Class Description:
  47. List of HTTP error descriptions
  48. Public Interface:
  49. CHTTPErrorDescriptions : Constructor
  50. --*/
  51. {
  52. //
  53. // Constructor
  54. //
  55. public:
  56. CHTTPErrorDescriptions(LPCTSTR lpServerName);
  57. //
  58. // Access
  59. //
  60. public:
  61. CStringList & GetErrorDescriptions() { return m_strlErrorDescriptions; }
  62. protected:
  63. virtual void ParseFields();
  64. //
  65. // Data
  66. //
  67. private:
  68. MP_CStringListEx m_strlErrorDescriptions;
  69. };
  70. class CW3ErrorsPage : public CInetPropertyPage
  71. /*++
  72. Class Description:
  73. WWW Errors property page
  74. Public Interface:
  75. CW3ErrorsPage : Constructor
  76. CW3ErrorsPage : Destructor
  77. --*/
  78. {
  79. DECLARE_DYNCREATE(CW3ErrorsPage)
  80. //
  81. // Construction
  82. //
  83. public:
  84. CW3ErrorsPage(CInetPropertySheet * pSheet = NULL);
  85. ~CW3ErrorsPage();
  86. //
  87. // Dialog Data
  88. //
  89. protected:
  90. //{{AFX_DATA(CW3ErrorsPage)
  91. enum { IDD = IDD_DIRECTORY_ERRORS };
  92. CButton m_button_SetDefault;
  93. CButton m_button_Edit;
  94. //}}AFX_DATA
  95. CCustomErrorsListBox m_list_Errors;
  96. CStringListEx m_strlCustomErrors;
  97. CStringListEx m_strlErrorDescriptions;
  98. //
  99. // Overrides
  100. //
  101. protected:
  102. virtual HRESULT FetchLoadedValues();
  103. virtual HRESULT SaveInfo();
  104. // ClassWizard generate virtual function overrides
  105. //{{AFX_VIRTUAL(CW3ErrorsPage)
  106. protected:
  107. virtual void DoDataExchange(CDataExchange * pDX);
  108. //}}AFX_VIRTUAL
  109. //
  110. // Implementation
  111. //
  112. protected:
  113. // Generated message map functions
  114. //{{AFX_MSG(CW3ErrorsPage)
  115. virtual BOOL OnInitDialog();
  116. afx_msg void OnDblclkListErrors();
  117. afx_msg void OnSelchangeListErrors();
  118. afx_msg void OnButtonEdit();
  119. afx_msg void OnButtonSetToDefault();
  120. //}}AFX_MSG
  121. DECLARE_MESSAGE_MAP()
  122. void SetControlStates();
  123. void FillListBox();
  124. INT_PTR ShowPropertyDialog();
  125. CCustomError * GetSelectedListItem(int * pnSel = NULL);
  126. CCustomError * GetNextSelectedItem(int * pnStartingIndex);
  127. CCustomError * FindError(UINT nError, UINT nSubError);
  128. HRESULT FetchErrors();
  129. HRESULT StoreErrors();
  130. DWORD SortCustomErrorsList();
  131. private:
  132. CRMCListBoxResources m_ListBoxRes;
  133. CObListPlus m_oblErrors;
  134. };
  135. //
  136. // Inline Expansion
  137. //
  138. // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  139. inline CCustomError * CCustomErrorsListBox::GetItem(UINT nIndex)
  140. {
  141. return (CCustomError *)GetItemDataPtr(nIndex);
  142. }
  143. inline int CCustomErrorsListBox::AddItem(CCustomError * pItem)
  144. {
  145. return AddString((LPCTSTR)pItem);
  146. }
  147. inline int CCustomErrorsListBox::InsertItem(int nPos, CCustomError * pItem)
  148. {
  149. return InsertString(nPos, (LPCTSTR)pItem);
  150. }
  151. inline CCustomError * CW3ErrorsPage ::GetSelectedListItem(
  152. OUT int * pnSel OPTIONAL
  153. )
  154. {
  155. return (CCustomError *)m_list_Errors.GetSelectedListItem(pnSel);
  156. }
  157. inline CCustomError * CW3ErrorsPage::GetNextSelectedItem(
  158. IN OUT int * pnStartingIndex
  159. )
  160. {
  161. return (CCustomError *)m_list_Errors.GetNextSelectedItem(pnStartingIndex);
  162. }