2 * Implementation of event-related interfaces for WebBrowser 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
);
30 static IConnectionPointImpl SHDOCVW_ConnectionPoint
;
32 static const GUID IID_INotifyDBEvents
=
33 { 0xdb526cc0, 0xd188, 0x11cd, { 0xad, 0x48, 0x00, 0xaa, 0x00, 0x3c, 0x9c, 0xb6 } };
35 /**********************************************************************
36 * Implement the IConnectionPointContainer interface
39 #define CONPTCONT_THIS(iface) DEFINE_THIS(WebBrowser, ConnectionPointContainer, iface)
41 static HRESULT WINAPI
ConnectionPointContainer_QueryInterface(IConnectionPointContainer
*iface
,
42 REFIID riid
, LPVOID
*ppobj
)
44 WebBrowser
*This
= CONPTCONT_THIS(iface
);
45 return IWebBrowser_QueryInterface(WEBBROWSER(This
), riid
, ppobj
);
48 static ULONG WINAPI
ConnectionPointContainer_AddRef(IConnectionPointContainer
*iface
)
50 WebBrowser
*This
= CONPTCONT_THIS(iface
);
51 return IWebBrowser_AddRef(WEBBROWSER(This
));
54 static ULONG WINAPI
ConnectionPointContainer_Release(IConnectionPointContainer
*iface
)
56 WebBrowser
*This
= CONPTCONT_THIS(iface
);
57 return IWebBrowser_Release(WEBBROWSER(This
));
60 static HRESULT WINAPI
ConnectionPointContainer_EnumConnectionPoints(IConnectionPointContainer
*iface
,
61 LPENUMCONNECTIONPOINTS
*ppEnum
)
63 WebBrowser
*This
= CONPTCONT_THIS(iface
);
64 FIXME("(%p)->(%p)\n", This
, ppEnum
);
68 static HRESULT WINAPI
ConnectionPointContainer_FindConnectionPoint(IConnectionPointContainer
*iface
,
69 REFIID riid
, LPCONNECTIONPOINT
*ppCP
)
71 WebBrowser
*This
= CONPTCONT_THIS(iface
);
73 FIXME("(%p)->(%s %p)\n", This
, debugstr_guid(riid
), ppCP
);
75 /* For now, return the same IConnectionPoint object for both
76 * event interface requests.
78 if (IsEqualGUID (&IID_INotifyDBEvents
, riid
))
80 TRACE("Returning connection point %p for IID_INotifyDBEvents\n",
81 &SHDOCVW_ConnectionPoint
);
82 *ppCP
= (LPCONNECTIONPOINT
)&SHDOCVW_ConnectionPoint
;
85 else if (IsEqualGUID (&IID_IPropertyNotifySink
, riid
))
87 TRACE("Returning connection point %p for IID_IPropertyNotifySink\n",
88 &SHDOCVW_ConnectionPoint
);
89 *ppCP
= (LPCONNECTIONPOINT
)&SHDOCVW_ConnectionPoint
;
98 static const IConnectionPointContainerVtbl ConnectionPointContainerVtbl
=
100 ConnectionPointContainer_QueryInterface
,
101 ConnectionPointContainer_AddRef
,
102 ConnectionPointContainer_Release
,
103 ConnectionPointContainer_EnumConnectionPoints
,
104 ConnectionPointContainer_FindConnectionPoint
108 /**********************************************************************
109 * Implement the IConnectionPoint interface
112 static HRESULT WINAPI
WBCP_QueryInterface(LPCONNECTIONPOINT iface
,
113 REFIID riid
, LPVOID
*ppobj
)
115 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid
));
117 if (ppobj
== NULL
) return E_POINTER
;
119 return E_NOINTERFACE
;
122 static ULONG WINAPI
WBCP_AddRef(LPCONNECTIONPOINT iface
)
124 SHDOCVW_LockModule();
126 return 2; /* non-heap based object */
129 static ULONG WINAPI
WBCP_Release(LPCONNECTIONPOINT iface
)
131 SHDOCVW_UnlockModule();
133 return 1; /* non-heap based object */
136 static HRESULT WINAPI
WBCP_GetConnectionInterface(LPCONNECTIONPOINT iface
, IID
* pIId
)
138 FIXME("stub: %s\n", debugstr_guid(pIId
));
142 /* Get this connection point's owning container */
143 static HRESULT WINAPI
144 WBCP_GetConnectionPointContainer(LPCONNECTIONPOINT iface
,
145 LPCONNECTIONPOINTCONTAINER
*ppCPC
)
147 FIXME("stub: IConnectionPointContainer = %p\n", *ppCPC
);
151 /* Connect the pUnkSink event-handling implementation (in the control site)
152 * to this connection point. Return a handle to this connection in
153 * pdwCookie (for later use in Unadvise()).
155 static HRESULT WINAPI
WBCP_Advise(LPCONNECTIONPOINT iface
,
156 LPUNKNOWN pUnkSink
, DWORD
*pdwCookie
)
158 static int new_cookie
;
160 FIXME("stub: IUnknown = %p, connection cookie = %ld\n", pUnkSink
, *pdwCookie
);
162 *pdwCookie
= ++new_cookie
;
163 TRACE ("Returning cookie = %ld\n", *pdwCookie
);
168 /* Disconnect this implementation from the connection point. */
169 static HRESULT WINAPI
WBCP_Unadvise(LPCONNECTIONPOINT iface
,
172 FIXME("stub: cookie to disconnect = %lx\n", dwCookie
);
176 /* Get a list of connections in this connection point. */
177 static HRESULT WINAPI
WBCP_EnumConnections(LPCONNECTIONPOINT iface
,
178 LPENUMCONNECTIONS
*ppEnum
)
180 FIXME("stub: IEnumConnections = %p\n", *ppEnum
);
184 /**********************************************************************
185 * IConnectionPoint virtual function table for IE Web Browser component
188 static const IConnectionPointVtbl WBCP_Vtbl
=
193 WBCP_GetConnectionInterface
,
194 WBCP_GetConnectionPointContainer
,
200 static IConnectionPointImpl SHDOCVW_ConnectionPoint
= {&WBCP_Vtbl
};
202 void WebBrowser_Events_Init(WebBrowser
*This
)
204 This
->lpConnectionPointContainerVtbl
= &ConnectionPointContainerVtbl
;