]> git.sesse.net Git - vlc/blob - activex/olecontrol.h
7173105b1511dd496d1066c3f558d2ced6bc7eda
[vlc] / activex / olecontrol.h
1 /*****************************************************************************\r
2  * olecontrol.h: ActiveX control for VLC\r
3  *****************************************************************************\r
4  * Copyright (C) 2005 VideoLAN\r
5  *\r
6  * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>\r
7  *\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
12  *\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
17  *\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
22 \r
23 #ifndef __OLECONTROL_H__\r
24 #define __OLECONTROL_H__\r
25 \r
26 #include <olectl.h>\r
27 \r
28 class VLCOleControl : public IOleControl\r
29 {\r
30 \r
31 public:\r
32 \r
33     VLCOleControl(VLCPlugin *p_instance) : _p_instance(p_instance) {};\r
34     virtual ~VLCOleControl() {};\r
35 \r
36     // IUnknown methods\r
37     STDMETHODIMP QueryInterface(REFIID riid, void **ppv)\r
38     {\r
39         if( (NULL != ppv)\r
40          && (IID_IUnknown == riid)\r
41          && (IID_IOleControl == riid) ) \r
42         {\r
43             AddRef();\r
44             *ppv = reinterpret_cast<LPVOID>(this);\r
45             return NOERROR;\r
46         }\r
47         return _p_instance->QueryInterface(riid, ppv);\r
48     };\r
49 \r
50     STDMETHODIMP_(ULONG) AddRef(void) { return _p_instance->AddRef(); };\r
51     STDMETHODIMP_(ULONG) Release(void) { return _p_instance->Release(); };\r
52 \r
53     // IOleControl methods\r
54     STDMETHODIMP GetControlInfo(CONTROLINFO *pCI);\r
55     STDMETHODIMP OnMnemonic(LPMSG pMsg);\r
56     STDMETHODIMP OnAmbientPropertyChange(DISPID dispID);\r
57     STDMETHODIMP FreezeEvents(BOOL bFreeze);\r
58 \r
59 private:\r
60 \r
61     VLCPlugin *_p_instance;\r
62 };\r
63 \r
64 #endif\r
65 \r