1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: sbintern.hxx,v $
10 * $Revision: 1.16.56.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SB_INTERN_HXX
32 #define _SB_INTERN_HXX
34 #include <basic/sbxfac.hxx>
35 #include <unotools/transliterationwrapper.hxx>
40 class TransliterationWrapper
;
48 class SbiFactory
: public SbxFactory
51 virtual SbxBase
* Create( UINT16 nSbxId
, UINT32
= SBXCR_SBX
);
52 virtual SbxObject
* CreateObject( const String
& );
65 // #115824: Factory class to create class objects (type command)
66 // Implementation: sb.cxx
67 class SbClassFactory
: public SbxFactory
69 SbxObjectRef xClassModules
;
72 SbClassFactory( void );
73 virtual ~SbClassFactory();
75 void AddClassModule( SbModule
* pClassModule
);
76 void RemoveClassModule( SbModule
* pClassModule
);
78 virtual SbxBase
* Create( UINT16 nSbxId
, UINT32
= SBXCR_SBX
);
79 virtual SbxObject
* CreateObject( const String
& );
81 SbModule
* FindClass( const String
& rClassName
);
84 // Stack fuer die im Fehlerfall abgebaute SbiRuntime Kette
85 class SbErrorStackEntry
88 SbErrorStackEntry(SbMethodRef aM
, xub_StrLen nL
, xub_StrLen nC1
, xub_StrLen nC2
)
89 : aMethod(aM
), nLine(nL
), nCol1(nC1
), nCol2(nC2
) {}
92 xub_StrLen nCol1
, nCol2
;
95 SV_DECL_PTRARR_DEL(SbErrorStack
, SbErrorStackEntry
*, 1, 1)
101 SbiInstance
* pInst
; // alle aktiven Runtime-Instanzen
102 SbiFactory
* pSbFac
; // StarBASIC-Factory
103 SbUnoFactory
* pUnoFac
; // Factory fuer Uno-Structs bei DIM AS NEW
104 SbTypeFactory
* pTypeFac
; // Factory for user defined types
105 SbClassFactory
* pClassFac
; // Factory for user defined classes (based on class modules)
106 SbOLEFactory
* pOLEFac
; // Factory for OLE types
107 SbModule
* pMod
; // aktuell aktives Modul
108 SbModule
* pCompMod
; // aktuell compiliertes Modul
109 short nInst
; // Anzahl BASICs
110 Link aErrHdl
; // globaler Error-Handler
111 Link aBreakHdl
; // globaler Break-Handler
112 SbError nCode
; // aktueller Fehlercode
113 xub_StrLen nLine
; // aktuelle Zeile
114 xub_StrLen nCol1
,nCol2
; // aktuelle Spalten (von,bis)
115 BOOL bCompiler
; // Flag fuer Compiler-Error
116 BOOL bGlobalInitErr
; // Beim GlobalInit trat ein Compiler-Fehler auf
117 BOOL bRunInit
; // TRUE, wenn RunInit vom Basic aktiv ist
118 String aErrMsg
; // Puffer fuer GetErrorText()
119 SbLanguageMode eLanguageMode
; // Flag fuer Visual-Basic-Script-Modus
120 SbErrorStack
* pErrStack
; // Stack fuer die im Fehlerfall abgebaute SbiRuntime Kette
121 ::utl::TransliterationWrapper
* pTransliterationWrapper
; // For StrComp
122 BOOL bBlockCompilerError
;
123 BasicManager
* pAppBasMgr
;
124 StarBASIC
* pMSOMacroRuntimLib
; // Lib containing MSO Macro Runtime API entry symbols
130 // Utility-Makros und -Routinen
132 SbiGlobals
* GetSbData();
134 #define pINST GetSbData()->pInst
135 #define pMOD GetSbData()->pMod
136 #define pCMOD GetSbData()->pCompMod
137 #define pSBFAC GetSbData()->pSbFac
138 #define pUNOFAC GetSbData()->pUnoFac
139 #define pTYPEFAC GetSbData()->pTypeFac
140 #define pCLASSFAC GetSbData()->pClassFac
141 #define pOLEFAC GetSbData()->pOLEFac