tdf#154285 Check upper bound of arguments in SbRtl_Minute function
[LibreOffice.git] / extensions / source / activex / SOActionsApproval.h
blob9b8f4c1e992e75748b22b9beb52be3f8f0c2e28b
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 #pragma once
24 #ifdef _MSC_VER
25 #pragma once
26 #endif
28 #include "resource.h"
29 #include <ExDispID.h>
30 #include <ExDisp.h>
31 #include <shlguid.h>
33 #include <atlctl.h>
35 #include <so_activex.h>
37 // SOActionsApproval
39 class SOActionsApproval :
40 public IDispatchImpl<ISOActionsApproval, &IID_ISOActionsApproval, &LIBID_SO_ACTIVEXLib>,
41 public ISupportErrorInfo,
42 public CComObjectRoot,
43 public CComCoClass<SOActionsApproval,&CLSID_SOActionsApproval>
45 public:
46 SOActionsApproval() {}
47 virtual ~SOActionsApproval() {}
49 BEGIN_COM_MAP(SOActionsApproval)
50 COM_INTERFACE_ENTRY(IDispatch)
51 COM_INTERFACE_ENTRY(ISOActionsApproval)
52 COM_INTERFACE_ENTRY(ISupportErrorInfo)
53 #if defined __clang__
54 #pragma clang diagnostic push
55 #pragma clang diagnostic ignored "-Winconsistent-missing-override"
56 #endif
57 END_COM_MAP()
58 #if defined __clang__
59 #pragma clang diagnostic pop
60 #endif
61 DECLARE_NOT_AGGREGATABLE(SOActionsApproval)
62 // Remove the comment from the line above if you don't want your object to
63 // support aggregation.
65 DECLARE_REGISTRY_RESOURCEID(IDR_SODOCUMENTEVENTLISTENER)
67 // ISupportsErrorInfo
68 STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid) override;
70 // ISOActionsApproval
71 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE approveAction(
72 /* [in] */ long nActionID,
73 /* [retval][out] */ boolean *pbApproval) override
75 // only PreventClose is approved
76 USES_CONVERSION;
77 *pbApproval = ( nActionID == 1 );
79 return S_OK;
82 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Bridge_implementedInterfaces(
83 /* [retval][out] */ SAFEARRAY __RPC_FAR * __RPC_FAR *pVal) override
85 *pVal = SafeArrayCreateVector( VT_BSTR, 0, 1 );
87 if( !*pVal )
88 return E_FAIL;
90 LONG ix = 0;
91 CComBSTR aInterface( OLESTR( "com.sun.star.embed.XActionsApproval" ) );
92 SafeArrayPutElement( *pVal, &ix, aInterface );
94 return S_OK;
98 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */