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