1
0

serviceHost.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef NULLSOFT_WEBDEV_PLUGIN_SERVICE_HOST_HEADER
  2. #define NULLSOFT_WEBDEV_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 <bfc/multipatch.h>
  9. #define MPIID_OMSVCHOST 10
  10. #define MPIID_OMSVCEVENT 20
  11. class WebDevServiceHost : public MultiPatch<MPIID_OMSVCHOST, ifc_omservicehost>,
  12. public MultiPatch<MPIID_OMSVCEVENT, ifc_omserviceevent>
  13. {
  14. protected:
  15. WebDevServiceHost();
  16. ~WebDevServiceHost();
  17. public:
  18. static HRESULT CreateInstance(WebDevServiceHost **instance);
  19. static HRESULT GetCachedInstance(WebDevServiceHost **instance);
  20. static HRESULT ReleseCache();
  21. public:
  22. /* Dispatchable */
  23. size_t AddRef();
  24. size_t Release();
  25. int QueryInterface(GUID interface_guid, void **object);
  26. /* ifc_omservicehost */
  27. HRESULT GetExternal(ifc_omservice *service, IDispatch **ppDispatch);
  28. HRESULT GetBasePath(ifc_omservice *service, LPWSTR pszBuffer, UINT cchBufferMax);
  29. HRESULT GetDefaultName(ifc_omservice *service, LPWSTR pszBuffer, UINT cchBufferMax);
  30. HRESULT QueryCommandState(ifc_omservice *service, HWND hBrowser, const GUID *commandGroup, UINT commandId);
  31. HRESULT ExecuteCommand(ifc_omservice *service, HWND hBrowser, const GUID *commandGroup, UINT commandId, ULONG_PTR commandArg);
  32. HRESULT GetUrl(ifc_omservice *service, LPWSTR pszBuffer, UINT cchBufferMax);
  33. /* ifc_omsvceventhandler */
  34. void ServiceChange(ifc_omservice *service, UINT nModified);
  35. protected:
  36. ULONG ref;
  37. protected:
  38. RECVS_MULTIPATCH;
  39. };
  40. #endif //NULLSOFT_WEBDEV_PLUGIN_SERVICE_HOST_HEADER