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_BASIC_INC_SBOBJMOD_HXX
21 #define INCLUDED_BASIC_INC_SBOBJMOD_HXX
23 #include <rtl/ref.hxx>
24 #include <basic/sbmod.hxx>
25 #include <com/sun/star/script/ModuleInfo.hpp>
26 #include <com/sun/star/awt/XDialog.hpp>
27 #include <com/sun/star/frame/XModel.hpp>
28 #include <basic/basicdllapi.h>
30 // Basic-Module for excel object.
32 class SbObjModule
: public SbModule
35 virtual ~SbObjModule() override
;
38 SbObjModule( const OUString
& rName
, const css::script::ModuleInfo
& mInfo
, bool bIsVbaCompatible
);
39 virtual SbxVariable
* Find( const OUString
& rName
, SbxClassType t
) override
;
41 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
) override
;
43 using SbxValue::GetObject
;
44 SbxVariable
* GetObject();
45 /// @throws css::uno::RuntimeException
46 void SetUnoObject( const css::uno::Any
& aObj
) ;
49 class FormObjEventListenerImpl
;
51 class SbUserFormModule
: public SbObjModule
53 css::script::ModuleInfo m_mInfo
;
54 ::rtl::Reference
< FormObjEventListenerImpl
> m_DialogListener
;
55 css::uno::Reference
<css::awt::XDialog
> m_xDialog
;
56 css::uno::Reference
<css::frame::XModel
> m_xModel
;
62 SbUserFormModule( const OUString
& rName
, const css::script::ModuleInfo
& mInfo
, bool bIsVBACompat
);
63 virtual ~SbUserFormModule() override
;
64 virtual SbxVariable
* Find( const OUString
& rName
, SbxClassType t
) override
;
65 void ResetApiObj( bool bTriggerTerminateEvent
= true );
68 void triggerMethod( const OUString
& );
69 void triggerMethod( const OUString
&, css::uno::Sequence
< css::uno::Any
>& );
70 void triggerActivateEvent();
71 void triggerDeactivateEvent();
72 void triggerInitializeEvent();
73 void triggerTerminateEvent();
74 void triggerLayoutEvent();
75 void triggerResizeEvent();
77 bool getInitState() const
79 void setInitState( bool bInit
)
82 class SbUserFormModuleInstance
* CreateInstance();
85 class SbUserFormModuleInstance
: public SbUserFormModule
87 SbUserFormModule
* m_pParentModule
;
90 SbUserFormModuleInstance( SbUserFormModule
* pParentModule
, const OUString
& rName
,
91 const css::script::ModuleInfo
& mInfo
, bool bIsVBACompat
);
93 virtual bool IsClass( const OUString
& ) const override
;
94 virtual SbxVariable
* Find( const OUString
& rName
, SbxClassType t
) override
;
97 #endif // INCLUDED_BASIC_INC_SBOBJMOD_HXX
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */