Compile fix + handle case with no xml:base
[vlc.git] / activex / vlccontrol.h
blob79a30397eebb4b2da8e58755b65cadfc5239456d
1 /*****************************************************************************
2 * vlccontrol.h: ActiveX control for VLC
3 *****************************************************************************
4 * Copyright (C) 2005 the VideoLAN team
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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
21 *****************************************************************************/
23 #ifndef _VLCCONTROL_H_
24 #define _VLCCONTROL_H_
26 #include "axvlc_idl.h"
28 class VLCControl : public IVLCControl
31 public:
33 VLCControl(VLCPlugin *p_instance) : _p_instance(p_instance), _p_typeinfo(NULL) {};
34 virtual ~VLCControl();
36 // IUnknown methods
37 STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
39 if( NULL == ppv )
40 return E_POINTER;
41 if( (IID_IUnknown == riid)
42 || (IID_IDispatch == riid)
43 || (IID_IVLCControl == riid) )
45 AddRef();
46 *ppv = reinterpret_cast<LPVOID>(this);
47 return NOERROR;
49 return _p_instance->pUnkOuter->QueryInterface(riid, ppv);
52 STDMETHODIMP_(ULONG) AddRef(void) { return _p_instance->pUnkOuter->AddRef(); };
53 STDMETHODIMP_(ULONG) Release(void) { return _p_instance->pUnkOuter->Release(); };
55 // IDispatch methods
56 STDMETHODIMP GetTypeInfoCount(UINT*);
57 STDMETHODIMP GetTypeInfo(UINT, LCID, LPTYPEINFO*);
58 STDMETHODIMP GetIDsOfNames(REFIID,LPOLESTR*,UINT,LCID,DISPID*);
59 STDMETHODIMP Invoke(DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*);
61 // IVLCControl methods
62 STDMETHODIMP play(void);
63 STDMETHODIMP get_Visible(VARIANT_BOOL *visible);
64 STDMETHODIMP put_Visible(VARIANT_BOOL visible);
65 STDMETHODIMP pause(void);
66 STDMETHODIMP stop(void);
67 STDMETHODIMP get_Playing(VARIANT_BOOL *isPlaying);
68 STDMETHODIMP get_Position(float *position);
69 STDMETHODIMP put_Position(float position);
70 STDMETHODIMP get_Time(int *seconds);
71 STDMETHODIMP put_Time(int seconds);
72 STDMETHODIMP shuttle(int seconds);
73 STDMETHODIMP fullscreen();
74 STDMETHODIMP get_Length(int *seconds);
75 STDMETHODIMP playFaster(void);
76 STDMETHODIMP playSlower(void);
77 STDMETHODIMP get_Volume(int *volume);
78 STDMETHODIMP put_Volume(int volume);
79 STDMETHODIMP toggleMute(void);
80 STDMETHODIMP setVariable( BSTR name, VARIANT value);
81 STDMETHODIMP getVariable( BSTR name, VARIANT *value);
82 STDMETHODIMP addTarget( BSTR uri, VARIANT options, enum VLCPlaylistMode mode, int position);
83 STDMETHODIMP get_PlaylistIndex(int *index);
84 STDMETHODIMP get_PlaylistCount(int *count);
85 STDMETHODIMP playlistNext(void);
86 STDMETHODIMP playlistPrev(void);
87 STDMETHODIMP playlistClear(void);
88 STDMETHODIMP get_VersionInfo(BSTR *version);
89 STDMETHODIMP get_MRL(BSTR *mrl);
90 STDMETHODIMP put_MRL(BSTR mrl);
91 STDMETHODIMP get_AutoLoop(VARIANT_BOOL *autoloop);
92 STDMETHODIMP put_AutoLoop(VARIANT_BOOL autoloop);
93 STDMETHODIMP get_AutoPlay(VARIANT_BOOL *autoplay);
94 STDMETHODIMP put_AutoPlay(VARIANT_BOOL autoplay);
96 static HRESULT CreateTargetOptions(int codePage, VARIANT *options, char ***cOptions, int *cOptionCount);
97 static void FreeTargetOptions(char **cOptions, int cOptionCount);
99 private:
101 HRESULT getTypeInfo();
103 VLCPlugin *_p_instance;
104 ITypeInfo *_p_typeinfo;
108 #endif