5 * Copyright 2001 John R. Sheets (for CodeWeavers)
6 * Copyright 2002 Hidenori Takeshima
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31 #include "wine/obj_base.h"
32 #include "wine/obj_storage.h"
33 #include "wine/obj_misc.h"
34 #include "wine/obj_moniker.h"
35 #include "wine/obj_inplace.h"
36 #include "wine/obj_dataobject.h"
37 #include "wine/obj_oleobj.h"
38 #include "wine/obj_oleaut.h"
39 #include "wine/obj_olefont.h"
40 #include "wine/obj_dragdrop.h"
41 #include "wine/obj_oleview.h"
42 #include "wine/obj_control.h"
43 #include "wine/obj_connection.h"
44 #include "wine/obj_property.h"
45 #include "wine/obj_oleundo.h"
46 #include "wine/obj_webbrowser.h"
48 #include "wine/debug.h"
49 WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
54 typedef struct CConnectionPointImpl
56 COMIMPL_IUnkImpl vfunk; /* must be the first member of this struct */
57 struct { ICOM_VFIELD(IConnectionPoint); } vfcpoint;
59 /* CConnectionPointImpl variables */
61 } CConnectionPointImpl;
63 #define CConnectionPointImpl_THIS(iface,member) CConnectionPointImpl* This = ((CConnectionPointImpl*)(((char*)iface)-offsetof(CConnectionPointImpl,member)))
66 static COMIMPL_IFEntry IFEntries[] =
68 { &IID_IConnectionPoint, offsetof(CConnectionPointImpl,vfcpoint)-offsetof(CConnectionPointImpl,vfunk) },
71 /***************************************************************************
73 * CConnectionPointImpl::IConnectionPoint
76 /**********************************************************************
77 * Implement the IConnectionPoint interface
80 static HRESULT WINAPI WBCP_QueryInterface(LPCONNECTIONPOINT iface,
81 REFIID riid, LPVOID *ppobj)
83 CConnectionPointImpl_THIS(iface,vfcpoint);
85 TRACE("(%p)->()\n",This);
87 return IUnknown_QueryInterface(This->vfunk.punkControl,riid,ppobj);
90 static ULONG WINAPI WBCP_AddRef(LPCONNECTIONPOINT iface)
92 CConnectionPointImpl_THIS(iface,vfcpoint);
94 TRACE("(%p)->()\n",This);
96 return IUnknown_AddRef(This->vfunk.punkControl);
99 static ULONG WINAPI WBCP_Release(LPCONNECTIONPOINT iface)
101 CConnectionPointImpl_THIS(iface,vfcpoint);
103 TRACE("(%p)->()\n",This);
105 return IUnknown_Release(This->vfunk.punkControl);
108 static HRESULT WINAPI WBCP_GetConnectionInterface(LPCONNECTIONPOINT iface, IID* pIId)
110 FIXME("stub: %s\n", debugstr_guid(pIId));
114 /* Get this connection point's owning container */
115 static HRESULT WINAPI
116 WBCP_GetConnectionPointContainer(LPCONNECTIONPOINT iface,
117 LPCONNECTIONPOINTCONTAINER *ppCPC)
119 FIXME("stub: IConnectionPointContainer = %p\n", *ppCPC);
123 /* Connect the pUnkSink event-handling implementation (in the control site)
124 * to this connection point. Return a handle to this connection in
125 * pdwCookie (for later use in Unadvise()).
127 static HRESULT WINAPI WBCP_Advise(LPCONNECTIONPOINT iface,
128 LPUNKNOWN pUnkSink, DWORD *pdwCookie)
130 FIXME("stub: IUnknown = %p, connection cookie = %ld\n", pUnkSink, *pdwCookie);
132 static int new_cookie;
134 FIXME("stub: IUnknown = %p, connection cookie = %ld\n", pUnkSink, *pdwCookie);
135 *pdwCookie = ++new_cookie;
136 TRACE ("Returning cookie = %ld\n", *pdwCookie);
142 /* Disconnect this implementation from the connection point. */
143 static HRESULT WINAPI WBCP_Unadvise(LPCONNECTIONPOINT iface,
146 FIXME("stub: cookie to disconnect = %ld\n", dwCookie);
150 /* Get a list of connections in this connection point. */
151 static HRESULT WINAPI WBCP_EnumConnections(LPCONNECTIONPOINT iface,
152 LPENUMCONNECTIONS *ppEnum)
154 FIXME("stub: IEnumConnections = %p\n", *ppEnum);
158 /**********************************************************************
159 * IConnectionPoint virtual function table for IE Web Browser component
162 static ICOM_VTABLE(IConnectionPoint) WBCP_Vtbl =
164 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
168 WBCP_GetConnectionInterface,
169 WBCP_GetConnectionPointContainer,
175 /***************************************************************************
177 * new/delete CConnectionPointImpl
181 static void CConnectionPointImpl_Destructor(IUnknown* iface)
183 CConnectionPointImpl_THIS(iface,vfunk);
185 FIXME("(%p)\n",This);
190 HRESULT CConnectionPointImpl_AllocObj(IUnknown* punkOuter,void** ppobj)
192 CConnectionPointImpl* This;
194 This = (CConnectionPointImpl*)COMIMPL_AllocObj( sizeof(CConnectionPointImpl) );
195 if ( This == NULL ) return E_OUTOFMEMORY;
196 COMIMPL_IUnkInit( &This->vfunk, punkOuter );
197 This->vfunk.pEntries = IFEntries;
198 This->vfunk.dwEntries = sizeof(IFEntries)/sizeof(IFEntries[0]);
199 This->vfunk.pOnFinalRelease = CConnectionPointImpl_Destructor;
201 ICOM_VTBL(&This->vfcpoint) = &WBCP_Vtbl;