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 #include "basic/basicdllapi.h" 29 30 class SbiRuntime; 31 class SbErrorStackEntry; 32 33 class BASIC_DLLPUBLIC BasicRuntime 34 { 35 SbiRuntime* pRun; 36 public: BasicRuntime(SbiRuntime * p)37 BasicRuntime( SbiRuntime* p ) : pRun ( p ){;} 38 const String GetSourceRevision(); 39 const String GetModuleName( SbxNameType nType ); 40 const String GetMethodName( SbxNameType nType ); 41 xub_StrLen GetLine(); 42 xub_StrLen GetCol1(); 43 xub_StrLen GetCol2(); 44 sal_Bool IsRun(); IsValid()45 sal_Bool IsValid() { return pRun != NULL; } 46 BasicRuntime GetNextRuntime(); 47 }; 48 49 class BASIC_DLLPUBLIC BasicErrorStackEntry 50 { 51 SbErrorStackEntry *pEntry; 52 public: BasicErrorStackEntry(SbErrorStackEntry * p)53 BasicErrorStackEntry( SbErrorStackEntry *p ) : pEntry ( p ){;} 54 const String GetSourceRevision(); 55 const String GetModuleName( SbxNameType nType ); 56 const String GetMethodName( SbxNameType nType ); 57 xub_StrLen GetLine(); 58 xub_StrLen GetCol1(); 59 xub_StrLen GetCol2(); 60 }; 61 62 class BASIC_DLLPUBLIC BasicRuntimeAccess 63 { 64 public: 65 static BasicRuntime GetRuntime(); 66 static bool HasRuntime(); 67 static sal_uInt16 GetStackEntryCount(); 68 static BasicErrorStackEntry GetStackEntry( sal_uInt16 nIndex ); 69 static sal_Bool HasStack(); 70 static void DeleteStack(); 71 72 static sal_Bool IsRunInit(); 73 }; 74 75 #endif 76 77