1 /*****************************************************************************
2 * connectioncontainer.h: ActiveX control for VLC
3 *****************************************************************************
4 * Copyright (C) 2005 VideoLAN (Centrale Réseaux) and its contributors
6 * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program 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
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
21 *****************************************************************************/
23 #ifndef __CONNECTIONCONTAINER_H__
24 #define __CONNECTIONCONTAINER_H__
31 class VLCConnectionPoint : public IConnectionPoint
36 VLCConnectionPoint(IConnectionPointContainer *p_cpc, REFIID iid) :
37 _iid(iid), _p_cpc(p_cpc) {};
38 virtual ~VLCConnectionPoint() {};
41 STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
43 if( NULL == ppv ) return E_POINTER;
44 if( (IID_IUnknown == riid)
45 && (IID_IConnectionPoint == riid) ) {
47 *ppv = reinterpret_cast<LPVOID>(this);
50 // must be a standalone object
54 STDMETHODIMP_(ULONG) AddRef(void) { return _p_cpc->AddRef(); };
55 STDMETHODIMP_(ULONG) Release(void) { return _p_cpc->Release(); };
57 // IConnectionPoint methods
58 STDMETHODIMP GetConnectionInterface(IID *);
59 STDMETHODIMP GetConnectionPointContainer(LPCONNECTIONPOINTCONTAINER *);
60 STDMETHODIMP Advise(IUnknown *, DWORD *);
61 STDMETHODIMP Unadvise(DWORD);
62 STDMETHODIMP EnumConnections(LPENUMCONNECTIONS *);
64 void fireEvent(DISPID dispIdMember, DISPPARAMS* pDispParams);
65 void firePropChangedEvent(DISPID dispId);
70 IConnectionPointContainer *_p_cpc;
71 vector<CONNECTDATA> _connections;
74 //////////////////////////////////////////////////////////////////////////
76 class VLCConnectionPointContainer : public IConnectionPointContainer
81 VLCConnectionPointContainer(VLCPlugin *p_instance);
82 virtual ~VLCConnectionPointContainer();
85 STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
88 && (IID_IUnknown == riid)
89 && (IID_IConnectionPointContainer == riid) ) {
91 *ppv = reinterpret_cast<LPVOID>(this);
94 return _p_instance->QueryInterface(riid, ppv);
97 STDMETHODIMP_(ULONG) AddRef(void) { return _p_instance->AddRef(); };
98 STDMETHODIMP_(ULONG) Release(void) { return _p_instance->Release(); };
100 // IConnectionPointContainer methods
101 STDMETHODIMP EnumConnectionPoints(LPENUMCONNECTIONPOINTS *);
102 STDMETHODIMP FindConnectionPoint(REFIID, LPCONNECTIONPOINT *);
104 void fireEvent(DISPID, DISPPARAMS*);
105 void firePropChangedEvent(DISPID dispId);
109 VLCPlugin *_p_instance;
110 VLCConnectionPoint *_p_events;
111 VLCConnectionPoint *_p_props;
112 vector<LPCONNECTIONPOINT> _v_cps;