xref: /aoo41x/main/basic/inc/basic/basicrt.hxx (revision 234bd5c5)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _BASICRT_HXX
24 #define _BASICRT_HXX
25 
26 #include <tools/string.hxx>
27 #include <basic/sbxdef.hxx>
28 
29 class SbiRuntime;
30 class SbErrorStackEntry;
31 
32 class BasicRuntime
33 {
34 	SbiRuntime* pRun;
35 public:
BasicRuntime(SbiRuntime * p)36 	BasicRuntime( SbiRuntime* p ) : pRun ( p ){;}
37 	const String GetSourceRevision();
38 	const String GetModuleName( SbxNameType nType );
39 	const String GetMethodName( SbxNameType nType );
40 	xub_StrLen GetLine();
41 	xub_StrLen GetCol1();
42 	xub_StrLen GetCol2();
43     sal_Bool IsRun();
IsValid()44 	sal_Bool IsValid() { return pRun != NULL; }
45 	BasicRuntime GetNextRuntime();
46 };
47 
48 class BasicErrorStackEntry
49 {
50 	SbErrorStackEntry *pEntry;
51 public:
BasicErrorStackEntry(SbErrorStackEntry * p)52 	BasicErrorStackEntry( SbErrorStackEntry *p ) : pEntry ( p ){;}
53 	const String GetSourceRevision();
54 	const String GetModuleName( SbxNameType nType );
55 	const String GetMethodName( SbxNameType nType );
56 	xub_StrLen GetLine();
57 	xub_StrLen GetCol1();
58 	xub_StrLen GetCol2();
59 };
60 
61 class BasicRuntimeAccess
62 {
63 public:
64 	static BasicRuntime GetRuntime();
65 	static bool HasRuntime();
66 	static sal_uInt16 GetStackEntryCount();
67 	static BasicErrorStackEntry GetStackEntry( sal_uInt16 nIndex );
68 	static sal_Bool HasStack();
69 	static void DeleteStack();
70 
71 	static sal_Bool IsRunInit();
72 };
73 
74 #endif
75 
76