Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * This file is part of the LibreOffice project.
4 : : *
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/.
8 : : *
9 : : * This file incorporates work covered by the following license notice:
10 : : *
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 .
18 : : */
19 : :
20 : : #ifndef _SB_INTERN_HXX
21 : : #define _SB_INTERN_HXX
22 : :
23 : : #include <basic/basicdllapi.h>
24 : : #include <basic/sbxfac.hxx>
25 : : #include <unotools/transliterationwrapper.hxx>
26 : : #include "sb.hxx"
27 : :
28 : : namespace utl
29 : : {
30 : : class TransliterationWrapper;
31 : : }
32 : : class SbUnoFactory;
33 : : class SbTypeFactory;
34 : : class SbOLEFactory;
35 : : class SbFormFactory;
36 : : class SbiInstance;
37 : : class SbModule;
38 : :
39 [ - + ]: 420 : class SbiFactory : public SbxFactory
40 : : {
41 : : public:
42 : : virtual SbxBase* Create( sal_uInt16 nSbxId, sal_uInt32 = SBXCR_SBX );
43 : : virtual SbxObject* CreateObject( const rtl::OUString& );
44 : : };
45 : :
46 : : typedef ::std::vector< String > StringVector;
47 : :
48 : : struct SbClassData
49 : : {
50 : : SbxArrayRef mxIfaces;
51 : :
52 : : // types this module depends on because of use in Dim As New <type>
53 : : // needed for initialization order of class modules
54 : : StringVector maRequiredTypes;
55 : :
56 : : SbClassData( void );
57 : 0 : ~SbClassData( void )
58 [ # # ]: 0 : { clear(); }
59 : : void clear( void );
60 : : };
61 : :
62 : : // #115824: Factory class to create class objects (type command)
63 : : // Implementation: sb.cxx
64 : : class BASIC_DLLPUBLIC SbClassFactory : public SbxFactory
65 : : {
66 : : SbxObjectRef xClassModules;
67 : :
68 : : public:
69 : : SbClassFactory( void );
70 : : virtual ~SbClassFactory();
71 : :
72 : : void AddClassModule( SbModule* pClassModule );
73 : : void RemoveClassModule( SbModule* pClassModule );
74 : :
75 : : virtual SbxBase* Create( sal_uInt16 nSbxId, sal_uInt32 = SBXCR_SBX );
76 : : virtual SbxObject* CreateObject( const rtl::OUString& );
77 : :
78 : : SbModule* FindClass( const String& rClassName );
79 : : };
80 : :
81 : : struct SbiGlobals
82 : : {
83 : : SbiInstance* pInst; // all active runtime instances
84 : : SbiFactory* pSbFac; // StarBASIC-Factory
85 : : SbUnoFactory* pUnoFac; // Factory for Uno-Structs at DIM AS NEW
86 : : SbTypeFactory* pTypeFac; // Factory for user defined types
87 : : SbClassFactory* pClassFac; // Factory for user defined classes (based on class modules)
88 : : SbOLEFactory* pOLEFac; // Factory for OLE types
89 : : SbFormFactory* pFormFac; // Factory for user forms
90 : : SbModule* pMod; // currently active module
91 : : SbModule* pCompMod; // currently compiled module
92 : : short nInst; // number of BASICs
93 : : Link aErrHdl; // global error handler
94 : : Link aBreakHdl; // global break handler
95 : : SbError nCode;
96 : : xub_StrLen nLine;
97 : : xub_StrLen nCol1,nCol2; // from... to...
98 : : bool bCompiler; // flag for compiler error
99 : : bool bGlobalInitErr;
100 : : bool bRunInit; // true, if RunInit active from the Basic
101 : : String aErrMsg; // buffer for GetErrorText()
102 : : ::utl::TransliterationWrapper* pTransliterationWrapper; // For StrComp
103 : : bool bBlockCompilerError;
104 : : BasicManager* pAppBasMgr;
105 : : StarBASIC* pMSOMacroRuntimLib; // Lib containing MSO Macro Runtime API entry symbols
106 : :
107 : : SbiGlobals();
108 : : ~SbiGlobals();
109 : : };
110 : :
111 : : // utility macros and routines
112 : :
113 : : BASIC_DLLPUBLIC SbiGlobals* GetSbData();
114 : :
115 : : #endif
116 : :
117 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|