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 #ifndef INCLUDED_SC_SOURCE_UI_VBA_VBAEVENTSHELPER_HXX
21 #define INCLUDED_SC_SOURCE_UI_VBA_VBAEVENTSHELPER_HXX
23 #include <rtl/ref.hxx>
24 #include <vbahelper/vbaeventshelperbase.hxx>
25 #include "excelvbahelper.hxx"
26 #include "rangelst.hxx"
28 class ScVbaEventListener
;
30 class ScVbaEventsHelper
: public VbaEventsHelperBase
34 const css::uno::Sequence
< css::uno::Any
>& rArgs
,
35 const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
36 virtual ~ScVbaEventsHelper();
38 virtual void SAL_CALL
notifyEvent( const css::document::EventObject
& rEvent
) throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
40 OUString SAL_CALL
getImplementationName()
41 throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
43 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames()
44 throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
47 virtual bool implPrepareEvent( EventQueue
& rEventQueue
, const EventHandlerInfo
& rInfo
, const css::uno::Sequence
< css::uno::Any
>& rArgs
) throw (css::uno::RuntimeException
) SAL_OVERRIDE
;
48 virtual css::uno::Sequence
< css::uno::Any
> implBuildArgumentList( const EventHandlerInfo
& rInfo
, const css::uno::Sequence
< css::uno::Any
>& rArgs
) throw (css::lang::IllegalArgumentException
, css::uno::RuntimeException
) SAL_OVERRIDE
;
49 virtual void implPostProcessEvent( EventQueue
& rEventQueue
, const EventHandlerInfo
& rInfo
, bool bCancel
) throw (css::uno::RuntimeException
) SAL_OVERRIDE
;
50 virtual OUString
implGetDocumentModuleName( const EventHandlerInfo
& rInfo
, const css::uno::Sequence
< css::uno::Any
>& rArgs
) const throw (css::lang::IllegalArgumentException
, css::uno::RuntimeException
) SAL_OVERRIDE
;
53 /** Checks if selection has been changed compared to selection of last call.
54 @return true, if the selection has been changed. */
55 bool isSelectionChanged( const css::uno::Sequence
< css::uno::Any
>& rArgs
, sal_Int32 nIndex
) throw (css::lang::IllegalArgumentException
, css::uno::RuntimeException
);
57 /** Creates a VBA Worksheet object (the argument must contain a sheet index). */
58 css::uno::Any
createWorksheet( const css::uno::Sequence
< css::uno::Any
>& rArgs
, sal_Int32 nIndex
) const throw (css::lang::IllegalArgumentException
, css::uno::RuntimeException
);
59 /** Creates a VBA Range object (the argument must contain a UNO range or UNO range list). */
60 css::uno::Any
createRange( const css::uno::Sequence
< css::uno::Any
>& rArgs
, sal_Int32 nIndex
) const throw (css::lang::IllegalArgumentException
, css::uno::RuntimeException
);
61 /** Creates a VBA Hyperlink object (the argument must contain a UNO cell). */
62 css::uno::Any
createHyperlink( const css::uno::Sequence
< css::uno::Any
>& rArgs
, sal_Int32 nIndex
) const throw (css::lang::IllegalArgumentException
, css::uno::RuntimeException
);
63 /** Creates a VBA Window object (the argument must contain a model controller). */
64 css::uno::Any
createWindow( const css::uno::Sequence
< css::uno::Any
>& rArgs
, sal_Int32 nIndex
) const throw (css::lang::IllegalArgumentException
, css::uno::RuntimeException
);
67 ::rtl::Reference
< ScVbaEventListener
> mxListener
;
68 css::uno::Any maOldSelection
;
69 ScDocShell
* mpDocShell
;
76 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */