bump product version to 6.3.0.0.beta1
[LibreOffice.git] / extensions / source / activex / SOActionsApproval.h
blobfd0c05331e891d4ef794391f403c4dcd3fc85fc0
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 // SOActionsApproval.h: Definition of the SOActionsApproval class
22 #ifndef INCLUDED_EXTENSIONS_SOURCE_ACTIVEX_SOACTIONSAPPROVAL_H
23 #define INCLUDED_EXTENSIONS_SOURCE_ACTIVEX_SOACTIONSAPPROVAL_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 // SOActionsApproval
47 class SOActionsApproval :
48 public IDispatchImpl<ISOActionsApproval, &IID_ISOActionsApproval, &LIBID_SO_ACTIVEXLib>,
49 public ISupportErrorInfo,
50 public CComObjectRoot,
51 public CComCoClass<SOActionsApproval,&CLSID_SOActionsApproval>
53 public:
54 SOActionsApproval() {}
55 virtual ~SOActionsApproval() {}
57 BEGIN_COM_MAP(SOActionsApproval)
58 COM_INTERFACE_ENTRY(IDispatch)
59 COM_INTERFACE_ENTRY(ISOActionsApproval)
60 COM_INTERFACE_ENTRY(ISupportErrorInfo)
61 #if defined __clang__
62 #pragma clang diagnostic push
63 #pragma clang diagnostic ignored "-Winconsistent-missing-override"
64 #endif
65 END_COM_MAP()
66 #if defined __clang__
67 #pragma clang diagnostic pop
68 #endif
69 DECLARE_NOT_AGGREGATABLE(SOActionsApproval)
70 // Remove the comment from the line above if you don't want your object to
71 // support aggregation.
73 DECLARE_REGISTRY_RESOURCEID(IDR_SODOCUMENTEVENTLISTENER)
75 // ISupportsErrorInfo
76 STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid) override;
78 // ISOActionsApproval
79 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE approveAction(
80 /* [in] */ long nActionID,
81 /* [retval][out] */ boolean *pbApproval) override
83 // only PreventClose is approved
84 USES_CONVERSION;
85 *pbApproval = ( nActionID == 1 );
87 return S_OK;
90 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Bridge_implementedInterfaces(
91 /* [retval][out] */ SAFEARRAY __RPC_FAR * __RPC_FAR *pVal) override
93 *pVal = SafeArrayCreateVector( VT_BSTR, 0, 1 );
95 if( !*pVal )
96 return E_FAIL;
98 long ix = 0;
99 CComBSTR aInterface( OLESTR( "com.sun.star.embed.XActionsApproval" ) );
100 SafeArrayPutElement( *pVal, &ix, aInterface );
102 return S_OK;
106 #endif // INCLUDED_EXTENSIONS_SOURCE_ACTIVEX_SOACTIONSAPPROVAL_H
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */