bump product version to 6.3.0.0.beta1
[LibreOffice.git] / extensions / source / activex / SOComWindowPeer.h
blobb06f2efbdd67d4ec61940a668cb8344cc6a854f5
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 INCLUDED_EXTENSIONS_SOURCE_ACTIVEX_SOCOMWINDOWPEER_H
23 #define INCLUDED_EXTENSIONS_SOURCE_ACTIVEX_SOCOMWINDOWPEER_H
25 #ifdef _MSC_VER
26 #pragma once
27 #endif
29 #include "resource.h"
30 #include <ExDispID.h>
31 #include <ExDisp.h>
32 #include <shlguid.h>
34 #include <atlctl.h>
36 #if defined __clang__
37 #pragma clang diagnostic push
38 #pragma clang diagnostic ignored "-Wnon-virtual-dtor"
39 #endif
40 #include <so_activex.h>
41 #if defined __clang__
42 #pragma clang diagnostic pop
43 #endif
45 // SOComWindowPeer
47 class SOComWindowPeer :
48 public IDispatchImpl<ISOComWindowPeer, &IID_ISOComWindowPeer, &LIBID_SO_ACTIVEXLib>,
49 public ISupportErrorInfo,
50 public CComObjectRoot,
51 public CComCoClass<SOComWindowPeer,&CLSID_SOComWindowPeer>
53 HWND m_hwnd;
54 public:
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)
62 #if defined __clang__
63 #pragma clang diagnostic push
64 #pragma clang diagnostic ignored "-Winconsistent-missing-override"
65 #endif
66 END_COM_MAP()
67 #if defined __clang__
68 #pragma clang diagnostic pop
69 #endif
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)
76 // ISupportsErrorInfo
77 STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid) override;
79 // ISOComWindowPeer
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 );
86 return S_OK;
89 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getToolkit(
90 /* [retval][out] */ IDispatch __RPC_FAR *__RPC_FAR *retVal) override
92 *retVal = nullptr;
93 return S_OK;
96 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setPointer(
97 /* [in] */ IDispatch __RPC_FAR* /*xPointer*/) override
99 return S_OK;
102 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setBackground(
103 /* [in] */ int /*nColor*/) override
105 return S_OK;
108 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE invalidate(
109 /* [in] */ short /*__MIDL_0015*/) override
111 return S_OK;
114 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE invalidateRect(
115 /* [in] */ IDispatch __RPC_FAR* /*aRect*/,
116 /* [in] */ short /*nFlags*/) override
118 return S_OK;
121 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE dispose( void) override
123 return S_OK;
126 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE addEventListener(
127 /* [in] */ IDispatch __RPC_FAR* /*xListener*/) override
129 return S_OK;
132 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE removeEventListener(
133 /* [in] */ IDispatch __RPC_FAR* /*xListener*/) override
135 return S_OK;
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 );
143 if( !*pVal )
144 return E_FAIL;
146 long ix = 0;
147 CComBSTR aInterface( OLESTR( "com.sun.star.awt.XSystemDependentWindowPeer" ) );
148 SafeArrayPutElement( *pVal, &ix, aInterface );
150 ix = 1;
151 aInterface = CComBSTR( OLESTR( "com.sun.star.awt.XWindowPeer" ) );
152 SafeArrayPutElement( *pVal, &ix, aInterface );
154 return S_OK;
157 void SetHWNDInternally( HWND hwnd ) { m_hwnd = hwnd; }
160 #endif
162 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */