setupServicePanel.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #ifndef NULLOSFT_ONLINEMEDIA_PLUGIN_SETUP_SERVICE_PANEL_HEADER
  2. #define NULLOSFT_ONLINEMEDIA_PLUGIN_SETUP_SERVICE_PANEL_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <wtypes.h>
  7. #include <bfc/multipatch.h>
  8. #include <ifc_omserviceevent.h>
  9. #include <ifc_omcachecallback.h>
  10. class ifc_omservice;
  11. #define MPIID_SERVICEEVENT 10
  12. #define MPIID_CACHECALLBACK 20
  13. class ServicePanel : public MultiPatch<MPIID_SERVICEEVENT, ifc_omserviceevent>,
  14. public MultiPatch<MPIID_CACHECALLBACK, ifc_omcachecallback>
  15. {
  16. protected:
  17. ServicePanel(LPCWSTR pszName, ifc_omservice *service);
  18. ~ServicePanel();
  19. public:
  20. static HWND CreateInstance(HWND hParent, LPCWSTR pszName, ifc_omservice *service, ServicePanel **instance);
  21. public:
  22. /* Dispatchable */
  23. size_t AddRef();
  24. size_t Release();
  25. int QueryInterface(GUID interface_guid, void **object);
  26. /* ifc_omserviceevent */
  27. void ServiceChange(ifc_omservice *service, unsigned int modifiedFlags);
  28. /* ifc_omcachecallback */
  29. void PathChanged(ifc_omcacherecord *record);
  30. protected:
  31. void Attach(HWND hwnd);
  32. void Detach();
  33. void UpdateName();
  34. void UpdateDescription();
  35. void UpdateMeta();
  36. void UpdateThumbnail();
  37. HFONT PickTitleFont(LPCWSTR pszTitle, INT cchTitle, INT maxWidth);
  38. LPCWSTR FormatDate(LPCWSTR pszDate, LPWSTR pszBuffer, INT cchBufferMax);
  39. HRESULT GetFullName(LPWSTR pszBuffer, UINT cchBufferMax);
  40. INT_PTR OnInitDialog(HWND hFocus, LPARAM lParam);
  41. void OnDestroy();
  42. INT_PTR OnDialogColor(HDC hdc, HWND hControl);
  43. INT_PTR OnStaticColor(HDC hdc, HWND hControl);
  44. INT_PTR DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
  45. INT_PTR OnGetUniqueName(LPWSTR pszBuffer, UINT cchBufferMax);
  46. HRESULT LoadLocalThumbnail(LPCWSTR pszPath);
  47. private:
  48. friend static INT_PTR WINAPI ServicePanel_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  49. protected:
  50. size_t ref;
  51. HWND hwnd;
  52. LPWSTR name;
  53. ifc_omservice *service;
  54. ifc_omcacherecord *thumbnailCache;
  55. HFONT fontTitle;
  56. HFONT fontMeta;
  57. private:
  58. RECVS_MULTIPATCH;
  59. };
  60. #endif //NULLOSFT_ONLINEMEDIA_PLUGIN_SETUP_SERVICE_PANEL_HEADER