serviceHost.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #ifndef NULLSOFT_ONLINEMEDIA_PLUGIN_SERVICE_HOST_HEADER
  2. #define NULLSOFT_ONLINEMEDIA_PLUGIN_SERVICE_HOST_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <ifc_omservicehost.h>
  7. #include <ifc_omserviceevent.h>
  8. #include <ifc_omstorageext.h>
  9. #include <bfc/multipatch.h>
  10. #define SVCF_SUBSCRIBED 0x00000001
  11. // runtime flags
  12. #define SVCF_SPECIAL 0x00010000
  13. #define SVCF_USECLIENTOWEB 0x00020000
  14. #define SVCF_VALIDATED 0x00040000
  15. #define SVCF_VERSIONCHECK 0x00080000
  16. #define SVCF_PREAUTHORIZED 0x00100000
  17. #define SVCF_AUTOUPGRADE 0x00200000
  18. #define MPIID_OMSVCHOST 10
  19. #define MPIID_OMSVCEVENT 20
  20. #define MPIID_OMSTRGEXT 30
  21. class ifc_omstoragehandlerenum;
  22. class ServiceHost : public MultiPatch<MPIID_OMSVCHOST, ifc_omservicehost>,
  23. public MultiPatch<MPIID_OMSVCEVENT, ifc_omserviceevent>,
  24. public MultiPatch<MPIID_OMSTRGEXT, ifc_omstorageext>
  25. {
  26. protected:
  27. ServiceHost();
  28. ~ServiceHost();
  29. public:
  30. static HRESULT CreateInstance(ServiceHost **instance);
  31. static HRESULT GetCachedInstance(ServiceHost **instance);
  32. static HRESULT ReleseCache();
  33. public:
  34. /* Dispatchable */
  35. size_t AddRef();
  36. size_t Release();
  37. int QueryInterface(GUID interface_guid, void **object);
  38. /* ifc_omservicehost */
  39. HRESULT GetExternal(ifc_omservice *service, IDispatch **ppDispatch);
  40. HRESULT GetBasePath(ifc_omservice *service, LPWSTR pszBuffer, UINT cchBufferMax);
  41. HRESULT GetDefaultName(ifc_omservice *service, LPWSTR pszBuffer, UINT cchBufferMax);
  42. HRESULT QueryCommandState(ifc_omservice *service, HWND hBrowser, const GUID *commandGroup, UINT commandId);
  43. HRESULT ExecuteCommand(ifc_omservice *service, HWND hBrowser, const GUID *commandGroup, UINT commandId, ULONG_PTR commandArg);
  44. HRESULT GetUrl(ifc_omservice *service, LPWSTR pszBuffer, UINT cchBufferMax);
  45. /* ifc_omsvceventhandler */
  46. void ServiceChange(ifc_omservice *service, UINT nModified);
  47. /* ifc_omstorageext */
  48. HRESULT EnumerateStorageExt(const GUID *storageId, ifc_omstoragehandlerenum **enumerator);
  49. protected:
  50. ULONG ref;
  51. ifc_omstoragehandlerenum *storageExtXml;
  52. ifc_omstoragehandlerenum *storageExtIni;
  53. protected:
  54. RECVS_MULTIPATCH;
  55. };
  56. #endif //NULLSOFT_ONLINEMEDIA_PLUGIN_SERVICE_HOST_HEADER