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
35 #include <so_activex.h>
39 class SOComWindowPeer
:
40 public IDispatchImpl
<ISOComWindowPeer
, &IID_ISOComWindowPeer
, &LIBID_SO_ACTIVEXLib
>,
41 public ISupportErrorInfo
,
42 public CComObjectRoot
,
43 public CComCoClass
<SOComWindowPeer
,&CLSID_SOComWindowPeer
>
47 SOComWindowPeer() : m_hwnd( nullptr ) {}
48 virtual ~SOComWindowPeer() { }
50 BEGIN_COM_MAP(SOComWindowPeer
)
51 COM_INTERFACE_ENTRY(IDispatch
)
52 COM_INTERFACE_ENTRY(ISOComWindowPeer
)
53 COM_INTERFACE_ENTRY(ISupportErrorInfo
)
55 #pragma clang diagnostic push
56 #pragma clang diagnostic ignored "-Winconsistent-missing-override"
60 #pragma clang diagnostic pop
62 DECLARE_NOT_AGGREGATABLE(SOComWindowPeer
)
63 // Remove the comment from the line above if you don't want your object to
64 // support aggregation.
66 DECLARE_REGISTRY_RESOURCEID(IDR_SOCOMWINDOWPEER
)
69 STDMETHOD(InterfaceSupportsErrorInfo
)(REFIID riid
) override
;
72 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
getWindowHandle(
73 /* [in] */ SAFEARRAY __RPC_FAR
* /*procId*/,
74 /* [in] */ short /*s*/,
75 /* [retval][out] */ long __RPC_FAR
*ret
) override
77 *ret
= HandleToLong( m_hwnd
);
81 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
getToolkit(
82 /* [retval][out] */ IDispatch __RPC_FAR
*__RPC_FAR
*retVal
) override
88 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
setPointer(
89 /* [in] */ IDispatch __RPC_FAR
* /*xPointer*/) override
94 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
setBackground(
95 /* [in] */ int /*nColor*/) override
100 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
invalidate(
101 /* [in] */ short /*__MIDL_0015*/) override
106 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
invalidateRect(
107 /* [in] */ IDispatch __RPC_FAR
* /*aRect*/,
108 /* [in] */ short /*nFlags*/) override
113 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
dispose( void) override
118 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
addEventListener(
119 /* [in] */ IDispatch __RPC_FAR
* /*xListener*/) override
124 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
removeEventListener(
125 /* [in] */ IDispatch __RPC_FAR
* /*xListener*/) override
130 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_Bridge_implementedInterfaces(
131 /* [retval][out] */ SAFEARRAY __RPC_FAR
* __RPC_FAR
*pVal
) override
133 *pVal
= SafeArrayCreateVector( VT_BSTR
, 0, 2 );
139 CComBSTR
aInterface( OLESTR( "com.sun.star.awt.XSystemDependentWindowPeer" ) );
140 SafeArrayPutElement( *pVal
, &ix
, aInterface
);
143 aInterface
= CComBSTR( OLESTR( "com.sun.star.awt.XWindowPeer" ) );
144 SafeArrayPutElement( *pVal
, &ix
, aInterface
);
149 void SetHWNDInternally( HWND hwnd
) { m_hwnd
= hwnd
; }
152 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */