summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2007-04-11 11:50:47 +0000
committerVladimir Glazounov <vg@openoffice.org>2007-04-11 11:50:47 +0000
commit32b2fa86c42b039452d00ae54ad56f59c3dc7723 (patch)
treef648ab792e127328706553c3a680610f090df97b
parent0dceb28e38f162b5e6eb28a5abb9334f7649e21a (diff)
INTEGRATION: CWS hedaburemove01 (1.1.2); FILE ADDED
2006/12/12 16:41:48 vg 1.1.2.1: #i72503# gathered global includes in one place
-rw-r--r--basic/inc/basic/basrdll.hxx70
-rw-r--r--basic/inc/basic/dispdefs.hxx46
-rw-r--r--basic/inc/basic/hilight.hxx135
-rw-r--r--basic/inc/basic/mybasic.hxx103
4 files changed, 354 insertions, 0 deletions
diff --git a/basic/inc/basic/basrdll.hxx b/basic/inc/basic/basrdll.hxx
new file mode 100644
index 0000000000..7498984108
--- /dev/null
+++ b/basic/inc/basic/basrdll.hxx
@@ -0,0 +1,70 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: basrdll.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: vg $ $Date: 2007-04-11 12:50:13 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _BASRDLL_HXX
+#define _BASRDLL_HXX
+
+class ResMgr;
+
+#ifndef _SV_ACCEL_HXX //autogen
+#include <vcl/accel.hxx>
+#endif
+
+class BasicDLL
+{
+private:
+ ResMgr* pResMgr;
+#if SUPD < 569
+ Accelerator aAcc;
+#endif
+
+ BOOL bDebugMode;
+ BOOL bBreakEnabled;
+
+public:
+ BasicDLL();
+ ~BasicDLL();
+
+ ResMgr* GetResMgr() const { return pResMgr; }
+
+ static void BasicBreak();
+
+ static void EnableBreak( BOOL bEnable );
+ static void SetDebugMode( BOOL bDebugMode );
+};
+
+#define BASIC_DLL() (*(BasicDLL**)GetAppData( SHL_BASIC ) )
+
+#endif //_BASRDLL_HXX
diff --git a/basic/inc/basic/dispdefs.hxx b/basic/inc/basic/dispdefs.hxx
new file mode 100644
index 0000000000..478a1c5748
--- /dev/null
+++ b/basic/inc/basic/dispdefs.hxx
@@ -0,0 +1,46 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: dispdefs.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: vg $ $Date: 2007-04-11 12:50:24 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef _BASIC_DISPDEFS_HXX
+#define _BASIC_DISPDEFS_HXX
+
+#define DH_MODE_DATA_VALID 0x0001 // ModeData (für Kompatibilität mit altem Office)
+
+#define DH_MODE_KURZNAME 0x0002 // Anzeige des Kurznamens (wo möglich) anstatt der UniqueID
+#define DH_MODE_LANGNAME 0x0004 // Langname immer Anzeigen
+#define DH_MODE_ALLWIN 0x0008 // Alle Fenster anzeigen
+#define DH_MODE_SEND_DATA 0x0010 // Daten an Testtool übermitteln
+
+#endif
+
diff --git a/basic/inc/basic/hilight.hxx b/basic/inc/basic/hilight.hxx
new file mode 100644
index 0000000000..86ca633033
--- /dev/null
+++ b/basic/inc/basic/hilight.hxx
@@ -0,0 +1,135 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: hilight.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: vg $ $Date: 2007-04-11 12:50:36 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _SB_HILIGHT_HXX
+#define _SB_HILIGHT_HXX
+
+#ifndef _STRING_HXX //autogen
+#include <tools/string.hxx>
+#endif
+#ifndef _SV_GEN_HXX //autogen
+#include <tools/gen.hxx>
+#endif
+
+#include <svtools/svarray.hxx>
+
+//#include <sbxmod.cxx>
+class SimpleTokenizer_Impl;
+
+// Token-Typen TT_...
+enum TokenTypes
+{
+ TT_UNKNOWN,
+ TT_IDENTIFIER,
+ TT_WHITESPACE,
+ TT_NUMBER,
+ TT_STRING,
+ TT_EOL,
+ TT_COMMENT,
+ TT_ERROR,
+ TT_OPERATOR,
+ TT_KEYWORD
+};
+
+struct HighlightPortion { UINT16 nBegin; UINT16 nEnd; TokenTypes tokenType; };
+
+SV_DECL_VARARR(HighlightPortions, HighlightPortion, 0, 16)
+
+// Sprachmodus des HighLighters (spaeter eventuell feiner
+// differenzieren mit Keyword-Liste, C-Kommentar-Flag)
+enum HighlighterLanguage
+{
+ HIGHLIGHT_BASIC
+};
+
+//*** SyntaxHighlighter-Klasse ***
+// Konzept: Der Highlighter wird ueber alle Aenderungen im Source
+// informiert (notifyChange) und liefert dem Aufrufer jeweils die
+// Information zurueck, welcher Zeilen-Bereich des Source-Codes
+// aufgrund dieser Aenderung neu gehighlighted werden muss.
+// Dazu merkt sich Highlighter intern fuer jede Zeile, ob dort
+// C-Kommentare beginnen oder enden.
+class SyntaxHighlighter
+{
+ HighlighterLanguage eLanguage;
+ SimpleTokenizer_Impl* m_pSimpleTokenizer;
+ char* m_pKeyWords;
+ UINT16 m_nKeyWordCount;
+
+// void initializeKeyWords( HighlighterLanguage eLanguage );
+
+public:
+ SyntaxHighlighter( void );
+ ~SyntaxHighlighter( void );
+
+ // HighLighter (neu) initialisieren, die Zeilen-Tabelle wird
+ // dabei komplett geloescht, d.h. im Abschluss wird von einem
+ // leeren Source ausgegangen. In notifyChange() kann dann
+ // nur Zeile 0 angegeben werden.
+ void initialize( HighlighterLanguage eLanguage_ );
+
+ /**
+ * Aenderung im Source anzeigen
+ * @param nLine = Zeile, in der die Aenderung erfolgt, dies entspricht
+ * der Zeile, in der im Editor der Cursor steht. Index der 1. Zeile ist 0.
+ * @param nLineCountDifference = Anzahl der Zeilen, die im Rahmen der
+ * Aenderung nach nLine eingefuegt (positiver Wert) oder entfernt
+ * (negativer Wert) werden. 0, wenn von der Aenderung nur nLine
+ * betroffen ist.
+ * @param pChangedLines = Array der Zeilen, die von der Aenderung
+ * betroffen sind (das Array enthaelt die geaenderten Zeilen)
+ *
+ * @return Zeilen-Bereich des SourceCodes, dessen Syntax-Higlighting
+ * erneuert werden muss, z.B. weil ein C-Kommentar geoeffnet wurde.
+ */
+ const Range notifyChange( UINT32 nLine, INT32 nLineCountDifference,
+ const String* pChangedLines, UINT32 nArrayLength);
+
+ /**
+ * Higlighting durchfuehren
+ * @param nLine = Zeile, fuer die die Highlight-Tokens geliefert
+ * werden sollen. Index der 1. Zeile ist 0.
+ * @param rLine = Zeile, fuer die die Highlight-Tokens geliefert
+ * werden sollen. als String
+ * @param Ein VarArray von HighlightPortion, in das die Start- und
+ * die End-Indizes und die Typen der Token der Zeile eingetragen werden.
+ */
+ void getHighlightPortions( UINT32 nLine, const String& rLine,
+ /*out*/HighlightPortions& pPortions );
+
+};
+
+#endif
+
diff --git a/basic/inc/basic/mybasic.hxx b/basic/inc/basic/mybasic.hxx
new file mode 100644
index 0000000000..58874c89ac
--- /dev/null
+++ b/basic/inc/basic/mybasic.hxx
@@ -0,0 +1,103 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: mybasic.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: vg $ $Date: 2007-04-11 12:50:47 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _MYBASIC_HXX
+#define _MYBASIC_HXX
+
+#ifndef _SB_SBSTAR_HXX //autogen
+#include <basic/sbstar.hxx>
+#endif
+
+class BasicApp;
+class AppBasEd;
+class ErrorEntry;
+
+class BasicError {
+ AppBasEd* pWin;
+ USHORT nLine, nCol1, nCol2;
+ String aText;
+public:
+ BasicError( AppBasEd*, USHORT, const String&, USHORT, USHORT, USHORT );
+ void Show();
+};
+
+DECLARE_LIST( ErrorList, BasicError* )
+
+#define SBXID_MYBASIC 0x594D // MyBasic: MY
+#define SBXCR_TEST 0x54534554 // TEST
+
+class MyBasic : public StarBASIC
+{
+ SbError nError;
+ virtual BOOL ErrorHdl();
+ virtual USHORT BreakHdl();
+
+protected:
+ Link GenLogHdl();
+ Link GenWinInfoHdl();
+ Link GenModuleWinExistsHdl();
+ Link GenWriteStringHdl();
+
+ virtual void StartListeningTT( SfxBroadcaster &rBroadcaster );
+
+ String GenRealString( const String &aResString );
+
+public:
+ SBX_DECL_PERSIST_NODATA(SBXCR_TEST,SBXID_MYBASIC,1);
+ TYPEINFO();
+ ErrorList aErrors;
+ MyBasic();
+ virtual ~MyBasic();
+ virtual BOOL Compile( SbModule* );
+ void Reset();
+ SbError GetErrors() { return nError; }
+
+ // nicht mit #ifdefs klammern, da diese Headerdatei für testtool und basic
+ // gleichermaßen verwendet wird.
+ SbxObject *pTestObject; // für das Testtool; ansonsten NULL
+
+ virtual void LoadIniFile();
+ virtual SbTextType GetSymbolType( const String &Symbol, BOOL bWasTTControl ); // Besimmt den erweiterten Symboltyp für das Syntaxhighlighting
+ virtual const String GetSpechialErrorText();
+ virtual void ReportRuntimeError( AppBasEd *pEditWin );
+ virtual void DebugFindNoErrors( BOOL bDebugFindNoErrors );
+
+ static void SetCompileModule( SbModule *pMod );
+ static SbModule *GetCompileModule();
+};
+
+SV_DECL_IMPL_REF(MyBasic)
+
+#endif