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 .
22 #include <rtl/ref.hxx>
23 #include <basic/sbmod.hxx>
24 #include <com/sun/star/script/ModuleInfo.hpp>
25 #include <com/sun/star/awt/XDialog.hpp>
26 #include <com/sun/star/frame/XModel.hpp>
28 // Basic-Module for excel object.
30 class SbObjModule
: public SbModule
33 virtual ~SbObjModule() override
;
36 SbObjModule( const OUString
& rName
, const css::script::ModuleInfo
& mInfo
, bool bIsVbaCompatible
);
37 virtual SbxVariable
* Find( const OUString
& rName
, SbxClassType t
) override
;
39 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
) override
;
41 using SbxValue::GetObject
;
42 SbxVariable
* GetObject();
43 /// @throws css::uno::RuntimeException
44 void SetUnoObject( const css::uno::Any
& aObj
) ;
47 class FormObjEventListenerImpl
;
49 class SbUserFormModule
: public SbObjModule
51 css::script::ModuleInfo m_mInfo
;
52 ::rtl::Reference
< FormObjEventListenerImpl
> m_DialogListener
;
53 css::uno::Reference
<css::awt::XDialog
> m_xDialog
;
54 css::uno::Reference
<css::frame::XModel
> m_xModel
;
60 SbUserFormModule( const OUString
& rName
, const css::script::ModuleInfo
& mInfo
, bool bIsVBACompat
);
61 virtual ~SbUserFormModule() override
;
62 virtual SbxVariable
* Find( const OUString
& rName
, SbxClassType t
) override
;
63 void ResetApiObj( bool bTriggerTerminateEvent
= true );
66 void triggerMethod( const OUString
& );
67 void triggerMethod( const OUString
&, css::uno::Sequence
< css::uno::Any
>& );
68 void triggerActivateEvent();
69 void triggerDeactivateEvent();
70 void triggerInitializeEvent();
71 void triggerTerminateEvent();
72 void triggerLayoutEvent();
73 void triggerResizeEvent();
75 bool getInitState() const
77 void setInitState( bool bInit
)
80 class SbUserFormModuleInstance
* CreateInstance();
83 class SbUserFormModuleInstance final
: public SbUserFormModule
85 SbUserFormModule
* m_pParentModule
;
88 SbUserFormModuleInstance( SbUserFormModule
* pParentModule
, const OUString
& rName
,
89 const css::script::ModuleInfo
& mInfo
, bool bIsVBACompat
);
91 virtual bool IsClass( const OUString
& ) const override
;
92 virtual SbxVariable
* Find( const OUString
& rName
, SbxClassType t
) override
;
95 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */