1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_
29 #include "resource.h" // main symbols
36 #include "so_activex.h"
38 /////////////////////////////////////////////////////////////////////////////
41 class SOComWindowPeer
:
42 public IDispatchImpl
<ISOComWindowPeer
, &IID_ISOComWindowPeer
, &LIBID_SO_ACTIVEXLib
>,
43 public ISupportErrorInfo
,
44 public CComObjectRoot
,
45 public CComCoClass
<SOComWindowPeer
,&CLSID_SOComWindowPeer
>
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
)
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
)
64 STDMETHOD(InterfaceSupportsErrorInfo
)(REFIID riid
);
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
);
76 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
getToolkit(
77 /* [retval][out] */ IDispatch __RPC_FAR
*__RPC_FAR
*retVal
)
83 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
setPointer(
84 /* [in] */ IDispatch __RPC_FAR
* /*xPointer*/)
89 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
setBackground(
90 /* [in] */ int /*nColor*/)
95 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
invalidate(
96 /* [in] */ short /*__MIDL_0015*/)
101 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
invalidateRect(
102 /* [in] */ IDispatch __RPC_FAR
* /*aRect*/,
103 /* [in] */ short /*nFlags*/)
108 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
dispose( void)
113 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
addEventListener(
114 /* [in] */ IDispatch __RPC_FAR
* /*xListener*/)
119 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
removeEventListener(
120 /* [in] */ IDispatch __RPC_FAR
* /*xListener*/)
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 );
134 CComBSTR
aInterface( OLESTR( "com.sun.star.awt.XSystemDependentWindowPeer" ) );
135 SafeArrayPutElement( *pVal
, &ix
, aInterface
);
138 aInterface
= CComBSTR( OLESTR( "com.sun.star.awt.XWindowPeer" ) );
139 SafeArrayPutElement( *pVal
, &ix
, aInterface
);
144 void SetHWNDInternally( HWND hwnd
) { m_hwnd
= hwnd
; }
147 #endif // __SOCOMWINDOWPEER_H_
149 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */