2 * Implementation of event-related interfaces for IE Web Browser control:
4 * - IConnectionPointContainer
7 * Copyright 2001 John R. Sheets (for CodeWeavers)
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #include "wine/debug.h"
28 WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
31 static const GUID IID_INotifyDBEvents =
32 { 0xdb526cc0, 0xd188, 0x11cd, { 0xad, 0x48, 0x00, 0xaa, 0x00, 0x3c, 0x9c, 0xb6 } };
34 /**********************************************************************
35 * Implement the IConnectionPointContainer interface
38 static HRESULT WINAPI WBCPC_QueryInterface(LPCONNECTIONPOINTCONTAINER iface,
39 REFIID riid, LPVOID *ppobj)
41 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
43 if (ppobj == NULL) return E_POINTER;
48 static ULONG WINAPI WBCPC_AddRef(LPCONNECTIONPOINTCONTAINER iface)
52 return 2; /* non-heap based object */
55 static ULONG WINAPI WBCPC_Release(LPCONNECTIONPOINTCONTAINER iface)
57 SHDOCVW_UnlockModule();
59 return 1; /* non-heap based object */
62 /* Get a list of connection points inside this container. */
63 static HRESULT WINAPI WBCPC_EnumConnectionPoints(LPCONNECTIONPOINTCONTAINER iface,
64 LPENUMCONNECTIONPOINTS *ppEnum)
66 FIXME("stub: IEnumConnectionPoints = %p\n", *ppEnum);
70 /* Retrieve the connection point in this container associated with the
71 * riid interface. When events occur in the control, the control can
72 * call backwards into its embedding site, through these interfaces.
74 static HRESULT WINAPI WBCPC_FindConnectionPoint(LPCONNECTIONPOINTCONTAINER iface,
75 REFIID riid, LPCONNECTIONPOINT *ppCP)
77 TRACE(": IID = %s, IConnectionPoint = %p\n", debugstr_guid(riid), *ppCP);
79 /* For now, return the same IConnectionPoint object for both
80 * event interface requests.
82 if (IsEqualGUID (&IID_INotifyDBEvents, riid))
84 TRACE("Returning connection point %p for IID_INotifyDBEvents\n",
85 &SHDOCVW_ConnectionPoint);
86 *ppCP = (LPCONNECTIONPOINT)&SHDOCVW_ConnectionPoint;
89 else if (IsEqualGUID (&IID_IPropertyNotifySink, riid))
91 TRACE("Returning connection point %p for IID_IPropertyNotifySink\n",
92 &SHDOCVW_ConnectionPoint);
93 *ppCP = (LPCONNECTIONPOINT)&SHDOCVW_ConnectionPoint;
100 /**********************************************************************
101 * IConnectionPointContainer virtual function table for IE Web Browser component
104 static IConnectionPointContainerVtbl WBCPC_Vtbl =
106 WBCPC_QueryInterface,
109 WBCPC_EnumConnectionPoints,
110 WBCPC_FindConnectionPoint
113 IConnectionPointContainerImpl SHDOCVW_ConnectionPointContainer = {&WBCPC_Vtbl};
116 /**********************************************************************
117 * Implement the IConnectionPoint interface
120 static HRESULT WINAPI WBCP_QueryInterface(LPCONNECTIONPOINT iface,
121 REFIID riid, LPVOID *ppobj)
123 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
125 if (ppobj == NULL) return E_POINTER;
127 return E_NOINTERFACE;
130 static ULONG WINAPI WBCP_AddRef(LPCONNECTIONPOINT iface)
132 SHDOCVW_LockModule();
134 return 2; /* non-heap based object */
137 static ULONG WINAPI WBCP_Release(LPCONNECTIONPOINT iface)
139 SHDOCVW_UnlockModule();
141 return 1; /* non-heap based object */
144 static HRESULT WINAPI WBCP_GetConnectionInterface(LPCONNECTIONPOINT iface, IID* pIId)
146 FIXME("stub: %s\n", debugstr_guid(pIId));
150 /* Get this connection point's owning container */
151 static HRESULT WINAPI
152 WBCP_GetConnectionPointContainer(LPCONNECTIONPOINT iface,
153 LPCONNECTIONPOINTCONTAINER *ppCPC)
155 FIXME("stub: IConnectionPointContainer = %p\n", *ppCPC);
159 /* Connect the pUnkSink event-handling implementation (in the control site)
160 * to this connection point. Return a handle to this connection in
161 * pdwCookie (for later use in Unadvise()).
163 static HRESULT WINAPI WBCP_Advise(LPCONNECTIONPOINT iface,
164 LPUNKNOWN pUnkSink, DWORD *pdwCookie)
166 static int new_cookie;
168 FIXME("stub: IUnknown = %p, connection cookie = %ld\n", pUnkSink, *pdwCookie);
170 *pdwCookie = ++new_cookie;
171 TRACE ("Returning cookie = %ld\n", *pdwCookie);
176 /* Disconnect this implementation from the connection point. */
177 static HRESULT WINAPI WBCP_Unadvise(LPCONNECTIONPOINT iface,
180 FIXME("stub: cookie to disconnect = %lx\n", dwCookie);
184 /* Get a list of connections in this connection point. */
185 static HRESULT WINAPI WBCP_EnumConnections(LPCONNECTIONPOINT iface,
186 LPENUMCONNECTIONS *ppEnum)
188 FIXME("stub: IEnumConnections = %p\n", *ppEnum);
192 /**********************************************************************
193 * IConnectionPoint virtual function table for IE Web Browser component
196 static IConnectionPointVtbl WBCP_Vtbl =
201 WBCP_GetConnectionInterface,
202 WBCP_GetConnectionPointContainer,
208 IConnectionPointImpl SHDOCVW_ConnectionPoint = {&WBCP_Vtbl};