bump product version to 4.1.6.2
[LibreOffice.git] / extensions / source / activex / SOComWindowPeer.h
blob9816ad33bde9468e715ba1504162cd3511fb7cca
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 // SOComWindowPeer.h: Definition of the SOComWindowPeer class
22 #ifndef __SOCOMWINDOWPEER_H_
23 #define __SOCOMWINDOWPEER_H_
25 #ifdef _MSC_VER
26 #pragma once
27 #endif
29 #include "resource.h" // main symbols
30 #include <ExDispID.h>
31 #include <ExDisp.h>
32 #include <shlguid.h>
34 #include <atlctl.h>
36 #include "so_activex.h"
38 /////////////////////////////////////////////////////////////////////////////
39 // SOComWindowPeer
41 class SOComWindowPeer :
42 public IDispatchImpl<ISOComWindowPeer, &IID_ISOComWindowPeer, &LIBID_SO_ACTIVEXLib>,
43 public ISupportErrorInfo,
44 public CComObjectRoot,
45 public CComCoClass<SOComWindowPeer,&CLSID_SOComWindowPeer>
47 HWND m_hwnd;
48 public:
49 SOComWindowPeer() : m_hwnd( NULL ) {}
50 virtual ~SOComWindowPeer() { }
52 BEGIN_COM_MAP(SOComWindowPeer)
53 COM_INTERFACE_ENTRY(IDispatch)
54 COM_INTERFACE_ENTRY(ISOComWindowPeer)
55 COM_INTERFACE_ENTRY(ISupportErrorInfo)
56 END_COM_MAP()
57 DECLARE_NOT_AGGREGATABLE(SOComWindowPeer)
58 // Remove the comment from the line above if you don't want your object to
59 // support aggregation.
61 DECLARE_REGISTRY_RESOURCEID(IDR_SOCOMWINDOWPEER)
63 // ISupportsErrorInfo
64 STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
66 // ISOComWindowPeer
67 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getWindowHandle(
68 /* [in] */ SAFEARRAY __RPC_FAR * /*procId*/,
69 /* [in] */ short /*s*/,
70 /* [retval][out] */ long __RPC_FAR *ret)
72 *ret = HandleToLong( m_hwnd );
73 return S_OK;
76 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getToolkit(
77 /* [retval][out] */ IDispatch __RPC_FAR *__RPC_FAR *retVal)
79 *retVal = NULL;
80 return S_OK;
83 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setPointer(
84 /* [in] */ IDispatch __RPC_FAR* /*xPointer*/)
86 return S_OK;
89 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setBackground(
90 /* [in] */ int /*nColor*/)
92 return S_OK;
95 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE invalidate(
96 /* [in] */ short /*__MIDL_0015*/)
98 return S_OK;
101 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE invalidateRect(
102 /* [in] */ IDispatch __RPC_FAR* /*aRect*/,
103 /* [in] */ short /*nFlags*/)
105 return S_OK;
108 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE dispose( void)
110 return S_OK;
113 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE addEventListener(
114 /* [in] */ IDispatch __RPC_FAR* /*xListener*/)
116 return S_OK;
119 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE removeEventListener(
120 /* [in] */ IDispatch __RPC_FAR* /*xListener*/)
122 return S_OK;
125 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Bridge_implementedInterfaces(
126 /* [retval][out] */ SAFEARRAY __RPC_FAR * __RPC_FAR *pVal)
128 *pVal = SafeArrayCreateVector( VT_BSTR, 0, 2 );
130 if( !*pVal )
131 return E_FAIL;
133 long ix = 0;
134 CComBSTR aInterface( OLESTR( "com.sun.star.awt.XSystemDependentWindowPeer" ) );
135 SafeArrayPutElement( *pVal, &ix, aInterface );
137 ix = 1;
138 aInterface = CComBSTR( OLESTR( "com.sun.star.awt.XWindowPeer" ) );
139 SafeArrayPutElement( *pVal, &ix, aInterface );
141 return S_OK;
144 void SetHWNDInternally( HWND hwnd ) { m_hwnd = hwnd; }
147 #endif // __SOCOMWINDOWPEER_H_
149 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */