merged tag ooo/OOO330_m14
[LibreOffice.git] / extensions / source / activex / main / SOActionsApproval.h
blobd10ec1461d8070dbd494714e3bc28f7d096144c0
1 // SOActionsApproval.h: Definition of the SOActionsApproval class
2 //
3 //////////////////////////////////////////////////////////////////////
5 #if !defined __SODOCUMENTEVENTLISTENER_H_
6 #define __SODOCUMENTEVENTLISTENER_H_
8 #if _MSC_VER > 1000
9 #pragma once
10 #endif // _MSC_VER > 1000
12 #include "resource.h" // main symbols
13 #include <ExDispID.h>
14 #include <ExDisp.h>
15 #include <shlguid.h>
17 #if defined(_MSC_VER) && (_MSC_VER >= 1300)
18 #undef _DEBUG
19 #endif
21 #include <atlctl.h>
23 #include "so_activex.h"
25 /////////////////////////////////////////////////////////////////////////////
26 // SOActionsApproval
28 class SOActionsApproval :
29 public IDispatchImpl<ISOActionsApproval, &IID_ISOActionsApproval, &LIBID_SO_ACTIVEXLib>,
30 public ISupportErrorInfo,
31 public CComObjectRoot,
32 public CComCoClass<SOActionsApproval,&CLSID_SOActionsApproval>
34 public:
35 SOActionsApproval() {}
36 virtual ~SOActionsApproval() {}
38 BEGIN_COM_MAP(SOActionsApproval)
39 COM_INTERFACE_ENTRY(IDispatch)
40 COM_INTERFACE_ENTRY(ISOActionsApproval)
41 COM_INTERFACE_ENTRY(ISupportErrorInfo)
42 END_COM_MAP()
43 DECLARE_NOT_AGGREGATABLE(SOActionsApproval)
44 // Remove the comment from the line above if you don't want your object to
45 // support aggregation.
47 DECLARE_REGISTRY_RESOURCEID(IDR_SODOCUMENTEVENTLISTENER)
49 // ISupportsErrorInfo
50 STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
52 // ISOActionsApproval
53 virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE approveAction(
54 /* [in] */ long nActionID,
55 /* [retval][out] */ boolean *pbApproval)
57 // only PreventClose is approved
58 USES_CONVERSION;
59 *pbApproval = ( nActionID == 1 );
61 return S_OK;
64 virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Bridge_implementedInterfaces(
65 /* [retval][out] */ SAFEARRAY __RPC_FAR * __RPC_FAR *pVal)
67 *pVal = SafeArrayCreateVector( VT_BSTR, 0, 1 );
69 if( !*pVal )
70 return E_FAIL;
72 long ix = 0;
73 CComBSTR aInterface( OLESTR( "com.sun.star.embed.XActionsApproval" ) );
74 SafeArrayPutElement( *pVal, &ix, aInterface );
76 return S_OK;
80 #endif // __SODOCUMENTEVENTLISTENER_H_