]> git.sesse.net Git - vlc/blob - activex/oleinplaceobject.h
96a91f81e4cb9eff29ae01eea71262014c1e771c
[vlc] / activex / oleinplaceobject.h
1 /*****************************************************************************\r
2  * oleinplaceobject.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 __OLEINPLACEOBJECT_H__\r
24 #define __OLEINPLACEOBJECT_H__\r
25 \r
26 class VLCOleInPlaceObject : public IOleInPlaceObject\r
27 {\r
28 \r
29 public:\r
30 \r
31     VLCOleInPlaceObject(VLCPlugin *p_instance) : _p_instance(p_instance) {};\r
32     virtual ~VLCOleInPlaceObject() {};\r
33 \r
34     // IUnknown methods\r
35     STDMETHODIMP QueryInterface(REFIID riid, void **ppv)\r
36     {\r
37         if( (NULL != ppv)\r
38          && (IID_IUnknown == riid)\r
39          && (IID_IOleWindow == riid)\r
40          && (IID_IOleInPlaceObject == riid) ) \r
41         {\r
42             AddRef();\r
43             *ppv = reinterpret_cast<LPVOID>(this);\r
44             return NOERROR;\r
45         }\r
46         return _p_instance->QueryInterface(riid, ppv);\r
47     };\r
48 \r
49     STDMETHODIMP_(ULONG) AddRef(void) { return _p_instance->AddRef(); };\r
50     STDMETHODIMP_(ULONG) Release(void) { return _p_instance->Release(); };\r
51 \r
52     // IOleWindow methods\r
53     STDMETHODIMP GetWindow(HWND *);\r
54     STDMETHODIMP ContextSensitiveHelp(BOOL);\r
55 \r
56     // IOleInPlaceObject methods\r
57     STDMETHODIMP InPlaceDeactivate(void);\r
58     STDMETHODIMP UIDeactivate(void);\r
59     STDMETHODIMP SetObjectRects(LPCRECT, LPCRECT);\r
60     STDMETHODIMP ReactivateAndUndo(void);\r
61 \r
62 private:\r
63 \r
64     VLCPlugin *_p_instance;\r
65 };\r
66 \r
67 #endif\r
68 \r