aboutsummaryrefslogtreecommitdiff
path: root/Src/Plugins/Library/ml_webdev/serviceHost.h
blob: 7dbce0e74ff90a1035c3046aa3c133cd3af1e0e0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef NULLSOFT_WEBDEV_PLUGIN_SERVICE_HOST_HEADER
#define NULLSOFT_WEBDEV_PLUGIN_SERVICE_HOST_HEADER

#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif

#include <ifc_omservicehost.h>
#include <ifc_omserviceevent.h>
#include <bfc/multipatch.h>

#define MPIID_OMSVCHOST		10
#define MPIID_OMSVCEVENT		20

class WebDevServiceHost :	public MultiPatch<MPIID_OMSVCHOST, ifc_omservicehost>,
							public MultiPatch<MPIID_OMSVCEVENT, ifc_omserviceevent>
{

protected:
	WebDevServiceHost();
	~WebDevServiceHost();

public:
	static HRESULT CreateInstance(WebDevServiceHost **instance);
	static HRESULT GetCachedInstance(WebDevServiceHost **instance);
	static HRESULT ReleseCache();

public:
	/* Dispatchable */
	size_t AddRef();
	size_t Release();
	int QueryInterface(GUID interface_guid, void **object);

	/* ifc_omservicehost */
	HRESULT GetExternal(ifc_omservice *service, IDispatch **ppDispatch);
	HRESULT GetBasePath(ifc_omservice *service, LPWSTR pszBuffer, UINT cchBufferMax);
	HRESULT GetDefaultName(ifc_omservice *service, LPWSTR pszBuffer, UINT cchBufferMax);
	HRESULT QueryCommandState(ifc_omservice *service, HWND hBrowser, const GUID *commandGroup, UINT commandId);
	HRESULT ExecuteCommand(ifc_omservice *service, HWND hBrowser, const GUID *commandGroup, UINT commandId, ULONG_PTR commandArg);
	HRESULT GetUrl(ifc_omservice *service, LPWSTR pszBuffer, UINT cchBufferMax);

	/* ifc_omsvceventhandler */
	void ServiceChange(ifc_omservice *service, UINT nModified);

protected:
	ULONG ref;

protected:
	RECVS_MULTIPATCH;
};




#endif //NULLSOFT_WEBDEV_PLUGIN_SERVICE_HOST_HEADER