1 /*****************************************************************************
\r
2 * plugin.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 __PLUGIN_H__
\r
24 #define __PLUGIN_H__
\r
29 #include <vlc/vlc.h>
\r
31 extern const GUID CLSID_VLCPlugin;
\r
32 extern const GUID LIBID_AXVLC;
\r
33 extern const GUID DIID_DVLCEvents;
\r
35 class VLCPluginClass : public IClassFactory
\r
40 VLCPluginClass(LONG *p_class_ref,HINSTANCE hInstance);
\r
42 /* IUnknown methods */
\r
43 STDMETHODIMP QueryInterface(REFIID riid, void **ppv);
\r
44 STDMETHODIMP_(ULONG) AddRef(void);
\r
45 STDMETHODIMP_(ULONG) Release(void);
\r
47 /* IClassFactory methods */
\r
48 STDMETHODIMP CreateInstance(IUnknown *pUnkOuter, REFIID riid, void **ppv);
\r
49 STDMETHODIMP LockServer(BOOL fLock);
\r
51 LPCSTR getInPlaceWndClassName(void) const { return TEXT("VLC Plugin In-Place"); };
\r
52 LPCSTR getVideoWndClassName(void) const { return TEXT("VLC Plugin Video"); };
\r
53 HINSTANCE getHInstance(void) const { return _hinstance; };
\r
54 HBITMAP getInPlacePict(void) const { return _inplace_hbitmap; };
\r
58 virtual ~VLCPluginClass();
\r
62 LPLONG _p_class_ref;
\r
63 HINSTANCE _hinstance;
\r
64 ATOM _inplace_wndclass_atom;
\r
65 ATOM _video_wndclass_atom;
\r
66 HBITMAP _inplace_hbitmap;
\r
69 class VLCPlugin : public IUnknown
\r
74 VLCPlugin(VLCPluginClass *p_class);
\r
76 /* IUnknown methods */
\r
77 STDMETHODIMP QueryInterface(REFIID riid, void **ppv);
\r
78 STDMETHODIMP_(ULONG) AddRef(void);
\r
79 STDMETHODIMP_(ULONG) Release(void);
\r
81 /* custom methods */
\r
82 HRESULT getTypeLib(LCID lcid, ITypeLib **pTL)
\r
83 { return LoadRegTypeLib(LIBID_AXVLC, 1, 0, lcid, pTL); };
\r
84 REFCLSID getClassID(void) { return (REFCLSID)CLSID_VLCPlugin; };
\r
85 REFIID getDispEventID(void) { return (REFIID)DIID_DVLCEvents; };
\r
87 HRESULT onInitNew(void);
\r
88 HRESULT onClose(DWORD dwSaveOption);
\r
90 BOOL isInPlaceActive(void);
\r
91 HRESULT onActivateInPlace(LPMSG lpMesg, HWND hwndParent, LPCRECT lprcPosRect, LPCRECT lprcClipRect);
\r
92 HRESULT onInPlaceDeactivate(void);
\r
93 HWND getInPlaceWindow(void) const { return _inplacewnd; };
\r
95 BOOL hasFocus(void);
\r
96 void setFocus(BOOL fFocus);
\r
98 UINT getCodePage(void) { return _codepage; };
\r
99 void setCodePage(UINT cp) { _codepage = cp; };
\r
101 int getVLCObject(void) { return _i_vlc; };
\r
103 // control properties
\r
104 void setSourceURL(const char *url) { _psz_src = strdup(url); };
\r
105 void setAutoStart(BOOL autostart) { _b_autostart = autostart; };
\r
106 void setLoopMode(BOOL loopmode) { _b_loopmode = loopmode; };
\r
107 void setMute(BOOL mute) {
\r
108 if( mute && _i_vlc )
\r
110 VLC_VolumeMute(_i_vlc);
\r
113 void setSendEvents(BOOL sendevents) { _b_sendevents = sendevents; };
\r
114 void setVisible(BOOL fVisible);
\r
115 BOOL getVisible(void) { return _b_visible; };
\r
117 // container events
\r
118 void onPositionChange(LPCRECT lprcPosRect, LPCRECT lprcClipRect);
\r
119 void onPaint(PAINTSTRUCT &ps, RECT &pr);
\r
122 void firePropChangedEvent(DISPID dispid);
\r
123 void fireOnPlayEvent(void);
\r
124 void fireOnPauseEvent(void);
\r
125 void fireOnStopEvent(void);
\r
129 virtual ~VLCPlugin();
\r
133 void calcPositionChange(LPRECT lprPosRect, LPCRECT lprcClipRect);
\r
135 //implemented interfaces
\r
136 class VLCOleObject *vlcOleObject;
\r
137 class VLCOleControl *vlcOleControl;
\r
138 class VLCOleInPlaceObject *vlcOleInPlaceObject;
\r
139 class VLCOleInPlaceActiveObject *vlcOleInPlaceActiveObject;
\r
140 class VLCPersistStreamInit *vlcPersistStreamInit;
\r
141 class VLCPersistStorage *vlcPersistStorage;
\r
142 class VLCPersistPropertyBag *vlcPersistPropertyBag;
\r
143 class VLCProvideClassInfo *vlcProvideClassInfo;
\r
144 class VLCConnectionPointContainer *vlcConnectionPointContainer;
\r
145 class VLCObjectSafety *vlcObjectSafety;
\r
146 class VLCControl *vlcControl;
\r
148 // in place activated window (Clipping window)
\r
150 // video window (Drawing window)
\r
154 VLCPluginClass *_p_class;
\r
162 BOOL _b_sendevents;
\r