tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / sc / source / ui / vba / vbaeventshelper.hxx
blobe5bf11ecb3401160388c71cd471f5dc23e9e7af0
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 #pragma once
22 #include <rtl/ref.hxx>
23 #include <vbahelper/vbaeventshelperbase.hxx>
25 class ScDocShell;
26 class ScDocument;
27 class ScVbaEventListener;
29 class ScVbaEventsHelper : public VbaEventsHelperBase
31 public:
32 ScVbaEventsHelper( const css::uno::Sequence< css::uno::Any >& rArgs );
33 virtual ~ScVbaEventsHelper() override;
35 virtual void SAL_CALL notifyEvent( const css::document::EventObject& rEvent ) override;
37 OUString SAL_CALL getImplementationName() override;
39 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
41 protected:
42 virtual bool implPrepareEvent( EventQueue& rEventQueue, const EventHandlerInfo& rInfo, const css::uno::Sequence< css::uno::Any >& rArgs ) override;
43 virtual css::uno::Sequence< css::uno::Any > implBuildArgumentList( const EventHandlerInfo& rInfo, const css::uno::Sequence< css::uno::Any >& rArgs ) override;
44 virtual void implPostProcessEvent( EventQueue& rEventQueue, const EventHandlerInfo& rInfo, bool bCancel ) override;
45 virtual OUString implGetDocumentModuleName( const EventHandlerInfo& rInfo, const css::uno::Sequence< css::uno::Any >& rArgs ) const override;
47 private:
48 /** Checks if selection has been changed compared to selection of last call.
49 @return true, if the selection has been changed.
50 @throws css::lang::IllegalArgumentException
51 @throws css::uno::RuntimeException
53 bool isSelectionChanged( const css::uno::Sequence< css::uno::Any >& rArgs, sal_Int32 nIndex );
55 /** Creates a VBA Worksheet object (the argument must contain a sheet index).
56 @throws css::lang::IllegalArgumentException
57 @throws css::uno::RuntimeException
59 css::uno::Any createWorksheet( const css::uno::Sequence< css::uno::Any >& rArgs, sal_Int32 nIndex ) const;
60 /** Creates a VBA Range object (the argument must contain a UNO range or UNO range list).
61 @throws css::lang::IllegalArgumentException
62 @throws css::uno::RuntimeException
64 css::uno::Any createRange( const css::uno::Sequence< css::uno::Any >& rArgs, sal_Int32 nIndex ) const;
65 /** Creates a VBA Hyperlink object (the argument must contain a UNO cell).
66 @throws css::lang::IllegalArgumentException
67 @throws css::uno::RuntimeException
69 css::uno::Any createHyperlink( const css::uno::Sequence< css::uno::Any >& rArgs, sal_Int32 nIndex ) const;
70 /** Creates a VBA Window object (the argument must contain a model controller).
71 @throws css::lang::IllegalArgumentException
72 @throws css::uno::RuntimeException
74 css::uno::Any createWindow( const css::uno::Sequence< css::uno::Any >& rArgs, sal_Int32 nIndex ) const;
76 private:
77 ::rtl::Reference< ScVbaEventListener > mxListener;
78 css::uno::Any maOldSelection;
79 ScDocShell* mpDocShell;
80 ScDocument* mpDoc;
81 bool mbOpened;
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */