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 <basic/sbstar.hxx>
24 #include <unotools/transliterationwrapper.hxx>
25 #include <vcl/errcode.hxx>
26 #include <config_features.h>
30 class TransliterationWrapper
;
40 class SbiFactory final
: public SbxFactory
43 virtual SbxBaseRef
Create( sal_uInt16 nSbxId
, sal_uInt32
) override
;
44 virtual SbxObjectRef
CreateObject( const OUString
& ) override
;
51 // types this module depends on because of use in Dim As New <type>
52 // needed for initialization order of class modules
53 std::vector
< OUString
> maRequiredTypes
;
61 // #115824: Factory class to create class objects (type command)
62 // Implementation: sb.cxx
63 class SbClassFactory final
: public SbxFactory
65 SbxObjectRef xClassModules
;
69 virtual ~SbClassFactory() override
;
71 void AddClassModule( SbModule
* pClassModule
);
72 void RemoveClassModule( SbModule
* pClassModule
);
74 virtual SbxBaseRef
Create( sal_uInt16 nSbxId
, sal_uInt32
) override
;
75 virtual SbxObjectRef
CreateObject( const OUString
& ) override
;
77 SbModule
* FindClass( const OUString
& rClassName
);
80 // Factory class to create user defined objects (type command)
81 class SbTypeFactory final
: public SbxFactory
84 virtual SbxBaseRef
Create( sal_uInt16 nSbxId
, sal_uInt32
) override
;
85 virtual SbxObjectRef
CreateObject( const OUString
& ) override
;
88 class SbFormFactory final
: public SbxFactory
91 virtual SbxBaseRef
Create( sal_uInt16 nSbxId
, sal_uInt32
) override
;
92 virtual SbxObjectRef
CreateObject( const OUString
& ) override
;
95 // Factory class to create OLE objects
96 class SbOLEFactory final
: public SbxFactory
99 virtual SbxBaseRef
Create( sal_uInt16 nSbxId
, sal_uInt32
) override
;
100 virtual SbxObjectRef
CreateObject( const OUString
& ) override
;
105 static SbiGlobals
* pGlobals
;
106 SbiInstance
* pInst
; // all active runtime instances
107 std::unique_ptr
<SbiFactory
> pSbFac
; // StarBASIC-Factory
108 std::unique_ptr
<SbUnoFactory
> pUnoFac
; // Factory for Uno-Structs at DIM AS NEW
109 std::unique_ptr
<SbTypeFactory
>
110 pTypeFac
; // Factory for user defined types
111 std::unique_ptr
<SbClassFactory
>
112 pClassFac
; // Factory for user defined classes (based on class modules)
113 std::unique_ptr
<SbOLEFactory
>
114 pOLEFac
; // Factory for OLE types
115 std::unique_ptr
<SbFormFactory
>
116 pFormFac
; // Factory for user forms
117 SbModule
* pMod
; // currently active module
118 SbModule
* pCompMod
; // currently compiled module
119 short nInst
; // number of BASICs
120 Link
<StarBASIC
*,bool> aErrHdl
; // global error handler
121 Link
<StarBASIC
*,BasicDebugFlags
> aBreakHdl
; // global break handler
124 sal_Int32 nCol1
,nCol2
; // from... to...
125 bool bCompilerError
; // flag for compiler error
127 bool bRunInit
; // true, if RunInit active from the Basic
128 OUString aErrMsg
; // buffer for GetErrorText()
129 std::unique_ptr
<::utl::TransliterationWrapper
> pTransliterationWrapper
; // For StrComp
130 bool bBlockCompilerError
;
131 #if HAVE_FEATURE_SCRIPTING
132 std::unique_ptr
<BasicManager
> pAppBasMgr
;
134 StarBASIC
* pMSOMacroRuntimLib
; // Lib containing MSO Macro Runtime API entry symbols
140 // utility macros and routines
142 SbiGlobals
* GetSbData();
144 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */