setupRecord.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #ifndef NULLOSFT_ONLINEMEDIA_PLUGIN_SETUPRECORD_HEADER
  2. #define NULLOSFT_ONLINEMEDIA_PLUGIN_SETUPRECORD_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <wtypes.h>
  7. #include "./setupListbox.h"
  8. class ifc_omservice;
  9. class ifc_omstorageasync;
  10. class SetupLog;
  11. class SetupRecord : public SetupListboxItem
  12. {
  13. protected:
  14. typedef enum
  15. {
  16. recordSelected = 0x0001,
  17. recordDownloaded = 0x0002,
  18. checkboxHighlighted = 0x0100,
  19. checkboxPressed = 0x0200,
  20. } RecordFlags;
  21. protected:
  22. SetupRecord(ifc_omservice *serviceToUse);
  23. ~SetupRecord();
  24. public:
  25. static SetupRecord *CreateInstance(ifc_omservice *serviceToUse);
  26. public:
  27. ULONG AddRef();
  28. ULONG Release();
  29. ifc_omservice *GetService() { return service; }
  30. BOOL IsModified();
  31. BOOL IsSelected();
  32. void SetSelected(BOOL fSelected);
  33. HRESULT GetServiceName(LPWSTR pszBuffer, UINT cchBufferMax);
  34. HRESULT GetDisplayName(LPWSTR pszBuffer, UINT cchBufferMax);
  35. HRESULT Save(SetupLog *log);
  36. HRESULT DownloadDetails();
  37. /* SetupListboxItem */
  38. BOOL MeasureItem(SetupListbox *instance, UINT *cx, UINT *cy);
  39. BOOL DrawItem(SetupListbox *instance, HDC hdc, const RECT *prc, UINT state);
  40. INT_PTR KeyToItem(SetupListbox *instance, const RECT *prcItem, INT vKey);
  41. BOOL MouseMove(SetupListbox *instance, const RECT *prcItem, UINT mouseFlags, POINT pt);
  42. BOOL MouseLeave(SetupListbox *instance, const RECT *prcItem);
  43. BOOL LButtonDown(SetupListbox *instance, const RECT *prcItem, UINT mouseFlags, POINT pt);
  44. BOOL LButtonUp(SetupListbox *instance, const RECT *prcItem, UINT mouseFlags, POINT pt);
  45. BOOL LButtonDblClk(SetupListbox *instance, const RECT *prcItem, UINT mouseFlags, POINT pt);
  46. BOOL RButtonDown(SetupListbox *instance, const RECT *prcItem, UINT mouseFlags, POINT pt);
  47. BOOL RButtonUp(SetupListbox *instance, const RECT *prcItem, UINT mouseFlags, POINT pt);
  48. void CaptureChanged(SetupListbox *instance, const RECT *prcItem, SetupListboxItem *captured);
  49. BOOL IsDisabled() { return FALSE; }
  50. void Command(SetupListbox *instance, INT commandId, INT eventId) {}
  51. HWND CreateDetailsView(HWND hParent);
  52. BOOL GetUniqueName(LPWSTR pszBuffer, UINT cchBufferMax);
  53. protected:
  54. BOOL AdjustCheckboxRect(SetupListbox *instance, RECT *prcItem);
  55. void GetColors(HDC hdc, UINT state, COLORREF *rgbBkOut, COLORREF *rgbTextOut);
  56. void InvertCheckbox(SetupListbox *instance, const RECT *prcItem);
  57. void OnDownloadCompleted();
  58. private:
  59. friend static void CALLBACK SetupRecord_ServiceDownloadedCallback(ifc_omstorageasync *result);
  60. protected:
  61. ULONG ref;
  62. ifc_omservice *service;
  63. ifc_omstorageasync *async;
  64. CRITICAL_SECTION lock;
  65. UINT flags;
  66. };
  67. #endif //NULLOSFT_ONLINEMEDIA_PLUGIN_SETUPRECORD_HEADER