aboutsummaryrefslogtreecommitdiff
path: root/Src/omBrowser/ifc_omservice.h
blob: c3bfec2ab52b6e9dde19d600b2a9d8da520986f5 (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#ifndef NULLSOFT_WINAMP_OMSERVICE_INTERFACE_HEADER
#define NULLSOFT_WINAMP_OMSERVICE_INTERFACE_HEADER

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

#include <bfc/dispatch.h>


// {2999A8B2-7780-4542-9257-02D4E89310B8}
static const GUID IFC_OmService = 
{ 0x2999a8b2, 0x7780, 0x4542, { 0x92, 0x57, 0x2, 0xd4, 0xe8, 0x93, 0x10, 0xb8 } };


interface IDispatch;
class ifc_omservicehost;

#define OMSVC_E_INSUFFICIENT_BUFFER MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_INSUFFICIENT_BUFFER) //same as STRSAFE_E_INSUFFICIENT_BUFFER


// supports AddRef(), Release(), QueryInterface()
class __declspec(novtable) ifc_omservice : public Dispatchable
{
public:
	typedef enum
	{
		RuntimeFlagsMask = 0xFFFF0000,
	} FlagsMask;

protected:
	ifc_omservice() {}
	~ifc_omservice() {}

public:
	unsigned int GetId();
	HRESULT GetName(wchar_t *pszBuffer, unsigned int cchBufferMax);
	HRESULT GetUrl(wchar_t *pszBuffer, unsigned int cchBufferMax);
	HRESULT GetUrlDirect(wchar_t *pszBuffer, unsigned int cchBufferMax);
	HRESULT GetIcon(wchar_t *pszBuffer, unsigned int cchBufferMax);
	HRESULT GetExternal(IDispatch **ppDispatch);
	HRESULT GetRating(unsigned int *rating);
	HRESULT GetVersion(unsigned int *version);
	HRESULT GetFlags(unsigned int *flags);
	HRESULT SetAddress(const wchar_t *pszAddress);
	HRESULT GetAddress(wchar_t *pszBuffer, unsigned int cchBufferMax);
	HRESULT GetGeneration(unsigned int *generation);
	HRESULT UpdateFlags(unsigned int flags);
	
public:
	DISPATCH_CODES
	{
		API_GETID				= 10,
		API_GETNAME				= 20,
		API_GETURL				= 30,
		API_GETICON				= 40,
		API_GETEXTERNAL			= 50,
		API_GETRATING			= 60,
		API_GETVERSION			= 70,
		API_GETFLAGS			= 80,
		API_SETADDRESS			= 90,
		API_GETADDRESS			= 100,
		API_GETGENERATION		= 110,
		API_GETURLDIRECT		= 120,
		API_UPDATEFLAGS			= 130,
	};
};


inline unsigned int ifc_omservice::GetId()
{
	return _call(API_GETID, 0);
}

inline HRESULT ifc_omservice::GetName(wchar_t *pszBuffer, unsigned int cchBufferMax)
{
	return _call(API_GETNAME, (HRESULT)E_NOTIMPL, pszBuffer, cchBufferMax);
}

inline HRESULT ifc_omservice::GetUrl(wchar_t *pszBuffer, unsigned int cchBufferMax)
{
	return _call(API_GETURL, E_NOTIMPL, pszBuffer, cchBufferMax);
}

inline HRESULT ifc_omservice::GetUrlDirect(wchar_t *pszBuffer, unsigned int cchBufferMax)
{
	return _call(API_GETURLDIRECT, E_NOTIMPL, pszBuffer, cchBufferMax);
}

inline HRESULT ifc_omservice::GetIcon(wchar_t *pszBuffer, unsigned int cchBufferMax)
{
	return _call(API_GETICON, (HRESULT)E_NOTIMPL, pszBuffer, cchBufferMax);
}

inline HRESULT ifc_omservice::GetExternal(IDispatch **ppDispatch)
{
	return _call(API_GETEXTERNAL, (HRESULT)E_NOTIMPL, ppDispatch);
}

inline HRESULT ifc_omservice::GetRating(unsigned int *rating)
{
	return _call(API_GETRATING, (HRESULT)E_NOTIMPL, rating);
}

inline HRESULT ifc_omservice::GetVersion(unsigned int *version)
{
	return _call(API_GETVERSION, (HRESULT)E_NOTIMPL, version);
}

inline HRESULT ifc_omservice::GetFlags(unsigned int *flags)
{
	return _call(API_GETFLAGS, (HRESULT)E_NOTIMPL, flags);
}

inline HRESULT ifc_omservice::SetAddress(const wchar_t *pszAddress)
{
	return _call(API_SETADDRESS, (HRESULT)E_NOTIMPL, pszAddress);
}

inline HRESULT ifc_omservice::GetAddress(wchar_t *pszBuffer, unsigned int cchBufferMax)
{
	return _call(API_GETADDRESS, (HRESULT)E_NOTIMPL, pszBuffer, cchBufferMax);
}

inline HRESULT ifc_omservice::GetGeneration(unsigned int *generation)
{
	return _call(API_GETGENERATION, (HRESULT)E_NOTIMPL, generation);
}

inline HRESULT ifc_omservice::UpdateFlags(unsigned int flags)
{
	return _call(API_UPDATEFLAGS, (HRESULT)E_NOTIMPL, flags);
}

#endif //NULLSOFT_WINAMP_OMSERVICE_INTERFACE_HEADER