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 INCLUDED_EXTENSIONS_SOURCE_ACTIVEX_SOCOMWINDOWPEER_H
23 #define INCLUDED_EXTENSIONS_SOURCE_ACTIVEX_SOCOMWINDOWPEER_H
37 #pragma clang diagnostic push
38 #pragma clang diagnostic ignored "-Wnon-virtual-dtor"
40 #include <so_activex.h>
42 #pragma clang diagnostic pop
47 class SOComWindowPeer
:
48 public IDispatchImpl
<ISOComWindowPeer
, &IID_ISOComWindowPeer
, &LIBID_SO_ACTIVEXLib
>,
49 public ISupportErrorInfo
,
50 public CComObjectRoot
,
51 public CComCoClass
<SOComWindowPeer
,&CLSID_SOComWindowPeer
>
55 SOComWindowPeer() : m_hwnd( nullptr ) {}
56 virtual ~SOComWindowPeer() { }
58 BEGIN_COM_MAP(SOComWindowPeer
)
59 COM_INTERFACE_ENTRY(IDispatch
)
60 COM_INTERFACE_ENTRY(ISOComWindowPeer
)
61 COM_INTERFACE_ENTRY(ISupportErrorInfo
)
63 #pragma clang diagnostic push
64 #pragma clang diagnostic ignored "-Winconsistent-missing-override"
68 #pragma clang diagnostic pop
70 DECLARE_NOT_AGGREGATABLE(SOComWindowPeer
)
71 // Remove the comment from the line above if you don't want your object to
72 // support aggregation.
74 DECLARE_REGISTRY_RESOURCEID(IDR_SOCOMWINDOWPEER
)
77 STDMETHOD(InterfaceSupportsErrorInfo
)(REFIID riid
) override
;
80 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
getWindowHandle(
81 /* [in] */ SAFEARRAY __RPC_FAR
* /*procId*/,
82 /* [in] */ short /*s*/,
83 /* [retval][out] */ long __RPC_FAR
*ret
) override
85 *ret
= HandleToLong( m_hwnd
);
89 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
getToolkit(
90 /* [retval][out] */ IDispatch __RPC_FAR
*__RPC_FAR
*retVal
) override
96 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
setPointer(
97 /* [in] */ IDispatch __RPC_FAR
* /*xPointer*/) override
102 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
setBackground(
103 /* [in] */ int /*nColor*/) override
108 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
invalidate(
109 /* [in] */ short /*__MIDL_0015*/) override
114 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
invalidateRect(
115 /* [in] */ IDispatch __RPC_FAR
* /*aRect*/,
116 /* [in] */ short /*nFlags*/) override
121 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
dispose( void) override
126 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
addEventListener(
127 /* [in] */ IDispatch __RPC_FAR
* /*xListener*/) override
132 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
removeEventListener(
133 /* [in] */ IDispatch __RPC_FAR
* /*xListener*/) override
138 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE
get_Bridge_implementedInterfaces(
139 /* [retval][out] */ SAFEARRAY __RPC_FAR
* __RPC_FAR
*pVal
) override
141 *pVal
= SafeArrayCreateVector( VT_BSTR
, 0, 2 );
147 CComBSTR
aInterface( OLESTR( "com.sun.star.awt.XSystemDependentWindowPeer" ) );
148 SafeArrayPutElement( *pVal
, &ix
, aInterface
);
151 aInterface
= CComBSTR( OLESTR( "com.sun.star.awt.XWindowPeer" ) );
152 SafeArrayPutElement( *pVal
, &ix
, aInterface
);
157 void SetHWNDInternally( HWND hwnd
) { m_hwnd
= hwnd
; }
162 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */