source: trunk/src/shdocvw/events.c@ 10366

Last change on this file since 10366 was 6712, checked in by sandervl, 24 years ago

restored old version

File size: 5.6 KB
Line 
1/*
2 * Implementation of event-related interfaces for IE Web Browser control:
3 *
4 * - IConnectionPointContainer
5 * - IConnectionPoint
6 *
7 * 2001 John R. Sheets (for CodeWeavers)
8 */
9
10#include "debugtools.h"
11#include "shdocvw.h"
12
13DEFAULT_DEBUG_CHANNEL(shdocvw);
14
15
16/**********************************************************************
17 * Implement the IConnectionPointContainer interface
18 */
19
20static HRESULT WINAPI WBCPC_QueryInterface(LPCONNECTIONPOINTCONTAINER iface,
21 REFIID riid, LPVOID *ppobj)
22{
23 ICOM_THIS(IConnectionPointContainerImpl, iface);
24
25 FIXME("(%p)->(%s,%p),stub!\n", This, debugstr_guid(riid), ppobj);
26 return E_NOINTERFACE;
27}
28
29static ULONG WINAPI WBCPC_AddRef(LPCONNECTIONPOINTCONTAINER iface)
30{
31 ICOM_THIS(IConnectionPointContainerImpl, iface);
32
33 TRACE("\n");
34 return ++(This->ref);
35}
36
37static ULONG WINAPI WBCPC_Release(LPCONNECTIONPOINTCONTAINER iface)
38{
39 ICOM_THIS(IConnectionPointContainerImpl, iface);
40
41 /* static class, won't be freed */
42 TRACE("\n");
43 return --(This->ref);
44}
45
46/* Get a list of connection points inside this container. */
47static HRESULT WINAPI WBCPC_EnumConnectionPoints(LPCONNECTIONPOINTCONTAINER iface,
48 LPENUMCONNECTIONPOINTS *ppEnum)
49{
50 FIXME("stub: IEnumConnectionPoints = %p\n", *ppEnum);
51 return S_OK;
52}
53
54/* Retrieve the connection point in this container associated with the
55 * riid interface. When events occur in the control, the control can
56 * call backwards into its embedding site, through these interfaces.
57 */
58static HRESULT WINAPI WBCPC_FindConnectionPoint(LPCONNECTIONPOINTCONTAINER iface,
59 REFIID riid, LPCONNECTIONPOINT *ppCP)
60{
61 TRACE(": IID = %s, IConnectionPoint = %p\n", debugstr_guid(riid), *ppCP);
62
63 /* For now, return the same IConnectionPoint object for both
64 * event interface requests.
65 */
66 if (IsEqualGUID (&IID_INotifyDBEvents, riid))
67 {
68 TRACE("Returning connection point %p for IID_INotifyDBEvents\n",
69 &SHDOCVW_ConnectionPoint);
70 *ppCP = (LPCONNECTIONPOINT)&SHDOCVW_ConnectionPoint;
71 return S_OK;
72 }
73 else if (IsEqualGUID (&IID_IPropertyNotifySink, riid))
74 {
75 TRACE("Returning connection point %p for IID_IPropertyNotifySink\n",
76 &SHDOCVW_ConnectionPoint);
77 *ppCP = (LPCONNECTIONPOINT)&SHDOCVW_ConnectionPoint;
78 return S_OK;
79 }
80
81 return E_FAIL;
82}
83
84/**********************************************************************
85 * IConnectionPointContainer virtual function table for IE Web Browser component
86 */
87
88static ICOM_VTABLE(IConnectionPointContainer) WBCPC_Vtbl =
89{
90 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
91 WBCPC_QueryInterface,
92 WBCPC_AddRef,
93 WBCPC_Release,
94 WBCPC_EnumConnectionPoints,
95 WBCPC_FindConnectionPoint
96};
97
98IConnectionPointContainerImpl SHDOCVW_ConnectionPointContainer = { &WBCPC_Vtbl, 1 };
99
100
101/**********************************************************************
102 * Implement the IConnectionPoint interface
103 */
104
105static HRESULT WINAPI WBCP_QueryInterface(LPCONNECTIONPOINT iface,
106 REFIID riid, LPVOID *ppobj)
107{
108 ICOM_THIS(IConnectionPointImpl, iface);
109
110 FIXME("(%p)->(%s,%p),stub!\n", This, debugstr_guid(riid), ppobj);
111 return E_NOINTERFACE;
112}
113
114static ULONG WINAPI WBCP_AddRef(LPCONNECTIONPOINT iface)
115{
116 ICOM_THIS(IConnectionPointImpl, iface);
117
118 TRACE("\n");
119 return ++(This->ref);
120}
121
122static ULONG WINAPI WBCP_Release(LPCONNECTIONPOINT iface)
123{
124 ICOM_THIS(IConnectionPointImpl, iface);
125
126 /* static class, won't be freed */
127 TRACE("\n");
128 return --(This->ref);
129}
130
131static HRESULT WINAPI WBCP_GetConnectionInterface(LPCONNECTIONPOINT iface, IID* pIId)
132{
133 FIXME("stub: %s\n", debugstr_guid(pIId));
134 return S_OK;
135}
136
137/* Get this connection point's owning container */
138static HRESULT WINAPI
139WBCP_GetConnectionPointContainer(LPCONNECTIONPOINT iface,
140 LPCONNECTIONPOINTCONTAINER *ppCPC)
141{
142 FIXME("stub: IConnectionPointContainer = %p\n", *ppCPC);
143 return S_OK;
144}
145
146/* Connect the pUnkSink event-handling implementation (in the control site)
147 * to this connection point. Return a handle to this connection in
148 * pdwCookie (for later use in Unadvise()).
149 */
150static HRESULT WINAPI WBCP_Advise(LPCONNECTIONPOINT iface,
151 LPUNKNOWN pUnkSink, DWORD *pdwCookie)
152{
153 static int new_cookie;
154
155 FIXME("stub: IUnknown = %p, connection cookie = %ld\n", pUnkSink, *pdwCookie);
156
157 *pdwCookie = ++new_cookie;
158 TRACE ("Returning cookie = %ld\n", *pdwCookie);
159
160 return S_OK;
161}
162
163/* Disconnect this implementation from the connection point. */
164static HRESULT WINAPI WBCP_Unadvise(LPCONNECTIONPOINT iface,
165 DWORD dwCookie)
166{
167 FIXME("stub: cookie to disconnect = %ld\n", dwCookie);
168 return S_OK;
169}
170
171/* Get a list of connections in this connection point. */
172static HRESULT WINAPI WBCP_EnumConnections(LPCONNECTIONPOINT iface,
173 LPENUMCONNECTIONS *ppEnum)
174{
175 FIXME("stub: IEnumConnections = %p\n", *ppEnum);
176 return S_OK;
177}
178
179/**********************************************************************
180 * IConnectionPoint virtual function table for IE Web Browser component
181 */
182
183static ICOM_VTABLE(IConnectionPoint) WBCP_Vtbl =
184{
185 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
186 WBCP_QueryInterface,
187 WBCP_AddRef,
188 WBCP_Release,
189 WBCP_GetConnectionInterface,
190 WBCP_GetConnectionPointContainer,
191 WBCP_Advise,
192 WBCP_Unadvise,
193 WBCP_EnumConnections
194};
195
196IConnectionPointImpl SHDOCVW_ConnectionPoint = { &WBCP_Vtbl, 1 };
Note: See TracBrowser for help on using the repository browser.