xref: /trunk/main/basic/inc/basic/mybasic.hxx (revision f6675432)
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 
24 #ifndef _MYBASIC_HXX
25 #define _MYBASIC_HXX
26 
27 #include <basic/sbstar.hxx>
28 #include "basic/basicdllapi.h"
29 
30 class BasicApp;
31 class AppBasEd;
32 class ErrorEntry;
33 
34 class BASIC_DLLPUBLIC BasicError {
35 	AppBasEd* pWin;
36 	sal_uInt16 nLine, nCol1, nCol2;
37 	String aText;
38 public:
39 	BasicError( AppBasEd*, sal_uInt16, const String&, sal_uInt16, sal_uInt16, sal_uInt16 );
40 	void Show();
41 };
42 
43 DECLARE_LIST( ErrorList, BasicError* )
44 
45 #define SBXID_MYBASIC	0x594D		// MyBasic: MY
46 #define	SBXCR_TEST		0x54534554	// TEST
47 
48 class BASIC_DLLPUBLIC MyBasic : public StarBASIC
49 {
50 	SbError nError;
51 	virtual sal_Bool ErrorHdl();
52 	virtual sal_uInt16 BreakHdl();
53 
54 protected:
55 	Link GenLogHdl();
56 	Link GenWinInfoHdl();
57 	Link GenModuleWinExistsHdl();
58 	Link GenWriteStringHdl();
59 
60 	virtual void StartListeningTT( SfxBroadcaster &rBroadcaster );
61 
62 	String GenRealString( const String &aResString );
63 
64 public:
65 	SBX_DECL_PERSIST_NODATA(SBXCR_TEST,SBXID_MYBASIC,1);
66 	TYPEINFO();
67 	ErrorList aErrors;
68 	MyBasic();
69 	virtual ~MyBasic();
70 	virtual sal_Bool Compile( SbModule* );
71 	void Reset();
GetErrors()72 	SbError GetErrors() { return nError; }
73 
74 		// Do not use #ifdefs here because this header file is both used for testtool and basic
75 	SbxObject *pTestObject; // for Testtool; otherwise NULL
76 
77 	virtual void LoadIniFile();
78 
79 	// Determines the extended symbol type for syntax highlighting
80 	virtual SbTextType GetSymbolType( const String &Symbol, sal_Bool bWasTTControl );
81 	virtual const String GetSpecialErrorText();
82 	virtual void ReportRuntimeError( AppBasEd *pEditWin );
83 	virtual void DebugFindNoErrors( sal_Bool bDebugFindNoErrors );
84 
85 	static void SetCompileModule( SbModule *pMod );
86 	static SbModule *GetCompileModule();
87 };
88 
89 SV_DECL_IMPL_REF(MyBasic)
90 
91 #endif
92 
93 /* vim: set noet sw=4 ts=4: */
94