tdf#125506: use rObjectToDevice if needed
[LibreOffice.git] / basic / inc / sbobjmod.hxx
bloba00c849bfee6e92051fc7a1816fda6ed65b172ed
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 #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 <basic/sbstar.hxx>
26 #include <com/sun/star/script/ModuleInfo.hpp>
27 #include <com/sun/star/lang/XEventListener.hpp>
28 #include <com/sun/star/awt/XDialog.hpp>
29 #include <com/sun/star/frame/XModel.hpp>
30 #include <basic/basicdllapi.h>
32 // Basic-Module for excel object.
34 class BASIC_DLLPUBLIC SbObjModule : public SbModule
36 protected:
37 virtual ~SbObjModule() override;
39 public:
40 SbObjModule( const OUString& rName, const css::script::ModuleInfo& mInfo, bool bIsVbaCompatible );
41 virtual SbxVariable* Find( const OUString& rName, SbxClassType t ) override;
43 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
45 using SbxValue::GetObject;
46 SbxVariable* GetObject();
47 /// @throws css::uno::RuntimeException
48 void SetUnoObject( const css::uno::Any& aObj ) ;
51 class FormObjEventListenerImpl;
53 class BASIC_DLLPUBLIC SbUserFormModule : public SbObjModule
55 css::script::ModuleInfo m_mInfo;
56 ::rtl::Reference< FormObjEventListenerImpl > m_DialogListener;
57 css::uno::Reference<css::awt::XDialog> m_xDialog;
58 css::uno::Reference<css::frame::XModel> m_xModel;
59 bool mbInit;
61 //protected:
62 void InitObject();
63 public:
64 SbUserFormModule( const OUString& rName, const css::script::ModuleInfo& mInfo, bool bIsVBACompat );
65 virtual ~SbUserFormModule() override;
66 virtual SbxVariable* Find( const OUString& rName, SbxClassType t ) override;
67 void ResetApiObj( bool bTriggerTerminateEvent = true );
68 void Unload();
69 void Load();
70 void triggerMethod( const OUString& );
71 void triggerMethod( const OUString&, css::uno::Sequence< css::uno::Any >& );
72 void triggerActivateEvent();
73 void triggerDeactivateEvent();
74 void triggerInitializeEvent();
75 void triggerTerminateEvent();
76 void triggerLayoutEvent();
77 void triggerResizeEvent();
79 bool getInitState()
80 { return mbInit; }
81 void setInitState( bool bInit )
82 { mbInit = bInit; }
84 class SbUserFormModuleInstance* CreateInstance();
87 class BASIC_DLLPUBLIC SbUserFormModuleInstance : public SbUserFormModule
89 SbUserFormModule* m_pParentModule;
91 public:
92 SbUserFormModuleInstance( SbUserFormModule* pParentModule, const OUString& rName,
93 const css::script::ModuleInfo& mInfo, bool bIsVBACompat );
95 virtual bool IsClass( const OUString& ) const override;
96 virtual SbxVariable* Find( const OUString& rName, SbxClassType t ) override;
99 #endif // INCLUDED_BASIC_INC_SBOBJMOD_HXX
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */