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