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.

143 lines
3.9 KiB

  1. #ifndef HWPROMPT_H
  2. #define HWPROMPT_H
  3. #include "basedlg.h"
  4. #include "apdlglog.h"
  5. #include <dpa.h>
  6. class CBaseContentDlg : public CBaseDlg
  7. {
  8. public:
  9. CBaseContentDlg();
  10. HRESULT Init(LPCWSTR pszDeviceID, LPCWSTR pszDeviceIDAlt,
  11. DWORD dwContentType, BOOL fCheckAlwaysDoThis);
  12. LPWSTR _pszDeviceID;
  13. WCHAR _szDeviceIDAlt[MAX_PATH];
  14. BOOL _fCheckAlwaysDoThis;
  15. WCHAR _szHandler[MAX_HANDLER];
  16. WCHAR _szContentTypeHandler[MAX_CONTENTTYPEHANDLER];
  17. HINSTANCE _hinst;
  18. int _iResource;
  19. HWND _hwndParent;
  20. DWORD _dwContentType;
  21. protected:
  22. virtual ~CBaseContentDlg();
  23. LRESULT OnInitDialog(WPARAM wParam, LPARAM lParam);
  24. LRESULT OnNotify(WPARAM wParam, LPARAM lParam);
  25. LRESULT OnDestroy(WPARAM wParam, LPARAM lParam);
  26. virtual LRESULT OnOK(WORD wNotif);
  27. LRESULT OnCancel(WORD wNotif);
  28. virtual HRESULT _FillListView() PURE;
  29. virtual HRESULT _InitStatics() PURE;
  30. virtual HRESULT _InitSelections() PURE;
  31. virtual HRESULT _OnListSelChange() PURE;
  32. HRESULT _InitDeviceName();
  33. HRESULT _SetHandler();
  34. CUILListViewSelect<CHandlerData, LPCWSTR> _uilListView;
  35. WCHAR _szDeviceName[MAX_DEVICENAME];
  36. HICON _hiconInfo;
  37. HICON _hiconTop;
  38. private:
  39. HRESULT _InitListView();
  40. HRESULT _InitStaticsCommon();
  41. HIMAGELIST _himagelist;
  42. };
  43. ///////////////////////////////////////////////////////////////////////////////
  44. // Dialog to show when there is a dominant content and current setting is
  45. // "prompt each time"
  46. class CHWContentPromptDlg : public CBaseContentDlg
  47. {
  48. public:
  49. CHWContentPromptDlg();
  50. virtual ~CHWContentPromptDlg();
  51. protected:
  52. // From CBaseContentDlg
  53. HRESULT _FillListView();
  54. HRESULT _InitStatics();
  55. HRESULT _InitSelections();
  56. HRESULT _OnListSelChange();
  57. private:
  58. LRESULT OnOK(WORD wNotif);
  59. HRESULT _InitDataObjects();
  60. HRESULT _InitDominantContent();
  61. HRESULT _InitExistingSettings();
  62. HRESULT _SaveSettings(BOOL fSoftCommit);
  63. HRESULT _UpdateHandlerSettings();
  64. CContentTypeData _data;
  65. CDLManager<CContentTypeData> _dlmanager;
  66. };
  67. ///////////////////////////////////////////////////////////////////////////////
  68. // Dialog to show when there is mixed content and current setting is "prompt
  69. // each time"
  70. class CMixedContentDlg : public CBaseContentDlg
  71. {
  72. public:
  73. CMixedContentDlg();
  74. virtual ~CMixedContentDlg();
  75. protected:
  76. LRESULT OnOK(WORD wNotif);
  77. // From CBaseContentDlg
  78. HRESULT _FillListView();
  79. HRESULT _InitStatics();
  80. HRESULT _InitSelections();
  81. HRESULT _OnListSelChange();
  82. private:
  83. HRESULT _InitDataObjects();
  84. CDPA<CContentTypeData> _dpaContentTypeData;
  85. };
  86. ///////////////////////////////////////////////////////////////////////////////
  87. // Dialog to show when there is no content and current setting is "prompt
  88. // each time"
  89. class CNoContentDlg : public CBaseContentDlg
  90. {
  91. public:
  92. CNoContentDlg();
  93. virtual ~CNoContentDlg();
  94. protected:
  95. // From CBaseContentDlg
  96. HRESULT _FillListView();
  97. HRESULT _InitStatics();
  98. HRESULT _InitSelections();
  99. HRESULT _OnListSelChange();
  100. private:
  101. LRESULT OnOK(WORD wNotif);
  102. HRESULT _InitDataObjects();
  103. HRESULT _InitExistingSettings();
  104. HRESULT _SaveSettings(BOOL fSoftCommit);
  105. HRESULT _UpdateHandlerSettings();
  106. CNoContentData _data;
  107. CDLManager<CNoContentData> _dlmanager;
  108. };
  109. #endif //HWPROMPT_H