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 // SOActionsApproval.h: Definition of the SOActionsApproval class
35 #include <so_activex.h>
39 class SOActionsApproval
:
40 public IDispatchImpl
<ISOActionsApproval
, &IID_ISOActionsApproval
, &LIBID_SO_ACTIVEXLib
>,
41 public ISupportErrorInfo
,
42 public CComObjectRoot
,
43 public CComCoClass
<SOActionsApproval
,&CLSID_SOActionsApproval
>
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
)
54 #pragma clang diagnostic push
55 #pragma clang diagnostic ignored "-Winconsistent-missing-override"
59 #pragma clang diagnostic pop
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
)
68 STDMETHOD(InterfaceSupportsErrorInfo
)(REFIID riid
) override
;
71 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
approveAction(
72 /* [in] */ long nActionID
,
73 /* [retval][out] */ boolean
*pbApproval
) override
75 // only PreventClose is approved
77 *pbApproval
= ( nActionID
== 1 );
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 );
91 CComBSTR
aInterface( OLESTR( "com.sun.star.embed.XActionsApproval" ) );
92 SafeArrayPutElement( *pVal
, &ix
, aInterface
);
98 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */