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.

90 lines
2.6 KiB

  1. /****************************************************************************\
  2. *
  3. * provdlg.h
  4. *
  5. * Created: William Taylor (wtaylor) 01/22/01
  6. *
  7. * MS Ratings Ratings Provider Dialog
  8. *
  9. \****************************************************************************/
  10. #ifndef FILE_DIALOG_H
  11. #define FILE_DIALOG_H
  12. #include "basedlg.h" // CBaseDialog
  13. const UINT PASSCONFIRM_FAIL = 0;
  14. const UINT PASSCONFIRM_OK = 1;
  15. const UINT PASSCONFIRM_NEW = 2;
  16. struct ProviderData
  17. {
  18. PicsRatingSystem *pPRS;
  19. PicsRatingSystem *pprsNew;
  20. UINT nAction;
  21. };
  22. const UINT PROVIDER_KEEP = 0;
  23. const UINT PROVIDER_ADD = 1;
  24. const UINT PROVIDER_DEL = 2;
  25. class CProviderDialog: public CBaseDialog<CProviderDialog>
  26. {
  27. private:
  28. static DWORD aIds[];
  29. PicsRatingSystemInfo * m_pPRSI;
  30. array<ProviderData> m_aPD;
  31. public:
  32. enum { IDD = IDD_PROVIDERS };
  33. public:
  34. CProviderDialog( PicsRatingSystemInfo * p_pPRSI );
  35. public:
  36. typedef CProviderDialog thisClass;
  37. typedef CBaseDialog<thisClass> baseClass;
  38. BEGIN_MSG_MAP(thisClass)
  39. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  40. COMMAND_HANDLER(IDC_PROVIDERLIST, LBN_SELCHANGE, OnSelChange)
  41. COMMAND_ID_HANDLER(IDOK, OnOK)
  42. COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
  43. COMMAND_ID_HANDLER(IDC_CLOSEPROVIDER, OnCloseProvider)
  44. COMMAND_ID_HANDLER(IDC_OPENPROVIDER, OnOpenProvider)
  45. MESSAGE_HANDLER(WM_HELP, OnHelp)
  46. MESSAGE_HANDLER(WM_CONTEXTMENU, OnContextMenu)
  47. CHAIN_MSG_MAP(baseClass)
  48. END_MSG_MAP()
  49. protected:
  50. LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  51. LRESULT OnSelChange(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  52. LRESULT OnOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  53. LRESULT OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  54. LRESULT OnCloseProvider(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  55. LRESULT OnOpenProvider(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  56. LRESULT OnHelp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  57. LRESULT OnContextMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  58. protected:
  59. BOOL OpenTemplateDlg( CHAR * szFilename,UINT cbFilename );
  60. void SetHorizontalExtent(HWND hwndLB, LPCSTR pszString);
  61. void AddProviderToList(UINT idx, LPCSTR pszFilename);
  62. BOOL InitProviderDlg( void );
  63. void EndProviderDlg(BOOL fRet);
  64. void CommitProviderDlg( void );
  65. void RemoveProvider( void );
  66. int CompareProviderNames(PicsRatingSystem *pprsOld, PicsRatingSystem *pprsNew);
  67. void AddProvider( PSTR szAddFileName=NULL );
  68. };
  69. #endif