]> git.sesse.net Git - vlc/blob - activex/vlccontrol.h
bf6004721790bc0a6f9a83bf3136363c83efe4fe
[vlc] / activex / vlccontrol.h
1 /*****************************************************************************\r
2  * vlccontrol.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 _VLCCONTROL_H_\r
24 #define _VLCCONTROL_H_\r
25 \r
26 #include <oaidl.h>\r
27 #include "axvlc_idl.h"\r
28 \r
29 class VLCControl : public IVLCControl\r
30 {\r
31     \r
32 public:\r
33 \r
34     VLCControl(VLCPlugin *p_instance) :  _p_instance(p_instance), _p_typeinfo(NULL) {};\r
35     virtual ~VLCControl();\r
36 \r
37     // IUnknown methods\r
38     STDMETHODIMP QueryInterface(REFIID riid, void **ppv)\r
39     {\r
40         if( (NULL != ppv)\r
41          && (IID_IUnknown == riid)\r
42          && (IID_IDispatch == riid)\r
43          && (IID_IVLCControl == riid) ) {\r
44             AddRef();\r
45             *ppv = dynamic_cast<LPVOID>(this);\r
46             return NOERROR;\r
47         }\r
48         return _p_instance->QueryInterface(riid, ppv);\r
49     };\r
50 \r
51     STDMETHODIMP_(ULONG) AddRef(void) { return _p_instance->AddRef(); };\r
52     STDMETHODIMP_(ULONG) Release(void) { return _p_instance->Release(); };\r
53 \r
54     // IDispatch methods\r
55     STDMETHODIMP GetTypeInfoCount(UINT*);\r
56     STDMETHODIMP GetTypeInfo(UINT, LCID, LPTYPEINFO*);\r
57     STDMETHODIMP GetIDsOfNames(REFIID,LPOLESTR*,UINT,LCID,DISPID*);\r
58     STDMETHODIMP Invoke(DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*);\r
59 \r
60     // IVLCControl methods\r
61     STDMETHODIMP get_Value(VARIANT *pvarValue);\r
62     STDMETHODIMP put_Value(VARIANT pvarValue);\r
63     STDMETHODIMP play(void);\r
64     STDMETHODIMP get_Visible(VARIANT_BOOL *visible);\r
65     STDMETHODIMP put_Visible(VARIANT_BOOL visible);\r
66     STDMETHODIMP pause(void);\r
67     STDMETHODIMP stop(void);\r
68     STDMETHODIMP get_Playing(VARIANT_BOOL *isPlaying);\r
69     STDMETHODIMP put_Playing(VARIANT_BOOL isPlaying);\r
70     STDMETHODIMP get_Position(float *position);\r
71     STDMETHODIMP put_Position(float position);\r
72     STDMETHODIMP get_Time(int *seconds);\r
73     STDMETHODIMP put_Time(int seconds);\r
74     STDMETHODIMP shuttle(int seconds);\r
75     STDMETHODIMP fullscreen();\r
76     STDMETHODIMP get_Length(int *seconds);\r
77     STDMETHODIMP playFaster(void);\r
78     STDMETHODIMP playSlower(void);\r
79     STDMETHODIMP get_Volume(int *volume);\r
80     STDMETHODIMP put_Volume(int volume);\r
81     STDMETHODIMP toggleMute(void);\r
82     STDMETHODIMP addTarget( BSTR uri, VARIANT options, enum VLCPlaylistMode mode, int position);\r
83     STDMETHODIMP get_PlaylistIndex(int *index);\r
84     STDMETHODIMP get_PlaylistCount(int *count);\r
85     STDMETHODIMP playlistNext(void);\r
86     STDMETHODIMP playlistPrev(void);\r
87     STDMETHODIMP playlistClear(void);\r
88     STDMETHODIMP get_VersionInfo(BSTR *version);\r
89  \r
90 private:\r
91 \r
92     HRESULT      getTypeInfo();\r
93 \r
94     VLCPlugin *_p_instance;\r
95     ITypeInfo *_p_typeinfo;\r
96 \r
97 };\r
98  \r
99 #endif\r
100 \r