xref: /trunk/main/basic/inc/basic/sbdef.hxx (revision 7fef15a0)
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 _SB_SBDEF_HXX
25 #define _SB_SBDEF_HXX
26 
27 #include <basic/sbxdef.hxx>
28 #include "basic/basicdllapi.h"
29 #include <svl/svarray.hxx>
30 
31 #define _BASIC_TEXTPORTIONS
32 
33 // Type of a text token (syntax highlighting)
34 enum SbTextType
35 {
36     SB_KEYWORD = 1,      // Keywords
37     SB_SYMBOL,           // Symbols
38     SB_STRING,           // Strings
39     SB_NUMBER,           // Numbers
40     SB_PUNCTUATION,      // Brackets, points, etc.
41     SB_COMMENT,          // Comments
42     SB_DUMMY = 255       // workaround for #i31479
43 };
44 
45 // Active language
46 enum SbLanguageMode
47 {
48     SB_LANG_GLOBAL,      // As in SbiGlobals struct
49     SB_LANG_BASIC,       // StarBasic (Default)
50     SB_LANG_VBSCRIPT,    // Visual-Basic-Script
51     SB_LANG_JAVASCRIPT   // JavaScript
52 };
53 
54 #ifdef _BASIC_TEXTPORTIONS
55 struct SbTextPortion
56 { // Syntax Highlighting: a text portion
57     xub_StrLen nLine;        // Line number
58     xub_StrLen nStart, nEnd; // 1st and last column
59     SbTextType eType;        // Type of the portion
60 };
61 
62 SV_DECL_VARARR(SbTextPortions, SbTextPortion,16,16)
63 #else
64 class SbTextPortions;
65 #endif
66 
67 // Returns type name for Basic type, array flag is ignored
68 // implementation: basic/source/runtime/methods.cxx
69 BASIC_DLLPUBLIC String getBasicTypeName( SbxDataType eType );
70 
71 // Returns type name for Basic objects, especially
72 // important for SbUnoObj instances
73 // implementation: basic/source/classes/sbunoobj.cxx
74 class SbxObject;
75 BASIC_DLLPUBLIC String getBasicObjectTypeName( SbxObject* pObj );
76 
77 // Allows Basic IDE to set watch mode to suppress errors
78 // implementation: basic/source/runtime/runtime.cxx
79 BASIC_DLLPUBLIC void setBasicWatchMode( bool bOn );
80 
81 // Debug Flags:
82 #define SbDEBUG_BREAK       0x0001          // Break-Callback
83 #define SbDEBUG_STEPINTO    0x0002          // Single Step-Callback
84 #define SbDEBUG_STEPOVER    0x0004          // Additional flag Step Over
85 #define	SbDEBUG_CONTINUE    0x0008          // Do not change flags
86 #define SbDEBUG_STEPOUT     0x0010          // Leave Sub
87 
88 #define SBXID_BASIC         0x6273          // sb: StarBASIC
89 #define	SBXID_BASICMOD      0x6d62          // bm: StarBASIC Module
90 #define SBXID_BASICPROP     0x7262          // pr: StarBASIC Property
91 #define	SBXID_BASICMETHOD   0x6d65          // me: StarBASIC Method
92 #define	SBXID_JSCRIPTMOD    0x6a62          // jm: JavaScript Module
93 #define	SBXID_JSCRIPTMETH   0x6a64          // jm: JavaScript Module
94 
95 #define SBX_HINT_BASICSTART		SFX_HINT_USER04
96 #define SBX_HINT_BASICSTOP		SFX_HINT_USER05
97 
98 // #115826
99 enum PropertyMode
100 {
101 	PROPERTY_MODE_NONE,
102 	PROPERTY_MODE_GET,
103 	PROPERTY_MODE_LET,
104 	PROPERTY_MODE_SET
105 };
106 
107 #endif
108