]> git.sesse.net Git - vlc/blob - activex/vlccontrol.h
- all: fixed object interfaces queries and other fixes as reported by Jacob Lewallen
[vlc] / activex / vlccontrol.h
1 /*****************************************************************************
2  * vlccontrol.h: ActiveX control for VLC
3  *****************************************************************************
4  * Copyright (C) 2005 the VideoLAN team
5  *
6  * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
7  *
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.
12  *
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.
17  *
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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
21  *****************************************************************************/
22
23 #ifndef _VLCCONTROL_H_
24 #define _VLCCONTROL_H_
25
26 #include <oaidl.h>
27 #include "axvlc_idl.h"
28
29 class VLCControl : public IVLCControl
30 {
31     
32 public:
33
34     VLCControl(VLCPlugin *p_instance) :  _p_instance(p_instance), _p_typeinfo(NULL) {};
35     virtual ~VLCControl();
36
37     // IUnknown methods
38     STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
39     {
40         if( NULL == ppv )
41           return E_POINTER;
42         if( (IID_IUnknown == riid)
43          || (IID_IDispatch == riid)
44          || (IID_IVLCControl == riid) )
45         {
46             AddRef();
47             *ppv = reinterpret_cast<LPVOID>(this);
48             return NOERROR;
49         }
50         return _p_instance->pUnkOuter->QueryInterface(riid, ppv);
51     };
52
53     STDMETHODIMP_(ULONG) AddRef(void) { return _p_instance->pUnkOuter->AddRef(); };
54     STDMETHODIMP_(ULONG) Release(void) { return _p_instance->pUnkOuter->Release(); };
55
56     // IDispatch methods
57     STDMETHODIMP GetTypeInfoCount(UINT*);
58     STDMETHODIMP GetTypeInfo(UINT, LCID, LPTYPEINFO*);
59     STDMETHODIMP GetIDsOfNames(REFIID,LPOLESTR*,UINT,LCID,DISPID*);
60     STDMETHODIMP Invoke(DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*);
61
62     // IVLCControl methods
63     STDMETHODIMP play(void);
64     STDMETHODIMP get_Visible(VARIANT_BOOL *visible);
65     STDMETHODIMP put_Visible(VARIANT_BOOL visible);
66     STDMETHODIMP pause(void);
67     STDMETHODIMP stop(void);
68     STDMETHODIMP get_Playing(VARIANT_BOOL *isPlaying);
69     STDMETHODIMP get_Position(float *position);
70     STDMETHODIMP put_Position(float position);
71     STDMETHODIMP get_Time(int *seconds);
72     STDMETHODIMP put_Time(int seconds);
73     STDMETHODIMP shuttle(int seconds);
74     STDMETHODIMP fullscreen();
75     STDMETHODIMP get_Length(int *seconds);
76     STDMETHODIMP playFaster(void);
77     STDMETHODIMP playSlower(void);
78     STDMETHODIMP get_Volume(int *volume);
79     STDMETHODIMP put_Volume(int volume);
80     STDMETHODIMP toggleMute(void);
81     STDMETHODIMP setVariable( BSTR name, VARIANT value);
82     STDMETHODIMP getVariable( BSTR name, VARIANT *value);
83     STDMETHODIMP addTarget( BSTR uri, VARIANT options, enum VLCPlaylistMode mode, int position);
84     STDMETHODIMP get_PlaylistIndex(int *index);
85     STDMETHODIMP get_PlaylistCount(int *count);
86     STDMETHODIMP playlistNext(void);
87     STDMETHODIMP playlistPrev(void);
88     STDMETHODIMP playlistClear(void);
89     STDMETHODIMP get_VersionInfo(BSTR *version);
90     STDMETHODIMP get_MRL(BSTR *mrl);
91     STDMETHODIMP put_MRL(BSTR mrl);
92     STDMETHODIMP get_AutoLoop(VARIANT_BOOL *autoloop);
93     STDMETHODIMP put_AutoLoop(VARIANT_BOOL autoloop);
94     STDMETHODIMP get_AutoPlay(VARIANT_BOOL *autoplay);
95     STDMETHODIMP put_AutoPlay(VARIANT_BOOL autoplay);
96  
97 private:
98
99     HRESULT      getTypeInfo();
100
101     VLCPlugin *_p_instance;
102     ITypeInfo *_p_typeinfo;
103
104 };
105  
106 #endif
107