1*234bd5c5SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*234bd5c5SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*234bd5c5SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*234bd5c5SAndrew Rist * distributed with this work for additional information 6*234bd5c5SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*234bd5c5SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*234bd5c5SAndrew Rist * "License"); you may not use this file except in compliance 9*234bd5c5SAndrew Rist * with the License. You may obtain a copy of the License at 10*234bd5c5SAndrew Rist * 11*234bd5c5SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*234bd5c5SAndrew Rist * 13*234bd5c5SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*234bd5c5SAndrew Rist * software distributed under the License is distributed on an 15*234bd5c5SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*234bd5c5SAndrew Rist * KIND, either express or implied. See the License for the 17*234bd5c5SAndrew Rist * specific language governing permissions and limitations 18*234bd5c5SAndrew Rist * under the License. 19*234bd5c5SAndrew Rist * 20*234bd5c5SAndrew Rist *************************************************************/ 21*234bd5c5SAndrew Rist 22*234bd5c5SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _MYBASIC_HXX 25cdf0e10cSrcweir #define _MYBASIC_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <basic/sbstar.hxx> 28cdf0e10cSrcweir 29cdf0e10cSrcweir class BasicApp; 30cdf0e10cSrcweir class AppBasEd; 31cdf0e10cSrcweir class ErrorEntry; 32cdf0e10cSrcweir 33cdf0e10cSrcweir class BasicError { 34cdf0e10cSrcweir AppBasEd* pWin; 35cdf0e10cSrcweir sal_uInt16 nLine, nCol1, nCol2; 36cdf0e10cSrcweir String aText; 37cdf0e10cSrcweir public: 38cdf0e10cSrcweir BasicError( AppBasEd*, sal_uInt16, const String&, sal_uInt16, sal_uInt16, sal_uInt16 ); 39cdf0e10cSrcweir void Show(); 40cdf0e10cSrcweir }; 41cdf0e10cSrcweir 42cdf0e10cSrcweir DECLARE_LIST( ErrorList, BasicError* ) 43cdf0e10cSrcweir 44cdf0e10cSrcweir #define SBXID_MYBASIC 0x594D // MyBasic: MY 45cdf0e10cSrcweir #define SBXCR_TEST 0x54534554 // TEST 46cdf0e10cSrcweir 47cdf0e10cSrcweir class MyBasic : public StarBASIC 48cdf0e10cSrcweir { 49cdf0e10cSrcweir SbError nError; 50cdf0e10cSrcweir virtual sal_Bool ErrorHdl(); 51cdf0e10cSrcweir virtual sal_uInt16 BreakHdl(); 52cdf0e10cSrcweir 53cdf0e10cSrcweir protected: 54cdf0e10cSrcweir Link GenLogHdl(); 55cdf0e10cSrcweir Link GenWinInfoHdl(); 56cdf0e10cSrcweir Link GenModuleWinExistsHdl(); 57cdf0e10cSrcweir Link GenWriteStringHdl(); 58cdf0e10cSrcweir 59cdf0e10cSrcweir virtual void StartListeningTT( SfxBroadcaster &rBroadcaster ); 60cdf0e10cSrcweir 61cdf0e10cSrcweir String GenRealString( const String &aResString ); 62cdf0e10cSrcweir 63cdf0e10cSrcweir public: 64cdf0e10cSrcweir SBX_DECL_PERSIST_NODATA(SBXCR_TEST,SBXID_MYBASIC,1); 65cdf0e10cSrcweir TYPEINFO(); 66cdf0e10cSrcweir ErrorList aErrors; 67cdf0e10cSrcweir MyBasic(); 68cdf0e10cSrcweir virtual ~MyBasic(); 69cdf0e10cSrcweir virtual sal_Bool Compile( SbModule* ); 70cdf0e10cSrcweir void Reset(); GetErrors()71cdf0e10cSrcweir SbError GetErrors() { return nError; } 72cdf0e10cSrcweir 73cdf0e10cSrcweir // Do not use #ifdefs here because this header file is both used for testtool and basic 74cdf0e10cSrcweir SbxObject *pTestObject; // for Testool; otherwise NULL 75cdf0e10cSrcweir 76cdf0e10cSrcweir virtual void LoadIniFile(); 77cdf0e10cSrcweir 78cdf0e10cSrcweir // Determines the extended symbol type for syntax highlighting 79cdf0e10cSrcweir virtual SbTextType GetSymbolType( const String &Symbol, sal_Bool bWasTTControl ); 80cdf0e10cSrcweir virtual const String GetSpechialErrorText(); 81cdf0e10cSrcweir virtual void ReportRuntimeError( AppBasEd *pEditWin ); 82cdf0e10cSrcweir virtual void DebugFindNoErrors( sal_Bool bDebugFindNoErrors ); 83cdf0e10cSrcweir 84cdf0e10cSrcweir static void SetCompileModule( SbModule *pMod ); 85cdf0e10cSrcweir static SbModule *GetCompileModule(); 86cdf0e10cSrcweir }; 87cdf0e10cSrcweir 88cdf0e10cSrcweir SV_DECL_IMPL_REF(MyBasic) 89cdf0e10cSrcweir 90cdf0e10cSrcweir #endif 91