summaryrefslogtreecommitdiff
path: root/basic/inc/basic
diff options
context:
space:
mode:
Diffstat (limited to 'basic/inc/basic')
-rw-r--r--basic/inc/basic/basicmanagerrepository.hxx149
-rw-r--r--basic/inc/basic/basicrt.hxx82
-rw-r--r--basic/inc/basic/basmgr.hxx262
-rw-r--r--basic/inc/basic/basrdll.hxx62
-rw-r--r--basic/inc/basic/dispdefs.hxx41
-rw-r--r--basic/inc/basic/mybasic.hxx97
-rw-r--r--basic/inc/basic/process.hxx66
-rw-r--r--basic/inc/basic/sbdef.hxx113
-rw-r--r--basic/inc/basic/sberrors.hxx562
-rw-r--r--basic/inc/basic/sbmeth.hxx104
-rw-r--r--basic/inc/basic/sbmod.hxx172
-rw-r--r--basic/inc/basic/sbprop.hxx83
-rw-r--r--basic/inc/basic/sbstar.hxx209
-rw-r--r--basic/inc/basic/sbstdobj.hxx148
-rw-r--r--basic/inc/basic/sbuno.hxx48
-rw-r--r--basic/inc/basic/sbx.hxx372
-rw-r--r--basic/inc/basic/sbxbase.hxx63
-rw-r--r--basic/inc/basic/sbxcore.hxx184
-rw-r--r--basic/inc/basic/sbxdef.hxx383
-rw-r--r--basic/inc/basic/sbxfac.hxx51
-rw-r--r--basic/inc/basic/sbxform.hxx184
-rw-r--r--basic/inc/basic/sbxmeth.hxx65
-rw-r--r--basic/inc/basic/sbxmstrm.hxx52
-rw-r--r--basic/inc/basic/sbxobj.hxx128
-rw-r--r--basic/inc/basic/sbxprop.hxx64
-rw-r--r--basic/inc/basic/sbxvar.hxx508
-rw-r--r--basic/inc/basic/testtool.hxx163
-rw-r--r--basic/inc/basic/ttglobal.hrc52
-rw-r--r--basic/inc/basic/ttstrhlp.hxx77
29 files changed, 4544 insertions, 0 deletions
diff --git a/basic/inc/basic/basicmanagerrepository.hxx b/basic/inc/basic/basicmanagerrepository.hxx
new file mode 100644
index 000000000000..a9e4acf50cdf
--- /dev/null
+++ b/basic/inc/basic/basicmanagerrepository.hxx
@@ -0,0 +1,149 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: basicmanagerrepository.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef BASICMANAGERREPOSITORY_HXX
+#define BASICMANAGERREPOSITORY_HXX
+
+/** === begin UNO includes === **/
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/embed/XStorage.hpp>
+/** === end UNO includes === **/
+
+class BasicManager;
+
+//........................................................................
+namespace basic
+{
+//........................................................................
+
+ //====================================================================
+ //= BasicManagerRepository
+ //====================================================================
+ /** specifies a callback for instances which are interested in BasicManagers
+ created by the BasicManagerRepository.
+ */
+ class SAL_NO_VTABLE BasicManagerCreationListener
+ {
+ public:
+ /** is called when a BasicManager has been created
+
+ @param _rxForDocument
+ denotes the document for which the BasicManager has been created. If this is <NULL/>,
+ then the BasicManager is the application-wide BasicManager.
+
+ @param _pBasicManager
+ denotes the BasicManager which has been created. The listener might for instance
+ decide to add global variables to it, or otherwise initialize it.
+ */
+ virtual void onBasicManagerCreated(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& _rxForDocument,
+ BasicManager& _rBasicManager
+ ) = 0;
+ };
+
+ //====================================================================
+ //= BasicManagerRepository
+ //====================================================================
+ class BasicManagerRepository
+ {
+ public:
+ /** returns the BasicManager belonging to the given document
+
+ If the BasicManager does not yet exist, it is created. In this case, if the application's
+ BasicManager does not yet exist, it is also created. This is necessary since
+ the application's BasicManager acts as parent for all document's BasicManagers.
+
+ If you're interested in this case - the implicit creation of the application's BasicManager -,
+ then you need to register as BasicManagerCreationListener.
+
+ @param _rxDocumentModel
+ denotes the document model whose BasicManager is to be retrieved. Must not be <NULL/>.
+ The document should support the XDocumentInfoSupplier interface, for retrieving
+ its title, which is needed in some error conditions.
+ Also it <em>must</em> support the XStorageBasedDocument interface, since we
+ must be able to retrieve the document's storage. If this interface is <em>not</em>
+ supported, creating a new BasicManager will certainly fail.
+
+ @return
+ the BasicManager for this model.
+
+ @attention
+ The returned BasicManager instances is owned by the repository. In particular,
+ you are not allowed to delete it. Instead, the given model is observed: As soon
+ as it's closed, the associated BasicManager is deleted.
+ */
+ static BasicManager* getDocumentBasicManager(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& _rxDocumentModel
+ );
+
+ /** returns the application-wide BasicManager
+
+ @param _bCreate
+ determines whether the BasicManager should be created (<TRUE/>) if it
+ does not yet exist.
+
+ @attention
+ If the BasicManager is newly created, then it is still owned by the repository.
+ In particular, you are not allowed to delete it. Instead, call resetApplicationBasicManager
+ to release the BasicManager.
+ */
+ static BasicManager* getApplicationBasicManager( bool _bCreate );
+
+ /** resets the application-wide BasicManager to <NULL/>
+ */
+ static void resetApplicationBasicManager();
+
+ /** registers a BasicManagerCreationListener instance which is notified whenever
+ the repository creates a BasicManager instance.
+
+ Note that this listener is <em>not</em> called when somebody else
+ creates BasicManager instances.
+
+ If the same listener is registered multiple times, it is also notified
+ multiple times, and needs to be revoked once for each registration.
+ */
+ static void registerCreationListener(
+ BasicManagerCreationListener& _rListener
+ );
+
+ /** reveokes a BasicManagerCreationListener instance which has previously
+ been registered to be notified about created BasicManager instances.
+ */
+ static void revokeCreationListener(
+ BasicManagerCreationListener& _rListener
+ );
+ };
+
+//........................................................................
+} // namespace basic
+//........................................................................
+
+#endif // BASICMANAGERREPOSITORY_HXX
+
diff --git a/basic/inc/basic/basicrt.hxx b/basic/inc/basic/basicrt.hxx
new file mode 100644
index 000000000000..77dd4bdb6f50
--- /dev/null
+++ b/basic/inc/basic/basicrt.hxx
@@ -0,0 +1,82 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: basicrt.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _BASICRT_HXX
+#define _BASICRT_HXX
+
+#include <tools/string.hxx>
+#include <basic/sbxdef.hxx>
+
+class SbiRuntime;
+class SbErrorStackEntry;
+
+class BasicRuntime
+{
+ SbiRuntime* pRun;
+public:
+ BasicRuntime( SbiRuntime* p ) : pRun ( p ){;}
+ const String GetSourceRevision();
+ const String GetModuleName( SbxNameType nType );
+ const String GetMethodName( SbxNameType nType );
+ xub_StrLen GetLine();
+ xub_StrLen GetCol1();
+ xub_StrLen GetCol2();
+ BOOL IsRun();
+ BOOL IsValid() { return pRun != NULL; }
+ BasicRuntime GetNextRuntime();
+};
+
+class BasicErrorStackEntry
+{
+ SbErrorStackEntry *pEntry;
+public:
+ BasicErrorStackEntry( SbErrorStackEntry *p ) : pEntry ( p ){;}
+ const String GetSourceRevision();
+ const String GetModuleName( SbxNameType nType );
+ const String GetMethodName( SbxNameType nType );
+ xub_StrLen GetLine();
+ xub_StrLen GetCol1();
+ xub_StrLen GetCol2();
+};
+
+class BasicRuntimeAccess
+{
+public:
+ static BasicRuntime GetRuntime();
+ static bool HasRuntime();
+ static USHORT GetStackEntryCount();
+ static BasicErrorStackEntry GetStackEntry( USHORT nIndex );
+ static BOOL HasStack();
+ static void DeleteStack();
+
+ static BOOL IsRunInit();
+};
+
+#endif
+
diff --git a/basic/inc/basic/basmgr.hxx b/basic/inc/basic/basmgr.hxx
new file mode 100644
index 000000000000..277bf6b9c34e
--- /dev/null
+++ b/basic/inc/basic/basmgr.hxx
@@ -0,0 +1,262 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: basmgr.hxx,v $
+ * $Revision: 1.5 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+//
+#ifndef _BASMGR_HXX
+#define _BASMGR_HXX
+
+#include <tools/string.hxx>
+#include <svtools/brdcst.hxx>
+#include <basic/sbstar.hxx>
+#include <com/sun/star/script/XStorageBasedLibraryContainer.hpp>
+#include <com/sun/star/script/XStarBasicAccess.hpp>
+
+
+// Basic XML Import/Export
+com::sun::star::uno::Reference< com::sun::star::script::XStarBasicAccess >
+ getStarBasicAccess( BasicManager* pMgr );
+
+
+
+class SotStorage;
+
+#define BASERR_ID_STDLIBOPEN ERRCODE_BASMGR_STDLIBOPEN
+#define BASERR_ID_STDLIBSAVE ERRCODE_BASMGR_STDLIBSAVE
+#define BASERR_ID_LIBLOAD ERRCODE_BASMGR_LIBLOAD
+#define BASERR_ID_LIBCREATE ERRCODE_BASMGR_LIBCREATE
+#define BASERR_ID_LIBSAVE ERRCODE_BASMGR_LIBSAVE
+#define BASERR_ID_LIBDEL ERRCODE_BASMGR_LIBDEL
+#define BASERR_ID_MGROPEN ERRCODE_BASMGR_MGROPEN
+#define BASERR_ID_MGRSAVE ERRCODE_BASMGR_MGRSAVE
+#define BASERR_ID_REMOVELIB ERRCODE_BASMGR_REMOVELIB
+#define BASERR_ID_UNLOADLIB ERRCODE_BASMGR_UNLOADLIB
+
+#define BASERR_REASON_OPENSTORAGE 0x0001
+#define BASERR_REASON_OPENLIBSTORAGE 0x0002
+#define BASERR_REASON_OPENMGRSTREAM 0x0004
+#define BASERR_REASON_OPENLIBSTREAM 0x0008
+#define BASERR_REASON_LIBNOTFOUND 0x0010
+#define BASERR_REASON_STORAGENOTFOUND 0x0020
+#define BASERR_REASON_BASICLOADERROR 0x0040
+#define BASERR_REASON_NOSTORAGENAME 0x0080
+
+#define BASERR_REASON_STDLIB 0x0100
+
+class BasicError
+{
+private:
+ ULONG nErrorId;
+ USHORT nReason;
+ String aErrStr;
+
+public:
+ BasicError();
+ BasicError( const BasicError& rErr );
+ BasicError( ULONG nId, USHORT nR, const String& rErrStr );
+
+ ULONG GetErrorId() const { return nErrorId; }
+ USHORT GetReason() const { return nReason; }
+ String GetErrorStr() { return aErrStr; }
+
+ void SetErrorId( ULONG n ) { nErrorId = n; }
+ void SetReason( USHORT n ) { nReason = n; }
+ void SetErrorStr( const String& rStr) { aErrStr = rStr; }
+};
+
+
+//
+
+class BasicLibs;
+class ErrorManager;
+class BasicLibInfo;
+class BasicErrorManager;
+namespace basic { class BasicManagerCleaner; }
+
+// Library password handling for 5.0 documents
+class OldBasicPassword
+{
+public:
+ virtual void setLibraryPassword( const String& rLibraryName, const String& rPassword ) = 0;
+ virtual String getLibraryPassword( const String& rLibraryName ) = 0;
+ virtual void clearLibraryPassword( const String& rLibraryName ) = 0;
+ virtual sal_Bool hasLibraryPassword( const String& rLibraryName ) = 0;
+};
+
+struct LibraryContainerInfo
+{
+ ::com::sun::star::uno::Reference< com::sun::star::script::XPersistentLibraryContainer > mxScriptCont;
+ ::com::sun::star::uno::Reference< com::sun::star::script::XPersistentLibraryContainer > mxDialogCont;
+ OldBasicPassword* mpOldBasicPassword;
+
+ LibraryContainerInfo()
+ :mpOldBasicPassword( NULL )
+ {
+ }
+
+ LibraryContainerInfo
+ (
+ com::sun::star::uno::Reference< com::sun::star::script::XPersistentLibraryContainer > xScriptCont,
+ com::sun::star::uno::Reference< com::sun::star::script::XPersistentLibraryContainer > xDialogCont,
+ OldBasicPassword* pOldBasicPassword
+ )
+ : mxScriptCont( xScriptCont )
+ , mxDialogCont( xDialogCont )
+ , mpOldBasicPassword( pOldBasicPassword )
+ {}
+};
+
+struct BasicManagerImpl;
+
+
+#define LIB_NOTFOUND 0xFFFF
+
+class BasicManager : public SfxBroadcaster
+{
+ friend class LibraryContainer_Impl;
+ friend class StarBasicAccess_Impl;
+ friend class BasMgrContainerListenerImpl;
+ friend class ::basic::BasicManagerCleaner;
+
+private:
+ BasicLibs* pLibs;
+ BasicErrorManager* pErrorMgr;
+
+ String aName;
+ String maStorageName;
+ BOOL bBasMgrModified;
+ BOOL mbDocMgr;
+
+ BasicManagerImpl* mpImpl;
+
+ void Init();
+
+protected:
+ BOOL ImpLoadLibary( BasicLibInfo* pLibInfo ) const;
+ BOOL ImpLoadLibary( BasicLibInfo* pLibInfo, SotStorage* pCurStorage, BOOL bInfosOnly = FALSE ) const;
+ void ImpCreateStdLib( StarBASIC* pParentFromStdLib );
+ void ImpMgrNotLoaded( const String& rStorageName );
+ BasicLibInfo* CreateLibInfo();
+ void LoadBasicManager( SotStorage& rStorage, const String& rBaseURL, BOOL bLoadBasics = TRUE );
+ void LoadOldBasicManager( SotStorage& rStorage );
+ BOOL ImplLoadBasic( SvStream& rStrm, StarBASICRef& rOldBasic ) const;
+ BOOL ImplEncryptStream( SvStream& rStream ) const;
+ BasicLibInfo* FindLibInfo( StarBASIC* pBasic ) const;
+ void CheckModules( StarBASIC* pBasic, BOOL bReference ) const;
+ void SetFlagToAllLibs( short nFlag, BOOL bSet ) const;
+ BasicManager(); // Nur zum anpassen von Pfaden bei 'Speichern unter'.
+ ~BasicManager();
+
+public:
+ TYPEINFO();
+ BasicManager( SotStorage& rStorage, const String& rBaseURL, StarBASIC* pParentFromStdLib = NULL, String* pLibPath = NULL, BOOL bDocMgr = FALSE );
+ BasicManager( StarBASIC* pStdLib, String* pLibPath = NULL, BOOL bDocMgr = FALSE );
+
+ /** deletes the given BasicManager instance
+
+ This method is necessary since normally, BasicManager instances are owned by the BasicManagerRepository,
+ and expected to be deleted by the repository only. However, there exists quite some legacy code,
+ which needs to explicitly delete a BasicManager itself. This code must not use the (protected)
+ destructor, but LegacyDeleteBasicManager.
+ */
+ static void LegacyDeleteBasicManager( BasicManager*& _rpManager );
+
+ void SetStorageName( const String& rName ) { maStorageName = rName; }
+ String GetStorageName() const { return maStorageName; }
+ void SetName( const String& rName ) { aName = rName; }
+ String GetName() const { return aName; }
+
+
+ USHORT GetLibCount() const;
+ StarBASIC* GetLib( USHORT nLib ) const;
+ StarBASIC* GetLib( const String& rName ) const;
+ USHORT GetLibId( const String& rName ) const;
+
+ String GetLibName( USHORT nLib );
+
+ /** announces the library containers which belong to this BasicManager
+
+ The method will automatically add two global constants, BasicLibraries and DialogLibraries,
+ to the BasicManager.
+ */
+ void SetLibraryContainerInfo( const LibraryContainerInfo& rInfo );
+
+ const ::com::sun::star::uno::Reference< com::sun::star::script::XPersistentLibraryContainer >&
+ GetDialogLibraryContainer() const;
+ const ::com::sun::star::uno::Reference< com::sun::star::script::XPersistentLibraryContainer >&
+ GetScriptLibraryContainer() const;
+
+ BOOL LoadLib( USHORT nLib );
+ BOOL RemoveLib( USHORT nLib, BOOL bDelBasicFromStorage );
+
+ // Modify-Flag wird nur beim Speichern zurueckgesetzt.
+ BOOL IsModified() const;
+ BOOL IsBasicModified() const;
+
+ BOOL HasErrors();
+ void ClearErrors();
+ BasicError* GetFirstError();
+ BasicError* GetNextError();
+
+ /** sets a global constant in the basic library, referring to some UNO object, to a new value.
+
+ If a constant with this name already existed before, its value is changed, and the old constant is
+ returned. If it does not yet exist, it is newly created, and inserted into the basic library.
+ */
+ ::com::sun::star::uno::Any
+ SetGlobalUNOConstant( const sal_Char* _pAsciiName, const ::com::sun::star::uno::Any& _rValue );
+
+ /** determines whether there are password-protected modules whose size exceedes the
+ legacy module size
+ @param _out_rModuleNames
+ takes the names of modules whose size exceeds the legacy limit
+ */
+ bool LegacyPsswdBinaryLimitExceeded( ::com::sun::star::uno::Sequence< rtl::OUString >& _out_rModuleNames );
+
+private:
+ BOOL IsReference( USHORT nLib );
+
+ BOOL SetLibName( USHORT nLib, const String& rName );
+
+ StarBASIC* GetStdLib() const;
+ StarBASIC* AddLib( SotStorage& rStorage, const String& rLibName, BOOL bReference );
+ BOOL RemoveLib( USHORT nLib );
+ BOOL HasLib( const String& rName ) const;
+
+ StarBASIC* CreateLibForLibContainer( const String& rLibName,
+ const com::sun::star::uno::Reference< com::sun::star::script::XLibraryContainer >&
+ xScriptCont );
+ // For XML import/export:
+ StarBASIC* CreateLib( const String& rLibName );
+ StarBASIC* CreateLib( const String& rLibName, const String& Password,
+ const String& LinkTargetURL );
+};
+
+void SetAppBasicManager( BasicManager* pBasMgr );
+
+#endif //_BASMGR_HXX
diff --git a/basic/inc/basic/basrdll.hxx b/basic/inc/basic/basrdll.hxx
new file mode 100644
index 000000000000..21de147e03c7
--- /dev/null
+++ b/basic/inc/basic/basrdll.hxx
@@ -0,0 +1,62 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: basrdll.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _BASRDLL_HXX
+#define _BASRDLL_HXX
+
+class ResMgr;
+
+#include <vcl/accel.hxx>
+
+class BasicDLL
+{
+private:
+ ResMgr* pSttResMgr;
+ ResMgr* pBasResMgr;
+
+ BOOL bDebugMode;
+ BOOL bBreakEnabled;
+
+public:
+ BasicDLL();
+ ~BasicDLL();
+
+ ResMgr* GetSttResMgr() const { return pSttResMgr; }
+ ResMgr* GetBasResMgr() const { return pBasResMgr; }
+
+ 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 000000000000..e8b9fb211b63
--- /dev/null
+++ b/basic/inc/basic/dispdefs.hxx
@@ -0,0 +1,41 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: dispdefs.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _BASIC_DISPDEFS_HXX
+#define _BASIC_DISPDEFS_HXX
+
+#define DH_MODE_DATA_VALID 0x0001 // ModeData (for compatibility with old Office)
+
+#define DH_MODE_KURZNAME 0x0002 // View short name instead of UniqueID (if possible)
+#define DH_MODE_LANGNAME 0x0004 // Always view long name
+#define DH_MODE_ALLWIN 0x0008 // View all windows
+#define DH_MODE_SEND_DATA 0x0010 // Send data to Testtool
+
+#endif
+
diff --git a/basic/inc/basic/mybasic.hxx b/basic/inc/basic/mybasic.hxx
new file mode 100644
index 000000000000..c441afcea9d2
--- /dev/null
+++ b/basic/inc/basic/mybasic.hxx
@@ -0,0 +1,97 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: mybasic.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _MYBASIC_HXX
+#define _MYBASIC_HXX
+
+#include <basic/sbstar.hxx>
+
+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; }
+
+ // Do not use #ifdefs here because this header file is both used for testtool and basic
+ SbxObject *pTestObject; // for Testool; otherwise NULL
+
+ virtual void LoadIniFile();
+
+ // Determines the extended symbol type for syntax highlighting
+ virtual SbTextType GetSymbolType( const String &Symbol, BOOL bWasTTControl );
+ 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
diff --git a/basic/inc/basic/process.hxx b/basic/inc/basic/process.hxx
new file mode 100644
index 000000000000..a56361f7fe8a
--- /dev/null
+++ b/basic/inc/basic/process.hxx
@@ -0,0 +1,66 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: process.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _PROCESS_HXX
+#define _PROCESS_HXX
+
+#include <tools/string.hxx>
+#include <vos/process.hxx>
+
+#include <map>
+
+typedef std::map< String, String > Environment;
+typedef Environment::value_type EnvironmentVariable;
+
+class Process
+{
+ // Internal members and methods
+ NAMESPACE_VOS(OArgumentList) *pArgumentList;
+ NAMESPACE_VOS(OEnvironment) *pEnvList;
+ NAMESPACE_VOS(OProcess) *pProcess;
+ BOOL ImplIsRunning();
+ long ImplGetExitCode();
+ BOOL bWasGPF;
+ BOOL bHasBeenStarted;
+
+public:
+ Process();
+ ~Process();
+ // Methoden
+ void SetImage( const String &aAppPath, const String &aAppParams, const Environment *pEnv = NULL );
+ BOOL Start();
+ ULONG GetExitCode();
+ BOOL IsRunning();
+ BOOL WasGPF();
+
+ BOOL Terminate();
+};
+
+#endif
diff --git a/basic/inc/basic/sbdef.hxx b/basic/inc/basic/sbdef.hxx
new file mode 100644
index 000000000000..dbb6e703b0c6
--- /dev/null
+++ b/basic/inc/basic/sbdef.hxx
@@ -0,0 +1,113 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sbdef.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SB_SBDEF_HXX
+#define _SB_SBDEF_HXX
+
+#include <basic/sbxdef.hxx>
+#include <svtools/svarray.hxx>
+
+#define _BASIC_TEXTPORTIONS
+
+// Type of a text token (syntax highlighting)
+enum SbTextType
+{
+ SB_KEYWORD = 1, // Keywords
+ SB_SYMBOL, // Symbols
+ SB_STRING, // Strings
+ SB_NUMBER, // Numbers
+ SB_PUNCTUATION, // Brackets, points, etc.
+ SB_COMMENT, // Comments
+ SB_DUMMY = 255 // workaround for #i31479
+};
+
+// Active language
+enum SbLanguageMode
+{
+ SB_LANG_GLOBAL, // As in SbiGlobals struct
+ SB_LANG_BASIC, // StarBasic (Default)
+ SB_LANG_VBSCRIPT, // Visual-Basic-Script
+ SB_LANG_JAVASCRIPT // JavaScript
+};
+
+#ifdef _BASIC_TEXTPORTIONS
+struct SbTextPortion
+{ // Syntax Highlighting: a text portion
+ xub_StrLen nLine; // Line number
+ xub_StrLen nStart, nEnd; // 1st and last column
+ SbTextType eType; // Type of the portion
+};
+
+SV_DECL_VARARR(SbTextPortions, SbTextPortion,16,16)
+#else
+class SbTextPortions;
+#endif
+
+// Returns type name for Basic type, array flag is ignored
+// implementation: basic/source/runtime/methods.cxx
+String getBasicTypeName( SbxDataType eType );
+
+// Returns type name for Basic objects, especially
+// important for SbUnoObj instances
+// implementation: basic/source/classes/sbunoobj.cxx
+class SbxObject;
+String getBasicObjectTypeName( SbxObject* pObj );
+
+// Allows Basic IDE to set watch mode to suppress errors
+// implementation: basic/source/runtime/runtime.cxx
+void setBasicWatchMode( bool bOn );
+
+// Debug Flags:
+#define SbDEBUG_BREAK 0x0001 // Break-Callback
+#define SbDEBUG_STEPINTO 0x0002 // Single Step-Callback
+#define SbDEBUG_STEPOVER 0x0004 // Additional flag Step Over
+#define SbDEBUG_CONTINUE 0x0008 // Do not change flags
+#define SbDEBUG_STEPOUT 0x0010 // Leave Sub
+
+#define SBXID_BASIC 0x6273 // sb: StarBASIC
+#define SBXID_BASICMOD 0x6d62 // bm: StarBASIC Module
+#define SBXID_BASICPROP 0x7262 // pr: StarBASIC Property
+#define SBXID_BASICMETHOD 0x6d65 // me: StarBASIC Method
+#define SBXID_JSCRIPTMOD 0x6a62 // jm: JavaScript Module
+#define SBXID_JSCRIPTMETH 0x6a64 // jm: JavaScript Module
+
+#define SBX_HINT_BASICSTART SFX_HINT_USER04
+#define SBX_HINT_BASICSTOP SFX_HINT_USER05
+
+// #115826
+enum PropertyMode
+{
+ PROPERTY_MODE_NONE,
+ PROPERTY_MODE_GET,
+ PROPERTY_MODE_LET,
+ PROPERTY_MODE_SET
+};
+
+#endif
diff --git a/basic/inc/basic/sberrors.hxx b/basic/inc/basic/sberrors.hxx
new file mode 100644
index 000000000000..75fd3bd193e7
--- /dev/null
+++ b/basic/inc/basic/sberrors.hxx
@@ -0,0 +1,562 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sberrors.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SB_SBERRORS_HXX
+#define _SB_SBERRORS_HXX
+
+#include <basic/sbxdef.hxx>
+
+#ifndef __RSC
+typedef ULONG SbError;
+#endif
+
+// Mapping to SbxError
+#define ERRCODE_BASIC_SYNTAX ERRCODE_SBX_SYNTAX // unspecified syntax error
+#define ERRCODE_BASIC_BAD_ARGUMENT ERRCODE_SBX_NOTIMP // Invalid procedure call
+#define ERRCODE_BASIC_MATH_OVERFLOW ERRCODE_SBX_OVERFLOW // Overflow
+#define ERRCODE_BASIC_OUT_OF_RANGE ERRCODE_SBX_BOUNDS // Subscript out of range
+#define ERRCODE_BASIC_ZERODIV ERRCODE_SBX_ZERODIV // Division by zero
+#define ERRCODE_BASIC_CONVERSION ERRCODE_SBX_CONVERSION // Type mismatch
+#define ERRCODE_BASIC_BAD_PARAMETER ERRCODE_SBX_BAD_PARAMETER // Invalid Parameter
+#define ERRCODE_BASIC_PROC_UNDEFINED ERRCODE_SBX_PROC_UNDEFINED // Sub or Function not defined
+#define ERRCODE_BASIC_INTERNAL_ERROR ERRCODE_SBX_ERROR // internal error
+#define ERRCODE_BASIC_NO_OBJECT ERRCODE_SBX_NO_OBJECT // Object variable not set
+#define ERRCODE_BASIC_CANNOT_LOAD ERRCODE_SBX_CANNOT_LOAD // Can't load module
+#define ERRCODE_BASIC_BAD_INDEX ERRCODE_SBX_BAD_INDEX // Invalid object index
+#define ERRCODE_BASIC_NO_ACTIVE_OBJECT ERRCODE_SBX_NO_ACTIVE_OBJECT // No active view or document
+#define ERRCODE_BASIC_BAD_PROP_VALUE ERRCODE_SBX_BAD_PROP_VALUE // Bad property value
+#define ERRCODE_BASIC_PROP_READONLY ERRCODE_SBX_PROP_READONLY // Property is read only
+#define ERRCODE_BASIC_PROP_WRITEONLY ERRCODE_SBX_PROP_WRITEONLY // Property is write only
+#define ERRCODE_BASIC_INVALID_OBJECT ERRCODE_SBX_INVALID_OBJECT // Invalid object reference
+#define ERRCODE_BASIC_NO_METHOD ERRCODE_SBX_NO_METHOD // Property or method not found
+#define ERRCODE_BASIC_INVALID_USAGE_OBJECT ERRCODE_SBX_INVALID_USAGE_OBJECT // Invalid usee of object
+#define ERRCODE_BASIC_NO_OLE ERRCODE_SBX_NO_OLE // Class does not support OLE
+#define ERRCODE_BASIC_BAD_METHOD ERRCODE_SBX_BAD_METHOD // Object doesn't support method
+#define ERRCODE_BASIC_OLE_ERROR ERRCODE_SBX_OLE_ERROR // OLE Automation error
+#define ERRCODE_BASIC_BAD_ACTION ERRCODE_SBX_BAD_ACTION // Object doesn't support this action
+#define ERRCODE_BASIC_NO_NAMED_ARGS ERRCODE_SBX_NO_NAMED_ARGS // Object doesn't support named args
+#define ERRCODE_BASIC_BAD_LOCALE ERRCODE_SBX_BAD_LOCALE // Object doesn't support current locale setting
+#define ERRCODE_BASIC_NAMED_NOT_FOUND ERRCODE_SBX_NAMED_NOT_FOUND // Named argument not found
+#define ERRCODE_BASIC_NOT_OPTIONAL ERRCODE_SBX_NOT_OPTIONAL // Argument not optional
+#define ERRCODE_BASIC_WRONG_ARGS ERRCODE_SBX_WRONG_ARGS // Wrong number of arguments
+#define ERRCODE_BASIC_NOT_A_COLL ERRCODE_SBX_NOT_A_COLL // Object not a collection
+
+// Append Basic specific error messages to ERRCODE_AREA_SBX
+#define ERRCODE_BASIC_NO_GOSUB ((LAST_SBX_ERROR_ID+1UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Return without Gosub
+#define ERRCODE_BASIC_REDO_FROM_START ((LAST_SBX_ERROR_ID+2UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Redo form start (SB internal)
+#define ERRCODE_BASIC_NO_MEMORY ((LAST_SBX_ERROR_ID+3UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Out of memory
+#define ERRCODE_BASIC_ALREADY_DIM ((LAST_SBX_ERROR_ID+4UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Array already dimensioned
+#define ERRCODE_BASIC_DUPLICATE_DEF ((LAST_SBX_ERROR_ID+5UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Duplicate definition
+#define ERRCODE_BASIC_VAR_UNDEFINED ((LAST_SBX_ERROR_ID+6UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Variable undefined (SB)
+#define ERRCODE_BASIC_USER_ABORT ((LAST_SBX_ERROR_ID+7UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // User interrupt occurred
+#define ERRCODE_BASIC_BAD_RESUME ((LAST_SBX_ERROR_ID+8UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Resume without error
+#define ERRCODE_BASIC_STACK_OVERFLOW ((LAST_SBX_ERROR_ID+9UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Out of stack space
+#define ERRCODE_BASIC_BAD_DLL_LOAD ((LAST_SBX_ERROR_ID+10UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Error in loading DLL
+#define ERRCODE_BASIC_BAD_DLL_CALL ((LAST_SBX_ERROR_ID+11UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Bad DLL calling convention
+#define ERRCODE_BASIC_BAD_CHANNEL ((LAST_SBX_ERROR_ID+12UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Bad file name or number
+#define ERRCODE_BASIC_FILE_NOT_FOUND ((LAST_SBX_ERROR_ID+13UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // File not found
+#define ERRCODE_BASIC_BAD_FILE_MODE ((LAST_SBX_ERROR_ID+14UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Bad file mode
+#define ERRCODE_BASIC_FILE_ALREADY_OPEN ((LAST_SBX_ERROR_ID+15UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // File already open
+#define ERRCODE_BASIC_IO_ERROR ((LAST_SBX_ERROR_ID+16UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Device I/O error
+#define ERRCODE_BASIC_FILE_EXISTS ((LAST_SBX_ERROR_ID+17UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // File already exists
+#define ERRCODE_BASIC_BAD_RECORD_LENGTH ((LAST_SBX_ERROR_ID+18UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // bad record length
+#define ERRCODE_BASIC_DISK_FULL ((LAST_SBX_ERROR_ID+19UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // disk full
+#define ERRCODE_BASIC_READ_PAST_EOF ((LAST_SBX_ERROR_ID+20UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Input past end of file
+#define ERRCODE_BASIC_BAD_RECORD_NUMBER ((LAST_SBX_ERROR_ID+21UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Bad record number
+#define ERRCODE_BASIC_TOO_MANY_FILES ((LAST_SBX_ERROR_ID+22UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Too many files
+#define ERRCODE_BASIC_NO_DEVICE ((LAST_SBX_ERROR_ID+23UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Device not available
+#define ERRCODE_BASIC_ACCESS_DENIED ((LAST_SBX_ERROR_ID+24UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Permission denied
+#define ERRCODE_BASIC_NOT_READY ((LAST_SBX_ERROR_ID+25UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Disk not ready
+#define ERRCODE_BASIC_NOT_IMPLEMENTED ((LAST_SBX_ERROR_ID+26UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Feature not implemented
+#define ERRCODE_BASIC_DIFFERENT_DRIVE ((LAST_SBX_ERROR_ID+27UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // No rename with different drive
+#define ERRCODE_BASIC_ACCESS_ERROR ((LAST_SBX_ERROR_ID+28UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Path/File access error
+#define ERRCODE_BASIC_PATH_NOT_FOUND ((LAST_SBX_ERROR_ID+29UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Path not found
+#define ERRCODE_BASIC_BAD_PATTERN ((LAST_SBX_ERROR_ID+30UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Invalid pattern string
+#define ERRCODE_BASIC_IS_NULL ((LAST_SBX_ERROR_ID+31UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Invalid use of Null
+
+// DDE messages from 250-299
+#define ERRCODE_BASIC_DDE_ERROR ((LAST_SBX_ERROR_ID+32UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_WAITINGACK ((LAST_SBX_ERROR_ID+33UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_OUTOFCHANNELS ((LAST_SBX_ERROR_ID+34UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_NO_RESPONSE ((LAST_SBX_ERROR_ID+35UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_MULT_RESPONSES ((LAST_SBX_ERROR_ID+36UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_CHANNEL_LOCKED ((LAST_SBX_ERROR_ID+37UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_NOTPROCESSED ((LAST_SBX_ERROR_ID+38UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_TIMEOUT ((LAST_SBX_ERROR_ID+39UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_USER_INTERRUPT ((LAST_SBX_ERROR_ID+40UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_BUSY ((LAST_SBX_ERROR_ID+41UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_NO_DATA ((LAST_SBX_ERROR_ID+42UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_WRONG_DATA_FORMAT ((LAST_SBX_ERROR_ID+43UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_PARTNER_QUIT ((LAST_SBX_ERROR_ID+44UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_CONV_CLOSED ((LAST_SBX_ERROR_ID+45UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_NO_CHANNEL ((LAST_SBX_ERROR_ID+46UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_INVALID_LINK ((LAST_SBX_ERROR_ID+47UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_QUEUE_OVERFLOW ((LAST_SBX_ERROR_ID+48UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_LINK_ALREADY_EST ((LAST_SBX_ERROR_ID+49UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_LINK_INV_TOPIC ((LAST_SBX_ERROR_ID+50UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+#define ERRCODE_BASIC_DDE_DLL_NOT_FOUND ((LAST_SBX_ERROR_ID+51UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+
+#define ERRCODE_BASIC_NEEDS_OBJECT ((LAST_SBX_ERROR_ID+52UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Object required
+#define ERRCODE_BASIC_BAD_ORDINAL ((LAST_SBX_ERROR_ID+53UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Invalid ordinal
+#define ERRCODE_BASIC_DLLPROC_NOT_FOUND ((LAST_SBX_ERROR_ID+54UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Specified DLL function not found
+#define ERRCODE_BASIC_BAD_CLIPBD_FORMAT ((LAST_SBX_ERROR_ID+55UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Invalid clipboard format
+
+// Debugger messages from 700-799
+
+#define ERRCODE_BASIC_PROPERTY_NOT_FOUND ((LAST_SBX_ERROR_ID+56UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Class not have property
+#define ERRCODE_BASIC_METHOD_NOT_FOUND ((LAST_SBX_ERROR_ID+57UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Class does not have method
+#define ERRCODE_BASIC_ARG_MISSING ((LAST_SBX_ERROR_ID+58UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Missing required argument
+#define ERRCODE_BASIC_BAD_NUMBER_OF_ARGS ((LAST_SBX_ERROR_ID+59UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Bad number of arguments
+#define ERRCODE_BASIC_METHOD_FAILED ((LAST_SBX_ERROR_ID+60UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Method failed
+#define ERRCODE_BASIC_SETPROP_FAILED ((LAST_SBX_ERROR_ID+61UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Unable to set property
+#define ERRCODE_BASIC_GETPROP_FAILED ((LAST_SBX_ERROR_ID+62UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Unable to get property
+
+// Compiler Errors (do not occure at runtime)
+// These IDs can shift at any time
+
+#define ERRCODE_BASIC_UNEXPECTED ((LAST_SBX_ERROR_ID+63UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Unexpected symbol: xx
+// #define ERRCODE_BASIC_COMPILER_BGN ERRCODE_BASIC_UNEXPECTED
+#define ERRCODE_BASIC_EXPECTED ((LAST_SBX_ERROR_ID+64UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Expected: xx
+#define ERRCODE_BASIC_SYMBOL_EXPECTED ((LAST_SBX_ERROR_ID+65UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Symbol expected
+#define ERRCODE_BASIC_VAR_EXPECTED ((LAST_SBX_ERROR_ID+66UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Variable expected
+#define ERRCODE_BASIC_LABEL_EXPECTED ((LAST_SBX_ERROR_ID+67UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Label expected
+#define ERRCODE_BASIC_LVALUE_EXPECTED ((LAST_SBX_ERROR_ID+68UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Lvalue expected
+#define ERRCODE_BASIC_VAR_DEFINED ((LAST_SBX_ERROR_ID+69UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Variable xxx already defined
+#define ERRCODE_BASIC_PROC_DEFINED ((LAST_SBX_ERROR_ID+70UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Procedure xx already defined
+#define ERRCODE_BASIC_LABEL_DEFINED ((LAST_SBX_ERROR_ID+71UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Label xxx already defined
+#define ERRCODE_BASIC_UNDEF_VAR ((LAST_SBX_ERROR_ID+72UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Variable xx undefined
+#define ERRCODE_BASIC_UNDEF_ARRAY ((LAST_SBX_ERROR_ID+73UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Array or function xx undefined
+#define ERRCODE_BASIC_UNDEF_PROC ((LAST_SBX_ERROR_ID+74UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Procedure xxx undefined
+#define ERRCODE_BASIC_UNDEF_LABEL ((LAST_SBX_ERROR_ID+75UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Label xxx undefined
+#define ERRCODE_BASIC_UNDEF_TYPE ((LAST_SBX_ERROR_ID+76UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Unknown user defined type xxx
+#define ERRCODE_BASIC_BAD_EXIT ((LAST_SBX_ERROR_ID+77UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Exit XXX expected
+#define ERRCODE_BASIC_BAD_BLOCK ((LAST_SBX_ERROR_ID+78UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Unterminated statement block: missing XX
+#define ERRCODE_BASIC_BAD_BRACKETS ((LAST_SBX_ERROR_ID+79UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Parentheses do not match
+#define ERRCODE_BASIC_BAD_DECLARATION ((LAST_SBX_ERROR_ID+80UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Symbol xx defined differently
+#define ERRCODE_BASIC_BAD_PARAMETERS ((LAST_SBX_ERROR_ID+81UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Parameters do not match
+#define ERRCODE_BASIC_BAD_CHAR_IN_NUMBER ((LAST_SBX_ERROR_ID+82UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Bad character in number
+#define ERRCODE_BASIC_MUST_HAVE_DIMS ((LAST_SBX_ERROR_ID+83UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Array needs dimensioning
+#define ERRCODE_BASIC_NO_IF ((LAST_SBX_ERROR_ID+84UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Else/Endif without If
+#define ERRCODE_BASIC_NOT_IN_SUBR ((LAST_SBX_ERROR_ID+85UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // xxx not allowed within a sub
+#define ERRCODE_BASIC_NOT_IN_MAIN ((LAST_SBX_ERROR_ID+86UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // xxx not allowed outside a sub
+#define ERRCODE_BASIC_WRONG_DIMS ((LAST_SBX_ERROR_ID+87UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Dimensions do not match
+#define ERRCODE_BASIC_BAD_OPTION ((LAST_SBX_ERROR_ID+88UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Unknown option: xxx
+#define ERRCODE_BASIC_CONSTANT_REDECLARED ((LAST_SBX_ERROR_ID+89UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Constant xx redeclared
+#define ERRCODE_BASIC_PROG_TOO_LARGE ((LAST_SBX_ERROR_ID+90UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Program is too large
+#define ERRCODE_BASIC_NO_STRINGS_ARRAYS ((LAST_SBX_ERROR_ID+91UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER)
+
+#define ERRCODE_BASIC_EXCEPTION ((LAST_SBX_ERROR_ID+92UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME)
+
+#define ERRCODE_BASMGR_STDLIBOPEN (LAST_SBX_ERROR_ID+93UL) | ERRCODE_AREA_SBX
+#define ERRCODE_BASMGR_STDLIBSAVE (LAST_SBX_ERROR_ID+94UL) | ERRCODE_AREA_SBX
+#define ERRCODE_BASMGR_LIBLOAD (LAST_SBX_ERROR_ID+95UL) | ERRCODE_AREA_SBX
+#define ERRCODE_BASMGR_LIBCREATE (LAST_SBX_ERROR_ID+96UL) | ERRCODE_AREA_SBX
+#define ERRCODE_BASMGR_LIBSAVE (LAST_SBX_ERROR_ID+97UL) | ERRCODE_AREA_SBX
+#define ERRCODE_BASMGR_LIBDEL (LAST_SBX_ERROR_ID+98UL) | ERRCODE_AREA_SBX
+#define ERRCODE_BASMGR_MGROPEN (LAST_SBX_ERROR_ID+99UL) | ERRCODE_AREA_SBX
+#define ERRCODE_BASMGR_MGRSAVE (LAST_SBX_ERROR_ID+100UL) | ERRCODE_AREA_SBX
+#define ERRCODE_BASMGR_REMOVELIB (LAST_SBX_ERROR_ID+101UL) | ERRCODE_AREA_SBX
+#define ERRCODE_BASMGR_UNLOADLIB (LAST_SBX_ERROR_ID+102UL) | ERRCODE_AREA_SBX
+
+#define ERRCODE_BASIC_ARRAY_FIX ((LAST_SBX_ERROR_ID+104UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // This array is fixed
+#define ERRCODE_BASIC_STRING_OVERFLOW ((LAST_SBX_ERROR_ID+105UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Out of string space
+#define ERRCODE_BASIC_EXPR_TOO_COMPLEX ((LAST_SBX_ERROR_ID+106UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Expression too complex
+#define ERRCODE_BASIC_OPER_NOT_PERFORM ((LAST_SBX_ERROR_ID+107UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Can't perform requested operation
+#define ERRCODE_BASIC_TOO_MANY_DLL ((LAST_SBX_ERROR_ID+108UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Too many dll application clients
+#define ERRCODE_BASIC_LOOP_NOT_INIT ((LAST_SBX_ERROR_ID+109UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // For loop not initialized
+
+// Map old codes to new codes
+#define SbERR_SYNTAX ERRCODE_BASIC_SYNTAX
+#define SbERR_NO_GOSUB ERRCODE_BASIC_NO_GOSUB
+#define SbERR_REDO_FROM_START ERRCODE_BASIC_REDO_FROM_START
+#define SbERR_BAD_ARGUMENT ERRCODE_BASIC_BAD_ARGUMENT
+#define SbERR_MATH_OVERFLOW ERRCODE_BASIC_MATH_OVERFLOW
+#define SbERR_NO_MEMORY ERRCODE_BASIC_NO_MEMORY
+#define SbERR_ALREADY_DIM ERRCODE_BASIC_ALREADY_DIM
+#define SbERR_OUT_OF_RANGE ERRCODE_BASIC_OUT_OF_RANGE
+#define SbERR_DUPLICATE_DEF ERRCODE_BASIC_DUPLICATE_DEF
+#define SbERR_ZERODIV ERRCODE_BASIC_ZERODIV
+#define SbERR_VAR_UNDEFINED ERRCODE_BASIC_VAR_UNDEFINED
+#define SbERR_CONVERSION ERRCODE_BASIC_CONVERSION
+#define SbERR_BAD_PARAMETER ERRCODE_BASIC_BAD_PARAMETER
+#define SbERR_USER_ABORT ERRCODE_BASIC_USER_ABORT
+#define SbERR_BAD_RESUME ERRCODE_BASIC_BAD_RESUME
+#define SbERR_STACK_OVERFLOW ERRCODE_BASIC_STACK_OVERFLOW
+#define SbERR_PROC_UNDEFINED ERRCODE_BASIC_PROC_UNDEFINED
+#define SbERR_BAD_DLL_LOAD ERRCODE_BASIC_BAD_DLL_LOAD
+#define SbERR_BAD_DLL_CALL ERRCODE_BASIC_BAD_DLL_CALL
+#define SbERR_INTERNAL_ERROR ERRCODE_BASIC_INTERNAL_ERROR
+#define SbERR_BAD_CHANNEL ERRCODE_BASIC_BAD_CHANNEL
+#define SbERR_FILE_NOT_FOUND ERRCODE_BASIC_FILE_NOT_FOUND
+#define SbERR_BAD_FILE_MODE ERRCODE_BASIC_BAD_FILE_MODE
+#define SbERR_FILE_ALREADY_OPEN ERRCODE_BASIC_FILE_ALREADY_OPEN
+#define SbERR_IO_ERROR ERRCODE_BASIC_IO_ERROR
+#define SbERR_FILE_EXISTS ERRCODE_BASIC_FILE_EXISTS
+#define SbERR_BAD_RECORD_LENGTH ERRCODE_BASIC_BAD_RECORD_LENGTH
+#define SbERR_DISK_FULL ERRCODE_BASIC_DISK_FULL
+#define SbERR_READ_PAST_EOF ERRCODE_BASIC_READ_PAST_EOF
+#define SbERR_BAD_RECORD_NUMBER ERRCODE_BASIC_BAD_RECORD_NUMBER
+#define SbERR_TOO_MANY_FILES ERRCODE_BASIC_TOO_MANY_FILES
+#define SbERR_NO_DEVICE ERRCODE_BASIC_NO_DEVICE
+#define SbERR_ACCESS_DENIED ERRCODE_BASIC_ACCESS_DENIED
+#define SbERR_NOT_READY ERRCODE_BASIC_NOT_READY
+#define SbERR_NOT_IMPLEMENTED ERRCODE_BASIC_NOT_IMPLEMENTED
+#define SbERR_DIFFERENT_DRIVE ERRCODE_BASIC_DIFFERENT_DRIVE
+#define SbERR_ACCESS_ERROR ERRCODE_BASIC_ACCESS_ERROR
+#define SbERR_PATH_NOT_FOUND ERRCODE_BASIC_PATH_NOT_FOUND
+#define SbERR_NO_OBJECT ERRCODE_BASIC_NO_OBJECT
+#define SbERR_BAD_PATTERN ERRCODE_BASIC_BAD_PATTERN
+#define SBERR_IS_NULL ERRCODE_BASIC_IS_NULL
+#define SbERR_DDE_ERROR ERRCODE_BASIC_DDE_ERROR
+#define SbERR_DDE_WAITINGACK ERRCODE_BASIC_DDE_WAITINGACK
+#define SbERR_DDE_OUTOFCHANNELS ERRCODE_BASIC_DDE_OUTOFCHANNELS
+#define SbERR_DDE_NO_RESPONSE ERRCODE_BASIC_DDE_NO_RESPONSE
+#define SbERR_DDE_MULT_RESPONSES ERRCODE_BASIC_DDE_MULT_RESPONSES
+#define SbERR_DDE_CHANNEL_LOCKED ERRCODE_BASIC_DDE_CHANNEL_LOCKED
+#define SbERR_DDE_NOTPROCESSED ERRCODE_BASIC_DDE_NOTPROCESSED
+#define SbERR_DDE_TIMEOUT ERRCODE_BASIC_DDE_TIMEOUT
+#define SbERR_DDE_USER_INTERRUPT ERRCODE_BASIC_DDE_USER_INTERRUPT
+#define SbERR_DDE_BUSY ERRCODE_BASIC_DDE_BUSY
+#define SbERR_DDE_NO_DATA ERRCODE_BASIC_DDE_NO_DATA
+#define SbERR_DDE_WRONG_DATA_FORMAT ERRCODE_BASIC_DDE_WRONG_DATA_FORMAT
+#define SbERR_DDE_PARTNER_QUIT ERRCODE_BASIC_DDE_PARTNER_QUIT
+#define SbERR_DDE_CONV_CLOSED ERRCODE_BASIC_DDE_CONV_CLOSED
+#define SbERR_DDE_NO_CHANNEL ERRCODE_BASIC_DDE_NO_CHANNEL
+#define SbERR_DDE_INVALID_LINK ERRCODE_BASIC_DDE_INVALID_LINK
+#define SbERR_DDE_QUEUE_OVERFLOW ERRCODE_BASIC_DDE_QUEUE_OVERFLOW
+#define SbERR_DDE_LINK_ALREADY_EST ERRCODE_BASIC_DDE_LINK_ALREADY_EST
+#define SbERR_DDE_LINK_INV_TOPIC ERRCODE_BASIC_DDE_LINK_INV_TOPIC
+#define SbERR_DDE_DLL_NOT_FOUND ERRCODE_BASIC_DDE_DLL_NOT_FOUND
+#define SbERR_CANNOT_LOAD ERRCODE_BASIC_CANNOT_LOAD
+#define SbERR_BAD_INDEX ERRCODE_BASIC_BAD_INDEX
+#define SbERR_NO_ACTIVE_OBJECT ERRCODE_BASIC_NO_ACTIVE_OBJECT
+#define SbERR_BAD_PROP_VALUE ERRCODE_BASIC_BAD_PROP_VALUE
+#define SbERR_PROP_READONLY ERRCODE_BASIC_PROP_READONLY
+#define SbERR_PROP_WRITEONLY ERRCODE_BASIC_PROP_WRITEONLY
+#define SbERR_INVALID_OBJECT ERRCODE_BASIC_INVALID_OBJECT
+#define SbERR_NO_METHOD ERRCODE_BASIC_NO_METHOD
+#define SbERR_NEEDS_OBJECT ERRCODE_BASIC_NEEDS_OBJECT
+#define SbERR_INVALID_USAGE_OBJECT ERRCODE_BASIC_INVALID_USAGE_OBJECT
+#define SbERR_NO_OLE ERRCODE_BASIC_NO_OLE
+#define SbERR_BAD_METHOD ERRCODE_BASIC_BAD_METHOD
+#define SbERR_OLE_ERROR ERRCODE_BASIC_OLE_ERROR
+#define SbERR_BAD_ACTION ERRCODE_BASIC_BAD_ACTION
+#define SbERR_NO_NAMED_ARGS ERRCODE_BASIC_NO_NAMED_ARGS
+#define SbERR_BAD_LOCALE ERRCODE_BASIC_BAD_LOCALE
+#define SbERR_NAMED_NOT_FOUND ERRCODE_BASIC_NAMED_NOT_FOUND
+#define SbERR_NOT_OPTIONAL ERRCODE_BASIC_NOT_OPTIONAL
+#define SbERR_WRONG_ARGS ERRCODE_BASIC_WRONG_ARGS
+#define SbERR_NOT_A_COLL ERRCODE_BASIC_NOT_A_COLL
+#define SbERR_BAD_ORDINAL ERRCODE_BASIC_BAD_ORDINAL
+#define SbERR_DLLPROC_NOT_FOUND ERRCODE_BASIC_DLLPROC_NOT_FOUND
+#define SbERR_BAD_CLIPBD_FORMAT ERRCODE_BASIC_BAD_CLIPBD_FORMAT
+#define SbERR_PROPERTY_NOT_FOUND ERRCODE_BASIC_PROPERTY_NOT_FOUND
+#define SbERR_METHOD_NOT_FOUND ERRCODE_BASIC_METHOD_NOT_FOUND
+#define SbERR_ARG_MISSING ERRCODE_BASIC_ARG_MISSING
+#define SbERR_BAD_NUMBER_OF_ARGS ERRCODE_BASIC_BAD_NUMBER_OF_ARGS
+#define SbERR_METHOD_FAILED ERRCODE_BASIC_METHOD_FAILED
+#define SbERR_SETPROP_FAILED ERRCODE_BASIC_SETPROP_FAILED
+#define SbERR_GETPROP_FAILED ERRCODE_BASIC_GETPROP_FAILED
+// #define SbERR_COMPILER_BGN ERRCODE_BASIC_COMPILER_BGN
+#define SbERR_UNEXPECTED ERRCODE_BASIC_UNEXPECTED
+#define SbERR_EXPECTED ERRCODE_BASIC_EXPECTED
+#define SbERR_SYMBOL_EXPECTED ERRCODE_BASIC_SYMBOL_EXPECTED
+#define SbERR_VAR_EXPECTED ERRCODE_BASIC_VAR_EXPECTED
+#define SbERR_LABEL_EXPECTED ERRCODE_BASIC_LABEL_EXPECTED
+#define SbERR_LVALUE_EXPECTED ERRCODE_BASIC_LVALUE_EXPECTED
+#define SbERR_VAR_DEFINED ERRCODE_BASIC_VAR_DEFINED
+#define SbERR_PROC_DEFINED ERRCODE_BASIC_PROC_DEFINED
+#define SbERR_LABEL_DEFINED ERRCODE_BASIC_LABEL_DEFINED
+#define SbERR_UNDEF_VAR ERRCODE_BASIC_UNDEF_VAR
+#define SbERR_UNDEF_ARRAY ERRCODE_BASIC_UNDEF_ARRAY
+#define SbERR_UNDEF_PROC ERRCODE_BASIC_UNDEF_PROC
+#define SbERR_UNDEF_LABEL ERRCODE_BASIC_UNDEF_LABEL
+#define SbERR_UNDEF_TYPE ERRCODE_BASIC_UNDEF_TYPE
+#define SbERR_BAD_EXIT ERRCODE_BASIC_BAD_EXIT
+#define SbERR_BAD_BLOCK ERRCODE_BASIC_BAD_BLOCK
+#define SbERR_BAD_BRACKETS ERRCODE_BASIC_BAD_BRACKETS
+#define SbERR_BAD_DECLARATION ERRCODE_BASIC_BAD_DECLARATION
+#define SbERR_BAD_PARAMETERS ERRCODE_BASIC_BAD_PARAMETERS
+#define SbERR_BAD_CHAR_IN_NUMBER ERRCODE_BASIC_BAD_CHAR_IN_NUMBER
+#define SbERR_MUST_HAVE_DIMS ERRCODE_BASIC_MUST_HAVE_DIMS
+#define SbERR_NO_IF ERRCODE_BASIC_NO_IF
+#define SbERR_NOT_IN_SUBR ERRCODE_BASIC_NOT_IN_SUBR
+#define SbERR_NOT_IN_MAIN ERRCODE_BASIC_NOT_IN_MAIN
+#define SbERR_WRONG_DIMS ERRCODE_BASIC_WRONG_DIMS
+#define SbERR_BAD_OPTION ERRCODE_BASIC_BAD_OPTION
+#define SbERR_CONSTANT_REDECLARED ERRCODE_BASIC_CONSTANT_REDECLARED
+#define SbERR_PROG_TOO_LARGE ERRCODE_BASIC_PROG_TOO_LARGE
+#define SbERR_NO_STRINGS_ARRAYS ERRCODE_BASIC_NO_STRINGS_ARRAYS
+#define SbERR_BASIC_EXCEPTION ERRCODE_BASIC_EXCEPTION
+#define SbERR_BASIC_ARRAY_FIX ERRCODE_BASIC_ARRAY_FIX
+#define SbERR_BASIC_STRING_OVERFLOW ERRCODE_BASIC_STRING_OVERFLOW
+#define SbERR_BASIC_EXPR_TOO_COMPLEX ERRCODE_BASIC_EXPR_TOO_COMPLEX
+#define SbERR_BASIC_OPER_NOT_PERFORM ERRCODE_BASIC_OPER_NOT_PERFORM
+#define SbERR_BASIC_TOO_MANY_DLL ERRCODE_BASIC_TOO_MANY_DLL
+#define SbERR_BASIC_LOOP_NOT_INIT ERRCODE_BASIC_LOOP_NOT_INIT
+// #define SbERR_COMPILER_END ERRCODE_BASIC_COMPILER_END
+
+/* ALT
+#define SbERR_SYNTAX 2 // unspecified syntax error
+#define SbERR_NO_GOSUB 3 // Return without Gosub
+#define SbERR_REDO_FROM_START 4 // Redo form start (SB internal)
+#define SbERR_BAD_ARGUMENT 5 // Invalid procedure call
+#define SbERR_MATH_OVERFLOW 6 // Overflow
+#define SbERR_NO_MEMORY 7 // Out of memory
+#define SbERR_ALREADY_DIM 8 // Array already dimensioned
+#define SbERR_OUT_OF_RANGE 9 // Subscript out of range
+#define SbERR_DUPLICATE_DEF 10 // Duplicate definition
+#define SbERR_ZERODIV 11 // Division by zero
+#define SbERR_VAR_UNDEFINED 12 // Variable undefined (SB)
+#define SbERR_CONVERSION 13 // Type mismatch
+#define SbERR_BAD_PARAMETER 14 // Invalid Parameter
+#define SbERR_USER_ABORT 18 // User interrupt occurred
+#define SbERR_BAD_RESUME 20 // Resume without error
+#define SbERR_STACK_OVERFLOW 28 // Out of stack space
+#define SbERR_PROC_UNDEFINED 35 // Sub or Function not defined
+#define SbERR_BAD_DLL_LOAD 48 // Error in loading DLL
+#define SbERR_BAD_DLL_CALL 49 // Bad DLL calling convention
+#define SbERR_INTERNAL_ERROR 51 // internal error
+#define SbERR_BAD_CHANNEL 52 // Bad file name or number
+#define SbERR_FILE_NOT_FOUND 53 // File not found
+#define SbERR_BAD_FILE_MODE 54 // Bad file mode
+#define SbERR_FILE_ALREADY_OPEN 55 // File already open
+#define SbERR_IO_ERROR 57 // Device I/O error
+#define SbERR_FILE_EXISTS 58 // File already exists
+#define SbERR_BAD_RECORD_LENGTH 59 // bad record length
+#define SbERR_DISK_FULL 61 // disk full
+#define SbERR_READ_PAST_EOF 62 // Input past end of file
+#define SbERR_BAD_RECORD_NUMBER 63 // Bad record number
+#define SbERR_TOO_MANY_FILES 67 // Too many files
+#define SbERR_NO_DEVICE 68 // Device not available
+#define SbERR_ACCESS_DENIED 70 // Permission denied
+#define SbERR_NOT_READY 71 // Disk not ready
+#define SbERR_NOT_IMPLEMENTED 73 // Feature not implemented
+#define SbERR_DIFFERENT_DRIVE 74 // No rename with different drive
+#define SbERR_ACCESS_ERROR 75 // Path/File access error
+#define SbERR_PATH_NOT_FOUND 76 // Path not found
+#define SbERR_NO_OBJECT 91 // Object variable not set
+#define SbERR_BAD_PATTERN 93 // Invalid pattern string
+#define SBERR_IS_NULL 94 // Invalid use of Null
+
+// DDE messages from 250-299
+#define SbERR_DDE_ERROR 250
+#define SbERR_DDE_WAITINGACK 280
+#define SbERR_DDE_OUTOFCHANNELS 281
+#define SbERR_DDE_NO_RESPONSE 282
+#define SbERR_DDE_MULT_RESPONSES 283
+#define SbERR_DDE_CHANNEL_LOCKED 284
+#define SbERR_DDE_NOTPROCESSED 285
+#define SbERR_DDE_TIMEOUT 286
+#define SbERR_DDE_USER_INTERRUPT 287
+#define SbERR_DDE_BUSY 288
+#define SbERR_DDE_NO_DATA 289
+#define SbERR_DDE_WRONG_DATA_FORMAT 290
+#define SbERR_DDE_PARTNER_QUIT 291
+#define SbERR_DDE_CONV_CLOSED 292
+#define SbERR_DDE_NO_CHANNEL 293
+#define SbERR_DDE_INVALID_LINK 294
+#define SbERR_DDE_QUEUE_OVERFLOW 295
+#define SbERR_DDE_LINK_ALREADY_EST 296
+#define SbERR_DDE_LINK_INV_TOPIC 297
+#define SbERR_DDE_DLL_NOT_FOUND 298
+
+#define SbERR_CANNOT_LOAD 323 // Can't load module
+#define SbERR_BAD_INDEX 341 // Invalid object index
+#define SbERR_NO_ACTIVE_OBJECT 366 // No active view or document
+#define SbERR_BAD_PROP_VALUE 380 // Bad property value
+#define SbERR_PROP_READONLY 382 // Property is read only
+#define SbERR_PROP_WRITEONLY 394 // Property is write only
+#define SbERR_INVALID_OBJECT 420 // Invalid object reference
+#define SbERR_NO_METHOD 423 // Property or method not found
+#define SbERR_NEEDS_OBJECT 424 // Object required
+#define SbERR_INVALID_USAGE_OBJECT 425 // Invalid usee of object
+#define SbERR_NO_OLE 430 // Class does not support OLE
+#define SbERR_BAD_METHOD 438 // Object doesn't support method
+#define SbERR_OLE_ERROR 440 // OLE Automation error
+#define SbERR_BAD_ACTION 445 // Object doesn't support this action
+#define SbERR_NO_NAMED_ARGS 446 // Object doesn't support named args
+#define SbERR_BAD_LOCALE 447 // Object doesn't support current locale setting
+#define SbERR_NAMED_NOT_FOUND 448 // Named argument not found
+#define SbERR_NOT_OPTIONAL 449 // Argument not optional
+#define SbERR_WRONG_ARGS 450 // Wrong number of arguments
+#define SbERR_NOT_A_COLL 451 // Object not a collection
+#define SbERR_BAD_ORDINAL 452 // Invalid ordinal
+#define SbERR_DLLPROC_NOT_FOUND 453 // Specified DLL function not found
+#define SbERR_BAD_CLIPBD_FORMAT 460 // Invalid clipboard format
+
+// Debugger messages from 700-799
+
+#define SbERR_PROPERTY_NOT_FOUND 1000 // Class not have property
+#define SbERR_METHOD_NOT_FOUND 1001 // Class does not have method
+#define SbERR_ARG_MISSING 1002 // Missing required argument
+#define SbERR_BAD_NUMBER_OF_ARGS 1003 // Bad number of arguments
+#define SbERR_METHOD_FAILED 1004 // Method failed
+#define SbERR_SETPROP_FAILED 1005 // Unable to set property
+#define SbERR_GETPROP_FAILED 1006 // Unable to get property
+
+// Compiler Errors (do not happen at runtime)
+// These IDs can shift at any time
+
+#define SbERR_COMPILER_BGN 950
+#define SbERR_UNEXPECTED 951 // Unexpected symbol: xx
+#define SbERR_EXPECTED 952 // Expected: xx
+#define SbERR_SYMBOL_EXPECTED 953 // Symbol expected
+#define SbERR_VAR_EXPECTED 954 // Variable expected
+#define SbERR_LABEL_EXPECTED 955 // Label expected
+#define SbERR_LVALUE_EXPECTED 956 // Lvalue expected
+#define SbERR_VAR_DEFINED 957 // Variable xxx already defined
+#define SbERR_PROC_DEFINED 958 // Procedure xx already defined
+#define SbERR_LABEL_DEFINED 959 // Label xxx already defined
+#define SbERR_UNDEF_VAR 960 // Variable xx undefined
+#define SbERR_UNDEF_ARRAY 961 // Array or function xx undefined
+#define SbERR_UNDEF_PROC 962 // Procedure xxx undefined
+#define SbERR_UNDEF_LABEL 963 // Label xxx undefined
+#define SbERR_UNDEF_TYPE 964 // Unknown user defined type xxx
+#define SbERR_BAD_EXIT 965 // Exit XXX expexted
+#define SbERR_BAD_BLOCK 966 // Unterminated statement block: missing XX
+#define SbERR_BAD_BRACKETS 967 // Parentheses do not match
+#define SbERR_BAD_DECLARATION 968 // Symbol xx defined differently
+#define SbERR_BAD_PARAMETERS 969 // Parameters do not match
+#define SbERR_BAD_CHAR_IN_NUMBER 970 // Bad character in number
+#define SbERR_MUST_HAVE_DIMS 971 // Array needs dimensioning
+#define SbERR_NO_IF 972 // Else/Endif without If
+#define SbERR_NOT_IN_SUBR 973 // xxx not allowed within a sub
+#define SbERR_NOT_IN_MAIN 974 // xxx not allowed outside a sub
+#define SbERR_WRONG_DIMS 975 // Dimensions do not match
+#define SbERR_BAD_OPTION 976 // Unknown option: xxx
+#define SbERR_CONSTANT_REDECLARED 977 // Constant xx redeclared
+#define SbERR_PROG_TOO_LARGE 978 // Program is too large
+#define SbERR_NO_STRINGS_ARRAYS 979
+#define SbERR_COMPILER_END 299
+*/
+
+// Grid messages from 30000-30999
+// OLE messages from 31000-31999
+
+#endif
diff --git a/basic/inc/basic/sbmeth.hxx b/basic/inc/basic/sbmeth.hxx
new file mode 100644
index 000000000000..538972d8318a
--- /dev/null
+++ b/basic/inc/basic/sbmeth.hxx
@@ -0,0 +1,104 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sbmeth.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SB_SBMETH_HXX
+#define _SB_SBMETH_HXX
+
+#include <tools/errcode.hxx>
+#include <basic/sbxmeth.hxx>
+#include <basic/sbdef.hxx>
+
+class SbModule;
+class SbMethodImpl;
+
+class SbMethod : public SbxMethod
+{
+ friend class SbiRuntime;
+ friend class SbiFactory;
+ friend class SbModule;
+ friend class SbClassModuleObject;
+ friend class SbiCodeGen;
+ friend class SbJScriptMethod;
+ friend class SbIfaceMapperMethod;
+
+ SbMethodImpl* mpSbMethodImpl; // Impl data
+ SbModule* pMod;
+ USHORT nDebugFlags;
+ USHORT nLine1, nLine2;
+ UINT32 nStart;
+ BOOL bInvalid;
+ SbxArrayRef refStatics;
+ SbMethod( const String&, SbxDataType, SbModule* );
+ SbMethod( const SbMethod& );
+ virtual BOOL LoadData( SvStream&, USHORT );
+ virtual BOOL StoreData( SvStream& ) const;
+ virtual ~SbMethod();
+
+public:
+ SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_BASICMETHOD,2);
+ TYPEINFO();
+ virtual SbxInfo* GetInfo();
+ SbxArray* GetLocals();
+ SbxArray* GetStatics();
+ void ClearStatics();
+ SbModule* GetModule() { return pMod; }
+ UINT32 GetId() const { return nStart; }
+ USHORT GetDebugFlags() { return nDebugFlags; }
+ void SetDebugFlags( USHORT n ) { nDebugFlags = n; }
+ void GetLineRange( USHORT&, USHORT& );
+
+ // Schnittstelle zum Ausfuehren einer Methode aus den Applikationen
+ virtual ErrCode Call( SbxValue* pRet = NULL );
+ virtual void Broadcast( ULONG nHintId );
+};
+
+#ifndef __SB_SBMETHODREF_HXX
+#define __SB_SBMETHODREF_HXX
+SV_DECL_IMPL_REF(SbMethod)
+#endif
+
+class SbIfaceMapperMethod : public SbMethod
+{
+ friend class SbiRuntime;
+
+ SbMethodRef mxImplMeth;
+
+public:
+ TYPEINFO();
+ SbIfaceMapperMethod( const String& rName, SbMethod* pImplMeth )
+ : SbMethod( rName, pImplMeth->GetType(), NULL )
+ , mxImplMeth( pImplMeth )
+ {}
+ virtual ~SbIfaceMapperMethod();
+ SbMethod* getImplMethod( void )
+ { return mxImplMeth; }
+};
+
+#endif
diff --git a/basic/inc/basic/sbmod.hxx b/basic/inc/basic/sbmod.hxx
new file mode 100644
index 000000000000..5847ff4d98cb
--- /dev/null
+++ b/basic/inc/basic/sbmod.hxx
@@ -0,0 +1,172 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sbmod.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SB_SBMOD_HXX
+#define _SB_SBMOD_HXX
+
+#include <basic/sbdef.hxx>
+#include <basic/sbxobj.hxx>
+#include <basic/sbxdef.hxx>
+#ifndef _RTL_USTRING_HXX
+#include <rtl/ustring.hxx>
+#endif
+
+class SbMethod;
+class SbProperty;
+class SbiRuntime;
+class SbiBreakpoints;
+class SbiImage;
+class SbProcedureProperty;
+class SbIfaceMapperMethod;
+
+struct SbClassData;
+class SbModuleImpl;
+
+class SbModule : public SbxObject
+{
+ friend class TestToolObj; // allows module initialisation at runtime
+ friend class SbiCodeGen;
+ friend class SbMethod;
+ friend class SbiRuntime;
+ friend class StarBASIC;
+ friend class SbClassModuleObject;
+
+ SbModuleImpl* mpSbModuleImpl; // Impl data
+
+protected:
+ ::rtl::OUString aOUSource;
+ String aComment;
+ SbiImage* pImage; // the Image
+ SbiBreakpoints* pBreaks; // Breakpoints
+ SbClassData* pClassData;
+
+ void StartDefinitions();
+ SbMethod* GetMethod( const String&, SbxDataType );
+ SbProperty* GetProperty( const String&, SbxDataType );
+ SbProcedureProperty* GetProcedureProperty( const String&, SbxDataType );
+ SbIfaceMapperMethod* GetIfaceMapperMethod( const String&, SbMethod* );
+ void EndDefinitions( BOOL=FALSE );
+ USHORT Run( SbMethod* );
+ void RunInit();
+ void ClearPrivateVars();
+ void GlobalRunInit( BOOL bBasicStart ); // for all modules
+ void GlobalRunDeInit( void );
+ const BYTE* FindNextStmnt( const BYTE*, USHORT&, USHORT& ) const;
+ const BYTE* FindNextStmnt( const BYTE*, USHORT&, USHORT&,
+ BOOL bFollowJumps, const SbiImage* pImg=NULL ) const;
+ virtual BOOL LoadData( SvStream&, USHORT );
+ virtual BOOL StoreData( SvStream& ) const;
+ virtual BOOL LoadCompleted();
+ virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
+ const SfxHint& rHint, const TypeId& rHintType );
+ virtual ~SbModule();
+public:
+ SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_BASICMOD,2);
+ TYPEINFO();
+ SbModule( const String& );
+ virtual void SetParent( SbxObject* );
+ virtual void Clear();
+
+ virtual SbxVariable* Find( const String&, SbxClassType );
+
+ virtual const String& GetSource() const;
+ const ::rtl::OUString& GetSource32() const;
+ const String& GetComment() const { return aComment; }
+ virtual void SetSource( const String& r );
+ void SetSource32( const ::rtl::OUString& r );
+ void SetComment( const String& r );
+
+ virtual BOOL Compile();
+ BOOL Disassemble( String& rText );
+ virtual BOOL IsCompiled() const;
+ const SbxObject* FindType( String aTypeName ) const;
+
+ virtual BOOL IsBreakable( USHORT nLine ) const;
+ virtual USHORT GetBPCount() const;
+ virtual USHORT GetBP( USHORT n ) const;
+ virtual BOOL IsBP( USHORT nLine ) const;
+ virtual BOOL SetBP( USHORT nLine );
+ virtual BOOL ClearBP( USHORT nLine );
+ virtual void ClearAllBP();
+
+ // Lines of Subs
+ virtual SbMethod* GetFunctionForLine( USHORT );
+
+ // Store only image, no source (needed for new password protection)
+ BOOL StoreBinaryData( SvStream& );
+ BOOL StoreBinaryData( SvStream&, USHORT nVer );
+ BOOL LoadBinaryData( SvStream&, USHORT nVer );
+ BOOL LoadBinaryData( SvStream& );
+ BOOL ExceedsLegacyModuleSize();
+ void fixUpMethodStart( bool bCvtToLegacy, SbiImage* pImg = NULL ) const;
+};
+
+#ifndef __SB_SBMODULEREF_HXX
+#define __SB_SBMODULEREF_HXX
+
+SV_DECL_IMPL_REF(SbModule)
+
+#endif
+
+class SbClassModuleImpl;
+
+// Object class for instances of class modules
+class SbClassModuleObject : public SbModule
+{
+ SbClassModuleImpl* mpSbClassModuleImpl;
+
+ SbModule* mpClassModule;
+ bool mbInitializeEventDone;
+
+public:
+ TYPEINFO();
+ SbClassModuleObject( SbModule* pClassModule );
+ ~SbClassModuleObject();
+
+ // Overridden to support NameAccess etc.
+ virtual SbxVariable* Find( const String&, SbxClassType );
+
+ virtual void SFX_NOTIFY( SfxBroadcaster&, const TypeId&, const SfxHint& rHint, const TypeId& );
+
+ SbModule* getClassModule( void )
+ { return mpClassModule; }
+
+ void triggerInitializeEvent( void );
+ void triggerTerminateEvent( void );
+};
+
+#ifndef __SB_SBCLASSMODULEREF_HXX
+#define __SB_SBCLASSMODULEREF_HXX
+
+SV_DECL_IMPL_REF(SbClassModuleObject);
+
+#endif
+
+#endif
diff --git a/basic/inc/basic/sbprop.hxx b/basic/inc/basic/sbprop.hxx
new file mode 100644
index 000000000000..19505ed16999
--- /dev/null
+++ b/basic/inc/basic/sbprop.hxx
@@ -0,0 +1,83 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sbprop.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SB_SBPROPERTY_HXX
+#define _SB_SBPROPERTY_HXX
+
+#include <basic/sbxprop.hxx>
+#include <basic/sbdef.hxx>
+
+class SbModule;
+
+class SbProperty : public SbxProperty
+{
+ friend class SbiFactory;
+ friend class SbModule;
+ friend class SbProcedureProperty;
+ SbModule* pMod;
+ BOOL bInvalid;
+ SbProperty( const String&, SbxDataType, SbModule* );
+ virtual ~SbProperty();
+public:
+ SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_BASICPROP,1);
+ TYPEINFO();
+ SbModule* GetModule() { return pMod; }
+};
+
+#ifndef __SB_SBPROPERTYREF_HXX
+#define __SB_SBPROPERTYREF_HXX
+SV_DECL_IMPL_REF(SbProperty)
+#endif
+
+class SbProcedureProperty : public SbxProperty
+{
+ bool mbSet; // Flag for set command
+
+ virtual ~SbProcedureProperty();
+
+public:
+ SbProcedureProperty( const String& r, SbxDataType t )
+ : SbxProperty( r, t ) // , pMod( p )
+ , mbSet( false )
+ {}
+ TYPEINFO();
+
+ bool isSet( void )
+ { return mbSet; }
+ void setSet( bool bSet )
+ { mbSet = bSet; }
+};
+
+#ifndef __SB_SBPROCEDUREPROPERTYREF_HXX
+#define __SB_SBPROCEDUREPROPERTYREF_HXX
+SV_DECL_IMPL_REF(SbProcedureProperty)
+#endif
+
+#endif
diff --git a/basic/inc/basic/sbstar.hxx b/basic/inc/basic/sbstar.hxx
new file mode 100644
index 000000000000..3ec0803eb4a9
--- /dev/null
+++ b/basic/inc/basic/sbstar.hxx
@@ -0,0 +1,209 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sbstar.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SB_SBSTAR_HXX
+#define _SB_SBSTAR_HXX
+
+#include <basic/sbx.hxx>
+#include <basic/sbxobj.hxx>
+#ifndef _RTL_USTRING_HXX
+#include <rtl/ustring.hxx>
+#endif
+#include <osl/mutex.hxx>
+
+#include <basic/sbdef.hxx>
+#include <basic/sberrors.hxx>
+
+class SbModule; // completed module
+class SbiInstance; // runtime instance
+class SbiRuntime; // currently running procedure
+class SbiImage; // compiled image
+class BasicLibInfo; // info block for basic manager
+class SbiBreakpoints;
+class SbTextPortions;
+class SbMethod;
+class BasicManager;
+
+class StarBASICImpl;
+
+class StarBASIC : public SbxObject
+{
+ friend class SbiScanner;
+ friend class SbiExpression; // Access to RTL
+ friend class SbiInstance;
+ friend class SbiRuntime;
+
+ StarBASICImpl* mpStarBASICImpl;
+
+ SbxArrayRef pModules; // List of all modules
+ SbxObjectRef pRtl; // Runtime Library
+ SbxArrayRef xUnoListeners; // Listener handled by CreateUnoListener
+
+ // Handler-Support:
+ Link aErrorHdl; // Error handler
+ Link aBreakHdl; // Breakpoint handler
+ BOOL bNoRtl; // if TRUE: do not search RTL
+ BOOL bBreak; // if TRUE: Break, otherwise Step
+ BOOL bDocBasic;
+ BasicLibInfo* pLibInfo; // Info block for basic manager
+ SbLanguageMode eLanguageMode; // LanguageMode of the basic object
+protected:
+ BOOL CError( SbError, const String&, xub_StrLen, xub_StrLen, xub_StrLen );
+private:
+ BOOL RTError( SbError, xub_StrLen, xub_StrLen, xub_StrLen );
+ BOOL RTError( SbError, const String& rMsg, xub_StrLen, xub_StrLen, xub_StrLen );
+ USHORT BreakPoint( xub_StrLen nLine, xub_StrLen nCol1, xub_StrLen nCol2 );
+ USHORT StepPoint( xub_StrLen nLine, xub_StrLen nCol1, xub_StrLen nCol2 );
+ virtual BOOL LoadData( SvStream&, USHORT );
+ virtual BOOL StoreData( SvStream& ) const;
+
+protected:
+
+ virtual BOOL ErrorHdl();
+ virtual USHORT BreakHdl();
+ virtual ~StarBASIC();
+
+public:
+
+ SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_BASIC,1);
+ TYPEINFO();
+
+ StarBASIC( StarBASIC* pParent = NULL, BOOL bIsDocBasic = FALSE );
+
+ // #51727 SetModified overridden so that the Modfied-State is
+ // not delivered to Parent.
+ virtual void SetModified( BOOL );
+
+ void* operator new( size_t );
+ void operator delete( void* );
+
+ virtual void Insert( SbxVariable* );
+ using SbxObject::Remove;
+ virtual void Remove( SbxVariable* );
+ virtual void Clear();
+
+ BasicLibInfo* GetLibInfo() { return pLibInfo; }
+ void SetLibInfo( BasicLibInfo* p ) { pLibInfo = p; }
+
+ // Compiler-Interface
+ SbModule* MakeModule( const String& rName, const String& rSrc );
+ SbModule* MakeModule32( const String& rName, const ::rtl::OUString& rSrc );
+ BOOL Compile( SbModule* );
+ BOOL Disassemble( SbModule*, String& rText );
+ static void Stop();
+ static void Error( SbError );
+ static void Error( SbError, const String& rMsg );
+ static void FatalError( SbError );
+ static void FatalError( SbError, const String& rMsg );
+ static BOOL IsRunning();
+ static SbError GetErrBasic();
+ // #66536 make additional message accessible by RTL function Error
+ static String GetErrorMsg();
+ static xub_StrLen GetErl();
+ // Highlighting
+ void Highlight( const String& rSrc, SbTextPortions& rList );
+
+ virtual SbxVariable* Find( const String&, SbxClassType );
+ virtual BOOL Call( const String&, SbxArray* = NULL );
+
+ SbxArray* GetModules() { return pModules; }
+ SbxObject* GetRtl() { return pRtl; }
+ SbModule* FindModule( const String& );
+ // Run init code of all modules (including the inserted Doc-Basics)
+ void InitAllModules( StarBASIC* pBasicNotToInit = NULL );
+ void DeInitAllModules( void );
+ void ClearAllModuleVars( void );
+ void ActivateObject( const String*, BOOL );
+ BOOL LoadOldModules( SvStream& );
+
+ // #43011 For TestTool; deletes global vars
+ void ClearGlobalVars( void );
+
+ // Calls for error and break handler
+ static USHORT GetLine();
+ static USHORT GetCol1();
+ static USHORT GetCol2();
+ static void SetErrorData( SbError nCode, USHORT nLine,
+ USHORT nCol1, USHORT nCol2 );
+
+ // Specific to error handler
+ static void MakeErrorText( SbError, const String& aMsg );
+ static const String& GetErrorText();
+ static SbError GetErrorCode();
+ static BOOL IsCompilerError();
+ static USHORT GetVBErrorCode( SbError nError );
+ static SbError GetSfxFromVBError( USHORT nError );
+ static void SetGlobalLanguageMode( SbLanguageMode eLangMode );
+ static SbLanguageMode GetGlobalLanguageMode();
+ // Local settings
+ void SetLanguageMode( SbLanguageMode eLangMode )
+ { eLanguageMode = eLangMode; }
+ SbLanguageMode GetLanguageMode();
+
+ // Specific for break handler
+ BOOL IsBreak() const { return bBreak; }
+
+ static Link GetGlobalErrorHdl();
+ static void SetGlobalErrorHdl( const Link& rNewHdl );
+ Link GetErrorHdl() const { return aErrorHdl; }
+ void SetErrorHdl( const Link& r ) { aErrorHdl = r; }
+
+ static Link GetGlobalBreakHdl();
+ static void SetGlobalBreakHdl( const Link& rNewHdl );
+ Link GetBreakHdl() const { return aBreakHdl; }
+ void SetBreakHdl( const Link& r ) { aBreakHdl = r; }
+
+ SbxArrayRef getUnoListeners( void );
+
+ static SbxBase* FindSBXInCurrentScope( const String& rName );
+ static SbxVariable* FindVarInCurrentScopy
+ ( const String& rName, USHORT& rStatus );
+ static SbMethod* GetActiveMethod( USHORT nLevel = 0 );
+ static SbModule* GetActiveModule();
+
+ // #60175 TRUE: SFX-Resource is not displayed on basic errors
+ static void StaticSuppressSfxResource( BOOL bSuppress );
+
+ // #91147 TRUE: Reschedule is enabled (default>, FALSE: No reschedule
+ static void StaticEnableReschedule( BOOL bReschedule );
+
+ SbxObjectRef getRTL( void ) { return pRtl; }
+ BOOL IsDocBasic() { return bDocBasic; }
+};
+
+#ifndef __SB_SBSTARBASICREF_HXX
+#define __SB_SBSTARBASICREF_HXX
+
+SV_DECL_IMPL_REF(StarBASIC)
+
+#endif
+
+#endif
+
diff --git a/basic/inc/basic/sbstdobj.hxx b/basic/inc/basic/sbstdobj.hxx
new file mode 100644
index 000000000000..a88cea7b9b33
--- /dev/null
+++ b/basic/inc/basic/sbstdobj.hxx
@@ -0,0 +1,148 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sbstdobj.hxx,v $
+ * $Revision: 1.5 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SBSTDOBJ1_HXX
+#define _SBSTDOBJ1_HXX
+
+#include <basic/sbxobj.hxx>
+#ifndef _GRAPH_HXX //autogen
+#include <vcl/graph.hxx>
+#endif
+#include <basic/sbxfac.hxx>
+class StarBASIC;
+class SbStdFactory;
+
+//--------------------
+// class SbStdFactory
+//--------------------
+class SbStdFactory : public SbxFactory
+{
+public:
+ SbStdFactory();
+
+ virtual SbxObject* CreateObject( const String& rClassName );
+};
+
+//--------------------
+// class SbStdPicture
+//--------------------
+class SbStdPicture : public SbxObject
+{
+protected:
+ Graphic aGraphic;
+
+ ~SbStdPicture();
+ virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
+ const SfxHint& rHint, const TypeId& rHintType );
+
+ void PropType( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite );
+ void PropWidth( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite );
+ void PropHeight( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite );
+
+public:
+ TYPEINFO();
+
+ SbStdPicture();
+ virtual SbxVariable* Find( const String&, SbxClassType );
+
+ Graphic GetGraphic() const { return aGraphic; }
+ void SetGraphic( const Graphic& rGrf ) { aGraphic = rGrf; }
+};
+
+//-----------------
+// class SbStdFont
+//-----------------
+class SbStdFont : public SbxObject
+{
+protected:
+ BOOL bBold;
+ BOOL bItalic;
+ BOOL bStrikeThrough;
+ BOOL bUnderline;
+ USHORT nSize;
+ String aName;
+
+ ~SbStdFont();
+ virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
+ const SfxHint& rHint, const TypeId& rHintType );
+
+ void PropBold( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite );
+ void PropItalic( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite );
+ void PropStrikeThrough( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite );
+ void PropUnderline( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite );
+ void PropSize( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite );
+ void PropName( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite );
+
+public:
+ TYPEINFO();
+
+ SbStdFont();
+ virtual SbxVariable* Find( const String&, SbxClassType );
+
+ void SetBold( BOOL bB ) { bBold = bB; }
+ BOOL IsBold() const { return bBold; }
+ void SetItalic( BOOL bI ) { bItalic = bI; }
+ BOOL IsItalic() const { return bItalic; }
+ void SetStrikeThrough( BOOL bS ) { bStrikeThrough = bS; }
+ BOOL IsStrikeThrough() const { return bStrikeThrough; }
+ void SetUnderline( BOOL bU ) { bUnderline = bU; }
+ BOOL IsUnderline() const { return bUnderline; }
+ void SetSize( USHORT nS ) { nSize = nS; }
+ USHORT GetSize() const { return nSize; }
+ void SetFontName( const String& rName ) { aName = rName; }
+ String GetFontName() const { return aName; }
+};
+
+//----------------------
+// class SbStdClipboard
+//----------------------
+class SbStdClipboard : public SbxObject
+{
+protected:
+
+ ~SbStdClipboard();
+ virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
+ const SfxHint& rHint, const TypeId& rHintType );
+
+ void MethClear( SbxVariable* pVar, SbxArray* pPar_, BOOL bWrite );
+ void MethGetData( SbxVariable* pVar, SbxArray* pPar_, BOOL bWrite );
+ void MethGetFormat( SbxVariable* pVar, SbxArray* pPar_, BOOL bWrite );
+ void MethGetText( SbxVariable* pVar, SbxArray* pPar_, BOOL bWrite );
+ void MethSetData( SbxVariable* pVar, SbxArray* pPar_, BOOL bWrite );
+ void MethSetText( SbxVariable* pVar, SbxArray* pPar_, BOOL bWrite );
+
+public:
+ TYPEINFO();
+
+ SbStdClipboard();
+ virtual SbxVariable* Find( const String&, SbxClassType );
+};
+
+#endif
diff --git a/basic/inc/basic/sbuno.hxx b/basic/inc/basic/sbuno.hxx
new file mode 100644
index 000000000000..bf95e0b46080
--- /dev/null
+++ b/basic/inc/basic/sbuno.hxx
@@ -0,0 +1,48 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sbuno.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SB_SBUNO_HXX
+#define _SB_SBUNO_HXX
+
+#include <basic/sbxobj.hxx>
+
+namespace com { namespace sun { namespace star { namespace uno { class Any; }}}}
+
+// Returns a SbxObject that wrapps an Uno Interface
+// Implementation in basic/source/classes/sbunoobj.cxx
+SbxObjectRef GetSbUnoObject( const String& aName, const com::sun::star::uno::Any& aUnoObj_ );
+
+// Force creation of all properties for debugging
+void createAllObjectProperties( SbxObject* pObj );
+
+::com::sun::star::uno::Any sbxToUnoValue( SbxVariable* pVar );
+
+#endif
+
diff --git a/basic/inc/basic/sbx.hxx b/basic/inc/basic/sbx.hxx
new file mode 100644
index 000000000000..ce2e992da854
--- /dev/null
+++ b/basic/inc/basic/sbx.hxx
@@ -0,0 +1,372 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sbx.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SBXCLASS_HXX
+#define _SBXCLASS_HXX
+
+#include "tools/ref.hxx"
+#include "svtools/svarray.hxx"
+#include "svtools/smplhint.hxx"
+#include "svtools/lstner.hxx"
+#include <basic/sbxdef.hxx>
+#include <basic/sbxform.hxx>
+
+#ifndef __SBX_SBXOBJECT_HXX
+#include <basic/sbxobj.hxx>
+#endif
+#include <basic/sbxprop.hxx>
+#include <basic/sbxmeth.hxx>
+
+class BigInt;
+class String;
+class UniString;
+class SvStream;
+class SbxBase;
+class SbxVariable;
+class SbxProperty;
+class SbxMethod;
+class SbxObject;
+class SbxArray;
+class SbxDimArray;
+class SbxFactory;
+struct SbxINT64;
+struct SbxUINT64;
+
+class SfxBroadcaster;
+class SvDispatch;
+
+///////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////////
+
+#ifndef __SBX_SBXPARAMINFO
+#define __SBX_SBXPARAMINFO
+
+// Parameter information
+struct SbxParamInfo
+{
+ const String aName; // Name of the parameter
+ SbxBaseRef aTypeRef; // Object, if object type
+ SbxDataType eType; // Data type
+ UINT16 nFlags; // Flag-Bits
+ UINT32 nUserData; // IDs etc.
+ SbxParamInfo( const String& s, SbxDataType t, USHORT n, SbxBase* b = NULL )
+ : aName( s ), aTypeRef( b ), eType( t ), nFlags( n ), nUserData( 0 ) {}
+ ~SbxParamInfo() {}
+};
+
+//#if 0 // _SOLAR__PRIVATE
+SV_DECL_PTRARR_DEL(SbxParams,SbxParamInfo*,4,4)
+//#else
+//typedef SvPtrarr SbxParams;
+//#endif
+
+#endif
+
+#ifndef __SBX_SBXINFO
+#define __SBX_SBXINFO
+
+class SbxInfo : public SvRefBase
+{
+ friend class SbxVariable;
+ friend class SbMethod;
+
+ String aComment;
+ String aHelpFile;
+ UINT32 nHelpId;
+ SbxParams aParams;
+
+protected:
+ BOOL LoadData( SvStream&, USHORT );
+ BOOL StoreData( SvStream& ) const;
+ virtual ~SbxInfo();
+public:
+ SbxInfo();
+ SbxInfo( const String&, UINT32 );
+
+ void AddParam( const String&, SbxDataType, USHORT=SBX_READ );
+ void AddParam( const SbxParamInfo& );
+ const SbxParamInfo* GetParam( USHORT n ) const; // index starts with 1!
+ const String& GetComment() const { return aComment; }
+ const String& GetHelpFile() const { return aHelpFile; }
+ UINT32 GetHelpId() const { return nHelpId; }
+
+ void SetComment( const String& r ) { aComment = r; }
+ void SetHelpFile( const String& r ) { aHelpFile = r; }
+ void SetHelpId( UINT32 nId ) { nHelpId = nId; }
+};
+
+#endif
+
+#ifndef __SBX_SBXHINT_HXX
+#define __SBX_SBXHINT_HXX
+
+class SbxHint : public SfxSimpleHint
+{
+ SbxVariable* pVar;
+public:
+ TYPEINFO();
+ SbxHint( ULONG n, SbxVariable* v ) : SfxSimpleHint( n ), pVar( v ) {}
+ SbxVariable* GetVar() const { return pVar; }
+};
+
+#endif
+
+#ifndef __SBX_SBXALIAS_HXX
+#define __SBX_SBXALIAS_HXX
+
+// SbxAlias is an alias for a var or object
+class SbxAlias : public SbxVariable, public SfxListener
+{
+ SbxVariableRef xAlias;
+ virtual ~SbxAlias();
+ virtual void Broadcast( ULONG );
+ virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
+ const SfxHint& rHint, const TypeId& rHintType );
+public:
+ SbxAlias( const String& rName, SbxVariable* pOriginal );
+ SbxAlias( const SbxAlias& );
+ SbxAlias& operator=( const SbxAlias& );
+};
+
+#endif
+
+#ifndef __SBX_SBXARRAY
+#define __SBX_SBXARRAY
+
+// SbxArray ist ein eindimensionales, dynamisches Array
+// von SbxVariablen. Put()/Insert() konvertieren die Variablen in den
+// angegebenen Datentyp, falls er nicht SbxVARIANT ist.
+
+class SbxVarRefs;
+class SbxVariableRef;
+
+class SbxArrayImpl;
+
+class SbxArray : public SbxBase
+{
+// #100883 Method to set method directly to parameter array
+ friend class SbMethod;
+ friend class SbTypeFactory;
+ friend class SbClassModuleObject;
+ void PutDirect( SbxVariable* pVar, UINT32 nIdx );
+
+ SbxArrayImpl* mpSbxArrayImpl; // Impl data
+ SbxVarRefs* pData; // The variables
+
+protected:
+ SbxDataType eType; // Data type of the array
+ virtual ~SbxArray();
+ virtual BOOL LoadData( SvStream&, USHORT );
+ virtual BOOL StoreData( SvStream& ) const;
+
+public:
+ SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_ARRAY,1);
+ TYPEINFO();
+ SbxArray( SbxDataType=SbxVARIANT );
+ SbxArray( const SbxArray& );
+ SbxArray& operator=( const SbxArray& );
+ virtual void Clear();
+ USHORT Count() const;
+ virtual SbxDataType GetType() const;
+ virtual SbxClassType GetClass() const;
+ SbxVariableRef& GetRef( USHORT );
+ SbxVariable* Get( USHORT );
+ void Put( SbxVariable*, USHORT );
+ void Insert( SbxVariable*, USHORT );
+ void Remove( USHORT );
+ void Remove( SbxVariable* );
+ void Merge( SbxArray* );
+ const String& GetAlias( USHORT );
+ void PutAlias( const String&, USHORT );
+ SbxVariable* FindUserData( UINT32 nUserData );
+ virtual SbxVariable* Find( const String&, SbxClassType );
+
+ // Additional methods for 32-bit indices
+ UINT32 Count32() const;
+ SbxVariableRef& GetRef32( UINT32 );
+ SbxVariable* Get32( UINT32 );
+ void Put32( SbxVariable*, UINT32 );
+ void Insert32( SbxVariable*, UINT32 );
+ void Remove32( UINT32 );
+};
+
+#endif
+
+#ifndef __SBX_SBXDIMARRAY_HXX
+#define __SBX_SBXDIMARRAY_HXX
+
+// SbxDimArray is an array that can dimensioned using BASIC conventions.
+struct SbxDim;
+
+class SbxDimArrayImpl;
+
+class SbxDimArray : public SbxArray
+{
+ SbxDimArrayImpl* mpSbxDimArrayImpl; // Impl data
+
+ SbxDim* pFirst, *pLast; // Links to Dimension table
+ short nDim; // Number of dimensions
+ void AddDimImpl32( INT32, INT32, BOOL bAllowSize0 );
+ bool mbHasFixedSize;
+protected:
+ USHORT Offset( const short* );
+ UINT32 Offset32( const INT32* );
+ USHORT Offset( SbxArray* );
+ UINT32 Offset32( SbxArray* );
+ virtual BOOL LoadData( SvStream&, USHORT );
+ virtual BOOL StoreData( SvStream& ) const;
+ virtual ~SbxDimArray();
+public:
+ SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_DIMARRAY,1);
+ TYPEINFO();
+ SbxDimArray( SbxDataType=SbxVARIANT );
+ SbxDimArray( const SbxDimArray& );
+ SbxDimArray& operator=( const SbxDimArray& );
+ virtual void Clear();
+ using SbxArray::GetRef;
+ SbxVariableRef& GetRef( const short* );
+ using SbxArray::Get;
+ SbxVariable* Get( const short* );
+ using SbxArray::Put;
+ void Put( SbxVariable*, const short* );
+ SbxVariableRef& GetRef( SbxArray* );
+ SbxVariable* Get( SbxArray* );
+ void Put( SbxVariable*, SbxArray* );
+
+ short GetDims() const { return nDim; }
+ void AddDim( short, short );
+ void unoAddDim( short, short );
+ BOOL GetDim( short, short&, short& ) const;
+
+ using SbxArray::GetRef32;
+ SbxVariableRef& GetRef32( const INT32* );
+ using SbxArray::Get32;
+ SbxVariable* Get32( const INT32* );
+ using SbxArray::Put32;
+ void Put32( SbxVariable*, const INT32* );
+ void AddDim32( INT32, INT32 );
+ void unoAddDim32( INT32, INT32 );
+ BOOL GetDim32( INT32, INT32&, INT32& ) const;
+ bool hasFixedSize() { return mbHasFixedSize; };
+ void setHasFixedSize( bool bHasFixedSize ) {mbHasFixedSize = bHasFixedSize; };
+};
+
+#endif
+
+#ifndef __SBX_SBXCOLLECTION_HXX
+#define __SBX_SBXCOLLECTION_HXX
+
+class SbxCollection : public SbxObject
+{
+ void Initialize();
+protected:
+ virtual ~SbxCollection();
+ virtual BOOL LoadData( SvStream&, USHORT );
+ virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
+ const SfxHint& rHint, const TypeId& rHintType );
+ // Overridable methods (why not pure virtual?):
+ virtual void CollAdd( SbxArray* pPar );
+ virtual void CollItem( SbxArray* pPar );
+ virtual void CollRemove( SbxArray* pPar );
+
+public:
+ SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_COLLECTION,1);
+ TYPEINFO();
+ SbxCollection( const String& rClassname );
+ SbxCollection( const SbxCollection& );
+ SbxCollection& operator=( const SbxCollection& );
+ virtual SbxVariable* FindUserData( UINT32 nUserData );
+ virtual SbxVariable* Find( const String&, SbxClassType );
+ virtual void Clear();
+};
+
+#endif
+
+#ifndef __SBX_SBXSTDCOLLECTION_HXX
+#define __SBX_SBXSTDCOLLECTION_HXX
+
+class SbxStdCollection : public SbxCollection
+{
+protected:
+ String aElemClass;
+ BOOL bAddRemoveOk;
+ virtual ~SbxStdCollection();
+ virtual BOOL LoadData( SvStream&, USHORT );
+ virtual BOOL StoreData( SvStream& ) const;
+ virtual void CollAdd( SbxArray* pPar );
+ virtual void CollRemove( SbxArray* pPar );
+public:
+ SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_FIXCOLLECTION,1);
+ TYPEINFO();
+ SbxStdCollection
+ ( const String& rClassname, const String& rElemClass, BOOL=TRUE );
+ SbxStdCollection( const SbxStdCollection& );
+ SbxStdCollection& operator=( const SbxStdCollection& );
+ virtual void Insert( SbxVariable* );
+ const String& GetElementClass() const { return aElemClass; }
+};
+
+#endif
+
+#ifndef __SBX_SBXREFS_HXX
+#define __SBX_SBXREFS_HXX
+
+SV_IMPL_REF(SbxBase)
+
+SV_IMPL_REF(SbxVariable)
+
+#ifndef SBX_ARRAY_DECL_DEFINED
+#define SBX_ARRAY_DECL_DEFINED
+SV_DECL_REF(SbxArray)
+#endif
+#ifndef SBX_ARRAY_IMPL_DEFINED
+#define SBX_ARRAY_IMPL_DEFINED
+SV_IMPL_REF(SbxArray)
+#endif
+
+#ifndef SBX_INFO_DECL_DEFINED
+#define SBX_INFO_DECL_DEFINED
+SV_DECL_REF(SbxInfo)
+#endif
+#ifndef SBX_INFO_IMPL_DEFINED
+#define SBX_INFO_IMPL_DEFINED
+SV_IMPL_REF(SbxInfo)
+#endif
+
+#ifndef SBX_DIMARRAY_DECL_DEFINED
+#define SBX_DIMARRAY_DECL_DEFINED
+SV_DECL_REF(SbxDimArray)
+#endif
+SV_IMPL_REF(SbxDimArray)
+
+#endif
+
+#endif
diff --git a/basic/inc/basic/sbxbase.hxx b/basic/inc/basic/sbxbase.hxx
new file mode 100644
index 000000000000..dc7707cce57d
--- /dev/null
+++ b/basic/inc/basic/sbxbase.hxx
@@ -0,0 +1,63 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sbxbase.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SBXBASE_HXX
+#define _SBXBASE_HXX
+
+#include <i18npool/lang.h>
+#include "tools/list.hxx"
+#include "svtools/svarray.hxx"
+#include <basic/sbxdef.hxx>
+
+class SbxFactory;
+class SbxVariable;
+class SbxBasicFormater;
+
+SV_DECL_PTRARR_DEL(SbxFacs,SbxFactory*,5,5)
+DECLARE_LIST(SbxVarList_Impl, SbxVariable*)
+
+// AppData-Struktur for SBX:
+struct SbxAppData
+{
+ SbxError eSbxError; // Error code
+ SbxFacs aFacs; // Factories
+ SbxVarList_Impl aVars; // for Dump
+ SbxBasicFormater *pBasicFormater; // Pointer to Format()-Command helper class
+
+ LanguageType eBasicFormaterLangType;
+ // It might be useful to store this class 'global' because some string reosurces are saved here
+
+ SbxAppData() : eSbxError( SbxERR_OK ), aFacs(), pBasicFormater( NULL ) {}
+ ~SbxAppData();
+};
+
+SbxAppData* GetSbxData_Impl();
+
+#endif
diff --git a/basic/inc/basic/sbxcore.hxx b/basic/inc/basic/sbxcore.hxx
new file mode 100644
index 000000000000..6c1e0bbdfb20
--- /dev/null
+++ b/basic/inc/basic/sbxcore.hxx
@@ -0,0 +1,184 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sbxcore.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SBXCORE_HXX
+#define _SBXCORE_HXX
+
+#include <tools/rtti.hxx>
+#include <tools/ref.hxx>
+#include <tools/debug.hxx>
+
+#include <basic/sbxdef.hxx>
+
+class SvStream;
+class String;
+class UniString;
+
+// The following Macro defines four (five) necessary methods within a
+// SBX object. LoadPrivateData() and StorePrivateData() must be implemented.
+// They are necessary for loading/storing the data of derived classes.
+// Load() and Store() must not be overridden.
+
+// This version of the Macros does not define Load/StorePrivateData()-methods
+#define SBX_DECL_PERSIST_NODATA( nCre, nSbxId, nVer ) \
+ virtual UINT32 GetCreator() const { return nCre; } \
+ virtual UINT16 GetVersion() const { return nVer; } \
+ virtual UINT16 GetSbxId() const { return nSbxId; }
+
+#define SBX_DECL_PERSIST_NODATA_() \
+ virtual UINT32 GetCreator() const; \
+ virtual UINT16 GetVersion() const; \
+ virtual UINT16 GetSbxId() const;
+
+// This version of the macro defines Load/StorePrivateData()-methods
+#define SBX_DECL_PERSIST( nCre, nSbxId, nVer ) \
+ virtual BOOL LoadPrivateData( SvStream&, USHORT ); \
+ virtual BOOL StorePrivateData( SvStream& ) const; \
+ SBX_DECL_PERSIST_NODATA( nCre, nSbxId, nVer )
+
+#define SBX_DECL_PERSIST_() \
+ virtual BOOL LoadPrivateData( SvStream&, USHORT ); \
+ virtual BOOL StorePrivateData( SvStream& ) const; \
+ SBX_DECL_PERSIST_NODATA_()
+
+#define SBX_IMPL_PERSIST( C, nCre, nSbxId, nVer ) \
+ UINT32 C::GetCreator() const { return nCre; } \
+ UINT16 C::GetVersion() const { return nVer; } \
+ UINT16 C::GetSbxId() const { return nSbxId; }
+
+class SbxBase;
+class SbxFactory;
+class SbxObject;
+
+DBG_NAMEEX(SbxBase)
+
+class SbxBaseImpl;
+
+class SbxBase : virtual public SvRefBase
+{
+ SbxBaseImpl* mpSbxBaseImpl; // Impl data
+
+ virtual BOOL LoadData( SvStream&, USHORT );
+ virtual BOOL StoreData( SvStream& ) const;
+protected:
+ USHORT nFlags; // Flag-Bits
+
+ SbxBase();
+ SbxBase( const SbxBase& );
+ SbxBase& operator=( const SbxBase& );
+ virtual ~SbxBase();
+ SBX_DECL_PERSIST(0,0,0);
+public:
+ TYPEINFO();
+ inline void SetFlags( USHORT n );
+ inline USHORT GetFlags() const;
+ inline void SetFlag( USHORT n );
+ inline void ResetFlag( USHORT n );
+ inline BOOL IsSet( USHORT n ) const;
+ inline BOOL IsReset( USHORT n ) const;
+ inline BOOL CanRead() const;
+ inline BOOL CanWrite() const;
+ inline BOOL IsModified() const;
+ inline BOOL IsConst() const;
+ inline BOOL IsHidden() const;
+ inline BOOL IsVisible() const;
+
+ virtual BOOL IsFixed() const;
+ virtual void SetModified( BOOL );
+
+ virtual SbxDataType GetType() const;
+ virtual SbxClassType GetClass() const;
+
+ virtual void Clear();
+
+ static SbxBase* Load( SvStream& );
+ static void Skip( SvStream& );
+ BOOL Store( SvStream& );
+ virtual BOOL LoadCompleted();
+ virtual BOOL StoreCompleted();
+
+ static SbxError GetError();
+ static void SetError( SbxError );
+ static BOOL IsError();
+ static void ResetError();
+
+ // Set the factory for Load/Store/Create
+ static void AddFactory( SbxFactory* );
+ static void RemoveFactory( SbxFactory* );
+
+ static SbxBase* Create( UINT16, UINT32=SBXCR_SBX );
+ static SbxObject* CreateObject( const String& );
+ // Sbx solution as replacement for SfxBroadcaster::Enable()
+ static void StaticEnableBroadcasting( BOOL bEnable );
+ static BOOL StaticIsEnabledBroadcasting( void );
+};
+
+#ifndef SBX_BASE_DECL_DEFINED
+#define SBX_BASE_DECL_DEFINED
+SV_DECL_REF(SbxBase)
+#endif
+
+inline void SbxBase::SetFlags( USHORT n )
+{ DBG_CHKTHIS( SbxBase, 0 ); nFlags = n; }
+
+inline USHORT SbxBase::GetFlags() const
+{ DBG_CHKTHIS( SbxBase, 0 ); return nFlags; }
+
+inline void SbxBase::SetFlag( USHORT n )
+{ DBG_CHKTHIS( SbxBase, 0 ); nFlags |= n; }
+
+inline void SbxBase::ResetFlag( USHORT n )
+{ DBG_CHKTHIS( SbxBase, 0 ); nFlags &= ~n; }
+
+inline BOOL SbxBase::IsSet( USHORT n ) const
+{ DBG_CHKTHIS( SbxBase, 0 ); return BOOL( ( nFlags & n ) != 0 ); }
+
+inline BOOL SbxBase::IsReset( USHORT n ) const
+{ DBG_CHKTHIS( SbxBase, 0 ); return BOOL( ( nFlags & n ) == 0 ); }
+
+inline BOOL SbxBase::CanRead() const
+{ DBG_CHKTHIS( SbxBase, 0 ); return IsSet( SBX_READ ); }
+
+inline BOOL SbxBase::CanWrite() const
+{ DBG_CHKTHIS( SbxBase, 0 ); return IsSet( SBX_WRITE ); }
+
+inline BOOL SbxBase::IsModified() const
+{ DBG_CHKTHIS( SbxBase, 0 ); return IsSet( SBX_MODIFIED ); }
+
+inline BOOL SbxBase::IsConst() const
+{ DBG_CHKTHIS( SbxBase, 0 ); return IsSet( SBX_CONST ); }
+
+inline BOOL SbxBase::IsHidden() const
+{ DBG_CHKTHIS( SbxBase, 0 ); return IsSet( SBX_HIDDEN ); }
+
+inline BOOL SbxBase::IsVisible() const
+{ DBG_CHKTHIS( SbxBase, 0 ); return IsReset( SBX_INVISIBLE ); }
+
+#endif
diff --git a/basic/inc/basic/sbxdef.hxx b/basic/inc/basic/sbxdef.hxx
new file mode 100644
index 000000000000..ff19cdc43e54
--- /dev/null
+++ b/basic/inc/basic/sbxdef.hxx
@@ -0,0 +1,383 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sbxdef.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+
+#ifndef _SBXDEF_HXX
+#define _SBXDEF_HXX
+
+
+#ifndef __RSC
+#ifndef _SOLAR_H
+#include <tools/solar.h>
+#endif
+#include "tools/errcode.hxx"
+
+#ifndef _SBX_CLASS_TYPE
+#define _SBX_CLASS_TYPE
+
+enum SbxClassType { // SBX-class-IDs (order is important!)
+ SbxCLASS_DONTCARE = 1, // don't care (search, not 0 due to StarBASIC)
+ SbxCLASS_ARRAY, // Array of SbxVariables
+ SbxCLASS_VALUE, // simple value
+ SbxCLASS_VARIABLE, // Variable (from here there is Broadcaster)
+ SbxCLASS_METHOD, // Method (Function or Sub)
+ SbxCLASS_PROPERTY, // Property
+ SbxCLASS_OBJECT // Object
+};
+
+#endif
+
+#ifndef _SBX_DATA_TYPE
+#define _SBX_DATA_TYPE
+
+enum SbxDataType {
+ SbxEMPTY = 0, // * Uninitialized
+ SbxNULL = 1, // * Contains no valid data
+ SbxINTEGER = 2, // * Integer (INT16)
+ SbxLONG = 3, // * Long integer (INT32)
+ SbxSINGLE = 4, // * Single-precision floating point number (float)
+ SbxDOUBLE = 5, // * Double-precision floating point number (double)
+ SbxCURRENCY = 6, // Currency (INT64)
+ SbxDATE = 7, // * Date (double)
+ SbxSTRING = 8, // * String (StarView)
+ SbxOBJECT = 9, // * SbxBase object pointer
+ SbxERROR = 10, // * Error (UINT16)
+ SbxBOOL = 11, // * Boolean (0 or -1)
+ SbxVARIANT = 12, // * Anzeige fuer varianten Datentyp
+ SbxDATAOBJECT = 13, // * Common data object w/o ref count
+
+ SbxCHAR = 16, // * signed char
+ SbxBYTE = 17, // * unsigned char
+ SbxUSHORT = 18, // * unsigned short (UINT16)
+ SbxULONG = 19, // * unsigned long (UINT32)
+ SbxLONG64 = 20, // signed 64-bit int
+ SbxULONG64 = 21, // unsigned 64-bit int
+ SbxINT = 22, // * signed machine-dependent int
+ SbxUINT = 23, // * unsigned machine-dependent int
+ SbxVOID = 24, // * no value (= SbxEMPTY)
+ SbxHRESULT = 25, // HRESULT
+ SbxPOINTER = 26, // generic pointer
+ SbxDIMARRAY = 27, // dimensioned array
+ SbxCARRAY = 28, // C style array
+ SbxUSERDEF = 29, // user defined
+ SbxLPSTR = 30, // * null terminated string
+ SbxLPWSTR = 31, // wide null terminated string
+ SbxCoreSTRING = 32, // AB 10.4.97, fuer GetCoreString(), nur zum Konvertieren
+ SbxWSTRING = 33, // AB 4.10.2000 Reimplemented for backwards compatibility (#78919)
+ SbxWCHAR = 34, // AB 4.10.2000 Reimplemented for backwards compatibility (#78919)
+ SbxSALINT64 = 35, // for UNO hyper
+ SbxSALUINT64 = 36, // for UNO unsigned hyper
+ SbxDECIMAL = 37, // for UNO/automation Decimal
+
+ SbxVECTOR = 0x1000, // simple counted array
+ SbxARRAY = 0x2000, // array
+ SbxBYREF = 0x4000, // access by reference
+
+ SbxSV1 = 128, // first defined data type for StarView
+ SbxMEMORYSTREAM, // SvMemoryStream
+ SbxSTORAGE, // SvStorage
+
+ SbxUSER1 = 256, // first user defined data type
+ SbxUSERn = 2047 // last user defined data type
+};
+
+#endif
+
+#ifndef _SBX_OPERATOR
+#define _SBX_OPERATOR
+
+enum SbxOperator {
+ // Arithmetical:
+ SbxEXP, // this ^ var
+ SbxMUL, // this * var
+ SbxDIV, // this / var
+ SbxMOD, // this MOD var
+ SbxPLUS, // this + var
+ SbxMINUS, // this - var
+ SbxNEG, // -this (var is ignored)
+ SbxIDIV, // this / var (both operands max. INT32!)
+ // Boolean operators (max INT32!):
+ SbxAND, // this & var
+ SbxOR, // this | var
+ SbxXOR, // this ^ var
+ SbxEQV, // ~this ^ var
+ SbxIMP, // ~this | var
+ SbxNOT, // ~this (var is ignored)
+ // String-concat:
+ SbxCAT, // this & var
+ // Comparisons:
+ SbxEQ, // this = var
+ SbxNE, // this <> var
+ SbxLT, // this < var
+ SbxGT, // this > var
+ SbxLE, // this <= var
+ SbxGE // this >= var
+};
+
+#endif
+
+#ifndef _SBX_NAME_TYPE
+#define _SBX_NAME_TYPE
+
+enum SbxNameType { // Type of the questioned name of a variable
+ SbxNAME_NONE, // plain name
+ SbxNAME_SHORT, // Name(A,B)
+ SbxNAME_SHORT_TYPES, // Name%(A%,B$)
+ SbxNAME_LONG_TYPES // Name(A As Integer, B As String) As Integer
+};
+
+#endif
+
+// AB: 20.3.96: New error messages
+typedef ULONG SbxError; // Preserve old type
+
+#endif
+// von #ifndef __RSC
+
+
+// New error codes per define
+#define ERRCODE_SBX_OK ERRCODE_NONE // processed
+#define ERRCODE_SBX_SYNTAX (1UL | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // Syntaxerror in parser (where else could syntax errors happen? ;-)
+#define ERRCODE_SBX_NOTIMP (2UL | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_NOTSUPPORTED) // not possible
+#define ERRCODE_SBX_OVERFLOW (3UL | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_SBX) // overflow
+#define ERRCODE_SBX_BOUNDS (4UL | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_SBX) // Invalid array index
+#define ERRCODE_SBX_ZERODIV (5UL | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_SBX) // Division by zero
+#define ERRCODE_SBX_CONVERSION (6UL | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_SBX) // wrong data type
+#define ERRCODE_SBX_BAD_PARAMETER (7UL | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // invalid Parameter
+#define ERRCODE_SBX_PROC_UNDEFINED (8UL | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // BASIC-Sub or Function undefined
+#define ERRCODE_SBX_ERROR (9UL | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_UNKNOWN) // other object-related error
+#define ERRCODE_SBX_NO_OBJECT (10UL | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Object variable unassigned
+#define ERRCODE_SBX_CANNOT_LOAD (11UL | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_CREATE) // Object cannot be loaded or initialized
+#define ERRCODE_SBX_BAD_INDEX (12UL | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_SBX) // Invalid object index
+#define ERRCODE_SBX_NO_ACTIVE_OBJECT (13UL | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_ACCESS) // Object ist not activated
+#define ERRCODE_SBX_BAD_PROP_VALUE (14UL | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Bad property value
+#define ERRCODE_SBX_PROP_READONLY (15UL | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_READ) // Property is read only
+#define ERRCODE_SBX_PROP_WRITEONLY (16UL | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_WRITE) // Property is write only
+#define ERRCODE_SBX_INVALID_OBJECT (17UL | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_ACCESS) // Invalid object reference
+#define ERRCODE_SBX_NO_METHOD (18UL | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Property oder Methode unbekannt
+#define ERRCODE_SBX_INVALID_USAGE_OBJECT (19UL | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_ACCESS) // Invalid object usage
+#define ERRCODE_SBX_NO_OLE (20UL | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_ACCESS) // No OLE-Object
+#define ERRCODE_SBX_BAD_METHOD (21UL | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Method not supported
+#define ERRCODE_SBX_OLE_ERROR (22UL | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // OLE Automation Error
+#define ERRCODE_SBX_BAD_ACTION (23UL | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_NOTSUPPORTED) // Action not supported
+#define ERRCODE_SBX_NO_NAMED_ARGS (24UL | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // No named arguments
+#define ERRCODE_SBX_BAD_LOCALE (25UL | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_NOTSUPPORTED) // Locale settings not supported
+#define ERRCODE_SBX_NAMED_NOT_FOUND (26UL | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Unknown named argument
+#define ERRCODE_SBX_NOT_OPTIONAL (27UL | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Argument not optional
+#define ERRCODE_SBX_WRONG_ARGS (28UL | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_SBX) // Invalid number of arguments
+#define ERRCODE_SBX_NOT_A_COLL (29UL | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_RUNTIME) // Object contains no elements
+#define LAST_SBX_ERROR_ID 29UL
+
+
+// Less important for resources
+#ifndef __RSC
+
+// Map old codes to new ones
+#define SbxERR_OK ERRCODE_SBX_OK
+#define SbxERR_SYNTAX ERRCODE_SBX_SYNTAX
+#define SbxERR_NOTIMP ERRCODE_SBX_NOTIMP
+#define SbxERR_OVERFLOW ERRCODE_SBX_OVERFLOW
+#define SbxERR_BOUNDS ERRCODE_SBX_BOUNDS
+#define SbxERR_ZERODIV ERRCODE_SBX_ZERODIV
+#define SbxERR_CONVERSION ERRCODE_SBX_CONVERSION
+#define SbxERR_BAD_PARAMETER ERRCODE_SBX_BAD_PARAMETER
+#define SbxERR_PROC_UNDEFINED ERRCODE_SBX_PROC_UNDEFINED
+#define SbxERR_ERROR ERRCODE_SBX_ERROR
+#define SbxERR_NO_OBJECT ERRCODE_SBX_NO_OBJECT
+#define SbxERR_CANNOT_LOAD ERRCODE_SBX_CANNOT_LOAD
+#define SbxERR_BAD_INDEX ERRCODE_SBX_BAD_INDEX
+#define SbxERR_NO_ACTIVE_OBJECT ERRCODE_SBX_NO_ACTIVE_OBJECT
+#define SbxERR_BAD_PROP_VALUE ERRCODE_SBX_BAD_PROP_VALUE
+#define SbxERR_PROP_READONLY ERRCODE_SBX_PROP_READONLY
+#define SbxERR_PROP_WRITEONLY ERRCODE_SBX_PROP_WRITEONLY
+#define SbxERR_INVALID_OBJECT ERRCODE_SBX_INVALID_OBJECT
+#define SbxERR_NO_METHOD ERRCODE_SBX_NO_METHOD
+#define SbxERR_INVALID_USAGE_OBJECT ERRCODE_SBX_INVALID_USAGE_OBJECT
+#define SbxERR_NO_OLE ERRCODE_SBX_NO_OLE
+#define SbxERR_BAD_METHOD ERRCODE_SBX_BAD_METHOD
+#define SbxERR_OLE_ERROR ERRCODE_SBX_OLE_ERROR
+#define SbxERR_BAD_ACTION ERRCODE_SBX_BAD_ACTION
+#define SbxERR_NO_NAMED_ARGS ERRCODE_SBX_NO_NAMED_ARGS
+#define SbxERR_BAD_LOCALE ERRCODE_SBX_BAD_LOCALE
+#define SbxERR_NAMED_NOT_FOUND ERRCODE_SBX_NAMED_NOT_FOUND
+#define SbxERR_NOT_OPTIONAL ERRCODE_SBX_NOT_OPTIONAL
+#define SbxERR_WRONG_ARGS ERRCODE_SBX_WRONG_ARGS
+#define SbxERR_NOT_A_COLL ERRCODE_SBX_NOT_A_COLL
+
+
+/* Old codes with VB error codes
+enum SbxError { // Ergebnis einer Rechenoperation/Konversion
+ SbxERR_OK = 0, // durchgefuehrt
+ SbxERR_SYNTAX = 2, // Syntaxfehler im Parser
+ SbxERR_NOTIMP = 5, // nicht moeglich
+ SbxERR_OVERFLOW = 6, // Ueberlauf
+ SbxERR_BOUNDS = 9, // Array-Index ungueltig
+ SbxERR_ZERODIV = 11, // Division durch Null
+ SbxERR_CONVERSION = 13, // falscher Datentyp
+ SbxERR_BAD_PARAMETER = 14, // ungltiger Parameter
+ SbxERR_PROC_UNDEFINED = 35, // BASIC-Sub oder Function undefiniert
+ SbxERR_ERROR = 51, // andere Fehler
+ // Objektbezogene Fehler
+ SbxERR_NO_OBJECT = 91, // Objektvariable nicht belegt
+ SbxERR_CANNOT_LOAD = 323, // Objekt kann nicht geladen/eingerichtet werden
+ SbxERR_BAD_INDEX = 341, // Invalid object index
+ SbxERR_NO_ACTIVE_OBJECT=366,// Objekt ist nicht aktiviert
+ SbxERR_BAD_PROP_VALUE = 380,// Bad property value
+ SbxERR_PROP_READONLY = 382, // Property is read only
+ SbxERR_PROP_WRITEONLY = 394,// Property is write only
+ SbxERR_INVALID_OBJECT = 420,// Invalid object reference
+ SbxERR_NO_METHOD = 423, // Property oder Methode unbekannt
+ SbxERR_INVALID_USAGE_OBJECT=425,// Falsche Verwendung eines Objekts
+ SbxERR_NO_OLE = 430, // Kein OLE-Objekt
+ SbxERR_BAD_METHOD = 438, // Methode nicht untersttzt
+ SbxERR_OLE_ERROR = 440, // OLE Automation-Fehler
+ SbxERR_BAD_ACTION = 445, // Aktion nicht untersttzt
+ SbxERR_NO_NAMED_ARGS = 446, // Keine benannten Argumente
+ SbxERR_BAD_LOCALE = 447, // Laenderspezifische Einstellungen nicht untersttzt
+ SbxERR_NAMED_NOT_FOUND = 448,// Unbekanntes benanntes Argument
+ SbxERR_NOT_OPTIONAL = 449, // Argument nicht optional
+ SbxERR_WRONG_ARGS = 450, // Falsche Zahl von Argumenten
+ SbxERR_NOT_A_COLL = 451 // Objekt enth„lt keine Elemente
+};
+*/
+
+// Flag-Bits:
+#define SBX_READ 0x0001 // Read permission
+#define SBX_WRITE 0x0002 // Write permission
+#define SBX_READWRITE 0x0003 // Read/Write permission
+#define SBX_DONTSTORE 0x0004 // Don't store object
+#define SBX_MODIFIED 0x0008 // Object was changed
+#define SBX_FIXED 0x0010 // Fixed data type (SbxVariable)
+#define SBX_CONST 0x0020 // Definition of const value
+#define SBX_OPTIONAL 0x0040 // Parameter is optional
+#define SBX_HIDDEN 0x0080 // Element is invisible
+#define SBX_INVISIBLE 0x0100 // Element is not found by Find()
+#define SBX_EXTSEARCH 0x0200 // Object is searched completely
+#define SBX_EXTFOUND 0x0400 // Variable was found through extended search
+#define SBX_GBLSEARCH 0x0800 // Global search via Parents
+#define SBX_RESERVED 0x1000 // reserved
+#define SBX_PRIVATE 0x1000 // #110004, #112015, cannot conflict with SBX_RESERVED
+#define SBX_NO_BROADCAST 0x2000 // No broadcast on Get/Put
+#define SBX_REFERENCE 0x4000 // Parameter is Reference (DLL-call)
+#define SBX_NO_MODIFY 0x8000 // SetModified is suppressed
+
+// Broadcaster-IDs:
+#define SBX_HINT_DYING SFX_HINT_DYING
+#define SBX_HINT_DATAWANTED SFX_HINT_USER00
+#define SBX_HINT_DATACHANGED SFX_HINT_DATACHANGED
+#define SBX_HINT_CONVERTED SFX_HINT_USER01
+#define SBX_HINT_INFOWANTED SFX_HINT_USER02
+#define SBX_HINT_OBJECTCHANGED SFX_HINT_USER03
+
+// List of all creators for Load/Store
+
+#define SBXCR_SBX 0x20584253 // SBX(blank)
+
+// List of predefined SBX-IDs. New SBX-IDs must be precisly defined so that
+// they are unique within the Stream and appropriate Factory.
+
+#define SBXID_VALUE 0x4E4E // NN: SbxValue
+#define SBXID_VARIABLE 0x4156 // VA: SbxVariable
+#define SBXID_ARRAY 0x5241 // AR: SbxArray
+#define SBXID_DIMARRAY 0x4944 // DI: SbxDimArray
+#define SBXID_OBJECT 0x424F // OB: SbxObject
+#define SBXID_COLLECTION 0x4F43 // CO: SbxCollection
+#define SBXID_FIXCOLLECTION 0x4346 // FC: SbxStdCollection
+#define SBXID_METHOD 0x454D // ME: SbxMethod
+#define SBXID_PROPERTY 0x5250 // PR: SbxProperty
+
+// StarBASIC restricts the base data type to different intervals.
+// These intervals are fixed due to portability and independent
+// of the implementation. Only type double is greedy and takes
+// what it gets.
+
+#define SbxMAXCHAR ((sal_Unicode)65535)
+#define SbxMINCHAR (0)
+#define SbxMAXBYTE ( 255)
+#define SbxMAXINT ( 32767)
+#define SbxMININT (-32768)
+#define SbxMAXUINT ((UINT16) 65535)
+#define SbxMAXLNG ( 2147483647)
+#define SbxMINLNG ((INT32)(-2147483647-1))
+#define SbxMAXULNG ((UINT32) 0xffffffff)
+
+#define SbxMAXSALINT64 SAL_MAX_INT64
+#define SbxMINSALINT64 SAL_MIN_INT64
+#define SbxMAXSALUINT64 SAL_MAX_UINT64
+
+#define SbxMAXSNG ( 3.402823e+38)
+#define SbxMINSNG (-3.402823e+38)
+#define SbxMAXSNG2 ( 1.175494351e-38)
+#define SbxMINSNG2 (-1.175494351e-38)
+#define SbxMAXCURR ( 922337203685477.5807)
+#define SbxMINCURR (-922337203685477.5808)
+#define CURRENCY_FACTOR 10000
+#define SbxMAXCURRLNG (SbxMAXLNG/CURRENCY_FACTOR)
+#define SbxMINCURRLNG (SbxMINLNG/CURRENCY_FACTOR)
+
+// Max valid offset index of a Sbx-Array (due to 64K limit)
+#define SBX_MAXINDEX 0x3FF0
+#define SBX_MAXINDEX32 SbxMAXLNG
+
+// The numeric values of TRUE and FALSE
+enum SbxBOOL { SbxFALSE = 0, SbxTRUE = -1 };
+
+#endif // __RSC
+
+#endif
diff --git a/basic/inc/basic/sbxfac.hxx b/basic/inc/basic/sbxfac.hxx
new file mode 100644
index 000000000000..3b5b67bf0360
--- /dev/null
+++ b/basic/inc/basic/sbxfac.hxx
@@ -0,0 +1,51 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sbxfac.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef __SBX_SBX_FACTORY_HXX
+#define __SBX_SBX_FACTORY_HXX
+
+#include <basic/sbxdef.hxx>
+
+class SbxBase;
+class SbxObject;
+class String;
+class UniString;
+
+class SbxFactory
+{
+ BOOL bHandleLast; // TRUE: Factory is asked at last because of its expensiveness
+public:
+ SbxFactory( BOOL bLast=FALSE ) { bHandleLast = bLast; }
+ BOOL IsHandleLast( void ) { return bHandleLast; }
+ virtual SbxBase* Create( UINT16 nSbxId, UINT32 = SBXCR_SBX );
+ virtual SbxObject* CreateObject( const String& );
+};
+
+#endif
diff --git a/basic/inc/basic/sbxform.hxx b/basic/inc/basic/sbxform.hxx
new file mode 100644
index 000000000000..40d0d764cfd2
--- /dev/null
+++ b/basic/inc/basic/sbxform.hxx
@@ -0,0 +1,184 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sbxform.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SBXFORM_HXX
+#define _SBXFORM_HXX
+
+//====================================================================
+// Implementation class for Basic command: Format$( d,formatStr )
+//====================================================================
+/*
+ Grammar of format string (a try):
+ -----------------------------------------------
+
+ format_string := {\special_char} general_format | scientific_format {\special_char} {;format_string}
+ general_format := {#[,]}{0[,]}[.{0}{#}]
+ scientific_format := {0}[.{0}{#}](e | E)(+ | -){#}{0}
+
+ percent_char := '%'
+ special_char := \char | + | - | ( | ) | $ | space_char
+ char := all_ascii_chars
+ space_char := ' '
+
+ {} repeated multiple times (incl. zero times)
+ [] exactly one or zero times
+ () parenthesis, e.g. (e | E) means e or E times
+
+ Additional predefined formats for the format string:
+ "General Number"
+ "Currency"
+ "Fixed"
+ "Standard"
+ "Percent"
+ "Scientific"
+ "Yes/No"
+ "True/False"
+ "On/Off"
+
+ Note: invalid format string are ignored just as in VisualBasic, the output is
+ probably 'undefined'. ASCII letters are outputted directly.
+
+ Constraints in VisualBasic:
+ - the exponent (scientific syntax) has a maximum of three digits!
+
+ Constraints of new implementation:
+ - the '+' sign is not allowed as wildcard in the mantissa
+
+ TODO:
+ - Date formatting
+ Wildcards are: 'h', 'm', 's', 'y'
+ predefined String-Constants/Commands:
+ "AMPM", "Long Date", "Long Time"
+*/
+
+/*
+ There are two possibilities to get the number of digits of a number:
+
+ a) use sprintf()
+ b) use log10() and pow() digit
+*/
+#define _with_sprintf // use a)
+
+#include <tools/string.hxx>
+
+class SbxBasicFormater {
+ public:
+ // Constructor takes signs for decimal point, thousand separation sign
+ // and necessary resource strings.
+ SbxBasicFormater( sal_Unicode _cDecPoint, sal_Unicode _cThousandSep,
+ String _sOnStrg,
+ String _sOffStrg,
+ String _sYesStrg,
+ String _sNoStrg,
+ String _sTrueStrg,
+ String _sFalseStrg,
+ String _sCurrencyStrg,
+ String _sCurrencyFormatStrg );
+
+ /* Basic command: Format$( number,format-string )
+
+ Parameter:
+ dNumber : number to be formated
+ sFormatStrg : the Format-String, e.g. ###0.0###
+
+ Return value:
+ String containing the formatted output
+ */
+ String BasicFormat( double dNumber, String sFormatStrg );
+ String BasicFormatNull( String sFormatStrg );
+
+ static BOOL isBasicFormat( String sFormatStrg );
+
+ private:
+ //*** some helper methods ***
+ //void ShowError( char *sErrMsg );
+ inline void ShiftString( String& sStrg, USHORT nStartPos );
+ inline void StrAppendChar( String& sStrg, sal_Unicode ch );
+ void AppendDigit( String& sStrg, short nDigit );
+ void LeftShiftDecimalPoint( String& sStrg );
+ void StrRoundDigit( String& sStrg, short nPos, BOOL& bOverflow );
+ void StrRoundDigit( String& sStrg, short nPos );
+ void ParseBack( String& sStrg, const String& sFormatStrg,
+ short nFormatPos );
+#ifdef _with_sprintf
+ // Methods for string conversion with sprintf():
+ void InitScan( double _dNum );
+ void InitExp( double _dNewExp );
+ short GetDigitAtPosScan( short nPos, BOOL& bFoundFirstDigit );
+ short GetDigitAtPosExpScan( double dNewExponent, short nPos,
+ BOOL& bFoundFirstDigit );
+ short GetDigitAtPosExpScan( short nPos, BOOL& bFoundFirstDigit );
+#else
+ // Methods for direct 'calculation' with log10() and pow():
+ short GetDigitAtPos( double dNumber, short nPos, double& dNextNumber,
+ BOOL& bFoundFirstDigit );
+ short RoundDigit( double dNumber );
+#endif
+ String GetPosFormatString( const String& sFormatStrg, BOOL & bFound );
+ String GetNegFormatString( const String& sFormatStrg, BOOL & bFound );
+ String Get0FormatString( const String& sFormatStrg, BOOL & bFound );
+ String GetNullFormatString( const String& sFormatStrg, BOOL & bFound );
+ short AnalyseFormatString( const String& sFormatStrg,
+ short& nNoOfDigitsLeft, short& nNoOfDigitsRight,
+ short& nNoOfOptionalDigitsLeft,
+ short& nNoOfExponentDigits,
+ short& nNoOfOptionalExponentDigits,
+ BOOL& bPercent, BOOL& bCurrency, BOOL& bScientific,
+ BOOL& bGenerateThousandSeparator,
+ short& nMultipleThousandSeparators );
+ void ScanFormatString( double dNumber, const String& sFormatStrg,
+ String& sReturnStrg, BOOL bCreateSign );
+
+ //*** Data ***
+ sal_Unicode cDecPoint; // sign for the decimal point
+ sal_Unicode cThousandSep; // sign for thousand delimiter
+ // Text for output:
+ String sOnStrg;
+ String sOffStrg;
+ String sYesStrg;
+ String sNoStrg;
+ String sTrueStrg;
+ String sFalseStrg;
+ String sCurrencyStrg;
+ String sCurrencyFormatStrg;
+
+ //*** temporary data for scan loop ***
+ //-----------------------------------------------
+ // String containing the number in scientific format
+ String sSciNumStrg;
+ // String containing the exponent of the number
+ String sNumExpStrg;
+ double dNum; // the number that is scanned
+ short nNumExp; // the exponent of the number
+ short nExpExp; // the number of digits in the exponent
+};
+
+#endif
+
diff --git a/basic/inc/basic/sbxmeth.hxx b/basic/inc/basic/sbxmeth.hxx
new file mode 100644
index 000000000000..5731a35ed498
--- /dev/null
+++ b/basic/inc/basic/sbxmeth.hxx
@@ -0,0 +1,65 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sbxmeth.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef __SBX_SBXMETHOD_HXX
+#define __SBX_SBXMETHOD_HXX
+
+#include <basic/sbxvar.hxx>
+
+class SbxMethodImpl;
+
+class SbxMethod : public SbxVariable
+{
+ SbxMethodImpl* mpSbxMethodImpl; // Impl data
+
+public:
+ SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_METHOD,1);
+ TYPEINFO();
+ SbxMethod( const String& r, SbxDataType t )
+ : SbxVariable( t ) { SetName( r ); }
+ SbxMethod( const SbxMethod& r ) : SvRefBase( r ), SbxVariable( r ) {}
+ SbxMethod& operator=( const SbxMethod& r )
+ { SbxVariable::operator=( r ); return *this; }
+ BOOL Run( SbxValues* pValues = NULL );
+ virtual SbxClassType GetClass() const;
+};
+
+#ifndef __SBX_SBXMETHODREF_HXX
+#define __SBX_SBXMETHODREF_HXX
+
+#ifndef SBX_METHOD_DECL_DEFINED
+#define SBX_METHOD_DECL_DEFINED
+SV_DECL_REF(SbxMethod)
+#endif
+SV_IMPL_REF(SbxMethod)
+
+#endif
+#endif
+
diff --git a/basic/inc/basic/sbxmstrm.hxx b/basic/inc/basic/sbxmstrm.hxx
new file mode 100644
index 000000000000..92181051be24
--- /dev/null
+++ b/basic/inc/basic/sbxmstrm.hxx
@@ -0,0 +1,52 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sbxmstrm.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SBXMSTRM_HXX
+#define _SBXMSTRM_HXX 1
+
+#include <tools/stream.hxx>
+#include <basic/sbxdef.hxx>
+#include <basic/sbxcore.hxx>
+
+SV_DECL_REF(SbxMemoryStream)
+
+class SbxMemoryStream : public SbxBase, public SvMemoryStream
+{
+ public:
+ SbxMemoryStream(ULONG nInitSize_=512, ULONG nResize_=64) :
+ SvMemoryStream(nInitSize_,nResize_) {}
+ ~SbxMemoryStream();
+
+ virtual SbxDataType GetType() const;
+};
+
+SV_IMPL_REF(SbxMemoryStream)
+
+#endif
diff --git a/basic/inc/basic/sbxobj.hxx b/basic/inc/basic/sbxobj.hxx
new file mode 100644
index 000000000000..6a62f4a52978
--- /dev/null
+++ b/basic/inc/basic/sbxobj.hxx
@@ -0,0 +1,128 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sbxobj.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SBX_SBXOBJECT_HXX
+#define _SBX_SBXOBJECT_HXX
+
+#include <svtools/lstner.hxx>
+#include <basic/sbxvar.hxx>
+
+///////////////////////////////////////////////////////////////////////////
+
+class SbxProperty;
+class SvDispatch;
+
+class SbxObjectImpl;
+
+class SbxObject : public SbxVariable, public SfxListener
+{
+ SbxObjectImpl* mpSbxObjectImpl; // Impl data
+
+ SbxArray* FindVar( SbxVariable*, USHORT& );
+ // AB 23.3.1997, special method for VCPtrRemove (see below)
+ SbxArray* VCPtrFindVar( SbxVariable*, USHORT& );
+protected:
+ SbxArrayRef pMethods; // Methods
+ SbxArrayRef pProps; // Properties
+ SbxArrayRef pObjs; // Objects
+ SbxProperty* pDfltProp; // Default-Property
+ String aClassName; // Classname
+ String aDfltPropName;
+ virtual BOOL LoadData( SvStream&, USHORT );
+ virtual BOOL StoreData( SvStream& ) const;
+ virtual ~SbxObject();
+ virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
+ const SfxHint& rHint, const TypeId& rHintType );
+public:
+ SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_OBJECT,1);
+ TYPEINFO();
+ SbxObject( const String& rClassname );
+ SbxObject( const SbxObject& );
+ SbxObject& operator=( const SbxObject& );
+ virtual SbxDataType GetType() const;
+ virtual SbxClassType GetClass() const;
+ virtual void Clear();
+
+ virtual BOOL IsClass( const String& ) const;
+ const String& GetClassName() const { return aClassName; }
+ void SetClassName( const String &rNew ) { aClassName = rNew; }
+ // Default-Property
+ SbxProperty* GetDfltProperty();
+ void SetDfltProperty( const String& r );
+ void SetDfltProperty( SbxProperty* );
+ // Search for an element
+ virtual SbxVariable* FindUserData( UINT32 nUserData );
+ virtual SbxVariable* Find( const String&, SbxClassType );
+ SbxVariable* FindQualified( const String&, SbxClassType );
+ // Quick-Call-Interface for Methods
+ virtual BOOL Call( const String&, SbxArray* = NULL );
+ // Execution of DDE-Commands
+ SbxVariable* Execute( const String& );
+ // Manage elements
+ virtual BOOL GetAll( SbxClassType ) { return TRUE; }
+ SbxVariable* Make( const String&, SbxClassType, SbxDataType );
+ virtual SbxObject* MakeObject( const String&, const String& );
+ virtual void Insert( SbxVariable* );
+ // AB 23.4.1997, Optimization, Insertion without check for duplicate Entries and
+ // without Broadcasts, only used in SO2/auto.cxx
+ void QuickInsert( SbxVariable* );
+ // AB 23.3.1997, Special-Method, allow corresponding controls
+ void VCPtrInsert( SbxVariable* );
+ virtual void Remove( const String&, SbxClassType );
+ virtual void Remove( SbxVariable* );
+ // AB 23.3.1997, deletion per pointer for controls (duplicate names!)
+ void VCPtrRemove( SbxVariable* );
+ void SetPos( SbxVariable*, USHORT );
+
+ // Macro-Recording
+ virtual String GenerateSource( const String &rLinePrefix,
+ const SbxObject *pRelativeTo );
+ // Direct access on arrays
+ SbxArray* GetMethods() { return pMethods; }
+ SbxArray* GetProperties() { return pProps; }
+ SbxArray* GetObjects() { return pObjs; }
+ // Hooks
+ virtual SvDispatch* GetSvDispatch();
+ // Debugging
+ void Dump( SvStream&, BOOL bDumpAll=FALSE );
+
+ static void GarbageCollection( ULONG nObjects = 0 /* ::= all */ );
+};
+
+#ifndef __SBX_SBXOBJECTREF_HXX
+
+#ifndef SBX_OBJECT_DECL_DEFINED
+#define SBX_OBJECT_DECL_DEFINED
+SV_DECL_REF(SbxObject)
+#endif
+SV_IMPL_REF(SbxObject)
+
+#endif /* __SBX_SBXOBJECTREF_HXX */
+#endif /* _SBX_SBXOBJECT_HXX */
diff --git a/basic/inc/basic/sbxprop.hxx b/basic/inc/basic/sbxprop.hxx
new file mode 100644
index 000000000000..c8142849cacf
--- /dev/null
+++ b/basic/inc/basic/sbxprop.hxx
@@ -0,0 +1,64 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sbxprop.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef __SBX_SBXPROPERTY_HXX
+#define __SBX_SBXPROPERTY_HXX
+
+#include <basic/sbxvar.hxx>
+
+class SbxPropertyImpl;
+
+class SbxProperty : public SbxVariable
+{
+ SbxPropertyImpl* mpSbxPropertyImpl; // Impl data
+
+public:
+ SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_PROPERTY,1);
+ TYPEINFO();
+ SbxProperty( const String& r, SbxDataType t )
+ : SbxVariable( t ) { SetName( r ); }
+ SbxProperty( const SbxProperty& r ) : SvRefBase( r ), SbxVariable( r ) {}
+ SbxProperty& operator=( const SbxProperty& r )
+ { SbxVariable::operator=( r ); return *this; }
+ virtual SbxClassType GetClass() const;
+};
+
+#ifndef __SBX_SBXPROPERTYREF_HXX
+#define __SBX_SBXPROPERTYREF_HXX
+
+#ifndef SBX_PROPERTY_DECL_DEFINED
+#define SBX_PROPERTY_DECL_DEFINED
+SV_DECL_REF(SbxProperty)
+#endif
+SV_IMPL_REF(SbxProperty)
+
+#endif
+
+#endif
diff --git a/basic/inc/basic/sbxvar.hxx b/basic/inc/basic/sbxvar.hxx
new file mode 100644
index 000000000000..4ae2f244c4b9
--- /dev/null
+++ b/basic/inc/basic/sbxvar.hxx
@@ -0,0 +1,508 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sbxvar.hxx,v $
+ * $Revision: 1.5 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SBXVAR_HXX
+#define _SBXVAR_HXX
+
+#include <rtl/ustring.hxx>
+#include <tools/string.hxx>
+#include <com/sun/star/bridge/oleautomation/Decimal.hpp>
+#include <basic/sbxcore.hxx>
+
+#ifndef __SBX_64
+#define __SBX_64
+
+struct SbxINT64
+{
+ INT32 nHigh; UINT32 nLow;
+
+#if FALSE
+ SbxINT64() : nHigh( 0 ), nLow( 0 ) {}
+ SbxINT64( UINT8 n ) : nHigh( 0 ), nLow( n ) {}
+ SbxINT64( UINT16 n ) : nHigh( 0 ), nLow( n ) {}
+ SbxINT64( UINT32 n ) : nHigh( 0 ), nLow( n ) {}
+ SbxINT64( unsigned int n ) : nHigh( 0 ), nLow( n ) {}
+ SbxINT64( INT8 n ) : nHigh( n < 0 ? -1 : 0 ), nLow( n ) {}
+ SbxINT64( INT16 n ) : nHigh( n < 0 ? -1 : 0 ), nLow( n ) {}
+ SbxINT64( INT32 n ) : nHigh( n < 0 ? -1 : 0 ), nLow( n ) {}
+ SbxINT64( int n ) : nHigh( n < 0 ? -1 : 0 ), nLow( n ) {}
+ SbxINT64( SbxINT64 &r ) : nHigh( r.nHigh ), nLow( r.nLow ) {}
+
+ SbxINT64( BigInt &r );
+ SbxINT64( double n );
+#endif
+ void CHS()
+ {
+ nLow ^= (UINT32)-1;
+ nHigh ^= -1;
+ nLow++;
+ if( !nLow )
+ nHigh++;
+ }
+
+ // blc/os2i do not like operator =
+ void Set(double n)
+ {
+ if( n >= 0 )
+ {
+ nHigh = (INT32)(n / (double)4294967296.0);
+ nLow = (UINT32)(n - ((double)nHigh * (double)4294967296.0) + 0.5);
+ }
+ else {
+ nHigh = (INT32)(-n / (double)4294967296.0);
+ nLow = (UINT32)(-n - ((double)nHigh * (double)4294967296.0) + 0.5);
+ CHS();
+ }
+ }
+ void Set(INT32 n) { nHigh = n < 0 ? -1 : 0; nLow = n; }
+
+ void SetMax() { nHigh = 0x7FFFFFFF; nLow = 0xFFFFFFFF; }
+ void SetMin() { nHigh = 0x80000000; nLow = 0x00000000; }
+ void SetNull() { nHigh = 0x00000000; nLow = 0x00000000; }
+
+ int operator ! () const { return !nHigh && !nLow; }
+
+ SbxINT64 &operator -= ( const SbxINT64 &r );
+ SbxINT64 &operator += ( const SbxINT64 &r );
+ SbxINT64 &operator /= ( const SbxINT64 &r );
+ SbxINT64 &operator %= ( const SbxINT64 &r );
+ SbxINT64 &operator *= ( const SbxINT64 &r );
+ SbxINT64 &operator &= ( const SbxINT64 &r );
+ SbxINT64 &operator |= ( const SbxINT64 &r );
+ SbxINT64 &operator ^= ( const SbxINT64 &r );
+
+ friend SbxINT64 operator - ( const SbxINT64 &l, const SbxINT64 &r );
+ friend SbxINT64 operator + ( const SbxINT64 &l, const SbxINT64 &r );
+ friend SbxINT64 operator / ( const SbxINT64 &l, const SbxINT64 &r );
+ friend SbxINT64 operator % ( const SbxINT64 &l, const SbxINT64 &r );
+ friend SbxINT64 operator * ( const SbxINT64 &l, const SbxINT64 &r );
+ friend SbxINT64 operator & ( const SbxINT64 &l, const SbxINT64 &r );
+ friend SbxINT64 operator | ( const SbxINT64 &l, const SbxINT64 &r );
+ friend SbxINT64 operator ^ ( const SbxINT64 &l, const SbxINT64 &r );
+
+ friend SbxINT64 operator - ( const SbxINT64 &r );
+ friend SbxINT64 operator ~ ( const SbxINT64 &r );
+
+ static double GetMin() { return ((double)0x7FFFFFFF*(double)4294967296.0
+ + (double)0xFFFFFFFF)
+ / CURRENCY_FACTOR; }
+ static double GetMax() { return ((double)0x80000000*(double)4294967296.0
+ + (double)0xFFFFFFFF)
+ / CURRENCY_FACTOR; }
+};
+
+struct SbxUINT64
+{
+ UINT32 nHigh; UINT32 nLow;
+ void Set(double n)
+ {
+ nHigh = (UINT32)(n / (double)4294967296.0);
+ nLow = (UINT32)(n - ((double)nHigh * (double)4294967296.0));
+ }
+
+ void Set(UINT32 n) { nHigh = 0; nLow = n; }
+
+ void SetMax() { nHigh = 0xFFFFFFFF; nLow = 0xFFFFFFFF; }
+ void SetMin() { nHigh = 0x00000000; nLow = 0x00000000; }
+ void SetNull() { nHigh = 0x00000000; nLow = 0x00000000; }
+
+ int operator ! () const { return !nHigh && !nLow; }
+
+ SbxUINT64 &operator -= ( const SbxUINT64 &r );
+ SbxUINT64 &operator += ( const SbxUINT64 &r );
+ SbxUINT64 &operator /= ( const SbxUINT64 &r );
+ SbxUINT64 &operator %= ( const SbxUINT64 &r );
+ SbxUINT64 &operator *= ( const SbxUINT64 &r );
+ SbxUINT64 &operator &= ( const SbxUINT64 &r );
+ SbxUINT64 &operator |= ( const SbxUINT64 &r );
+ SbxUINT64 &operator ^= ( const SbxUINT64 &r );
+
+ friend SbxUINT64 operator - ( const SbxUINT64 &l, const SbxUINT64 &r );
+ friend SbxUINT64 operator + ( const SbxUINT64 &l, const SbxUINT64 &r );
+ friend SbxUINT64 operator / ( const SbxUINT64 &l, const SbxUINT64 &r );
+ friend SbxUINT64 operator % ( const SbxUINT64 &l, const SbxUINT64 &r );
+ friend SbxUINT64 operator * ( const SbxUINT64 &l, const SbxUINT64 &r );
+ friend SbxUINT64 operator & ( const SbxUINT64 &l, const SbxUINT64 &r );
+ friend SbxUINT64 operator | ( const SbxUINT64 &l, const SbxUINT64 &r );
+ friend SbxUINT64 operator ^ ( const SbxUINT64 &l, const SbxUINT64 &r );
+
+ friend SbxUINT64 operator ~ ( const SbxUINT64 &r );
+};
+
+#endif
+
+#ifndef __SBX_SBXVALUES_HXX
+#define __SBX_SBXVALUES_HXX
+
+class BigInt;
+class SbxDecimal;
+
+struct SbxValues
+{
+ union {
+ sal_Unicode nChar;
+ BYTE nByte;
+ INT16 nInteger;
+ INT32 nLong;
+ UINT16 nUShort;
+ UINT32 nULong;
+ float nSingle;
+ double nDouble;
+ SbxINT64 nLong64;
+ SbxUINT64 nULong64;
+ sal_Int64 nInt64;
+ sal_uInt64 uInt64;
+ int nInt;
+ unsigned int nUInt;
+ String* pString;
+ SbxDecimal* pDecimal;
+
+ SbxBase* pObj;
+ sal_Unicode* pChar;
+ BYTE* pByte;
+ INT16* pInteger;
+ INT32* pLong;
+ UINT16* pUShort;
+ UINT32* pULong;
+ float* pSingle;
+ double* pDouble;
+ SbxINT64* pLong64;
+ SbxUINT64* pULong64;
+ sal_Int64* pnInt64;
+ sal_uInt64* puInt64;
+ int* pInt;
+ unsigned int* pUInt;
+ void* pData;
+ };
+ SbxDataType eType;
+
+ SbxValues(): pData( NULL ), eType(SbxEMPTY) {}
+ SbxValues( SbxDataType e ): eType(e) {}
+ SbxValues( char _nChar ): nChar( _nChar ), eType(SbxCHAR) {}
+ SbxValues( BYTE _nByte ): nByte( _nByte ), eType(SbxBYTE) {}
+ SbxValues( short _nInteger ): nInteger( _nInteger ), eType(SbxINTEGER ) {}
+ SbxValues( long _nLong ): nLong( _nLong ), eType(SbxLONG) {}
+ SbxValues( USHORT _nUShort ): nUShort( _nUShort ), eType(SbxUSHORT) {}
+ SbxValues( ULONG _nULong ): nULong( _nULong ), eType(SbxULONG) {}
+ SbxValues( float _nSingle ): nSingle( _nSingle ), eType(SbxSINGLE) {}
+ SbxValues( double _nDouble ): nDouble( _nDouble ), eType(SbxDOUBLE) {}
+ SbxValues( int _nInt ): nInt( _nInt ), eType(SbxINT) {}
+ SbxValues( unsigned int _nUInt ): nUInt( _nUInt ), eType(SbxUINT) {}
+ SbxValues( const String* _pString ): pString( (String*) _pString ), eType(SbxSTRING) {}
+ SbxValues( SbxBase* _pObj ): pObj( _pObj ), eType(SbxOBJECT) {}
+ SbxValues( sal_Unicode* _pChar ): pChar( _pChar ), eType(SbxLPSTR) {}
+ SbxValues( void* _pData ): pData( _pData ), eType(SbxPOINTER) {}
+ SbxValues( const BigInt &rBig );
+};
+
+#endif
+
+#ifndef __SBX_SBXVALUE
+#define __SBX_SBXVALUE
+
+struct SbxValues;
+
+class SbxValueImpl;
+
+class SbxValue : public SbxBase
+{
+ friend class SbiDllMgr; // BASIC-Runtime must access aData
+
+ SbxValueImpl* mpSbxValueImplImpl; // Impl data
+
+ // #55226 Transport additional infos
+ SbxValue* TheRealValue( BOOL bObjInObjError ) const;
+ SbxValue* TheRealValue() const;
+protected:
+ SbxValues aData; // Data
+ String aPic; // Picture-String
+
+ virtual void Broadcast( ULONG ); // Broadcast-Call
+ virtual ~SbxValue();
+ virtual BOOL LoadData( SvStream&, USHORT );
+ virtual BOOL StoreData( SvStream& ) const;
+public:
+ SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_VALUE,1);
+ TYPEINFO();
+ SbxValue();
+ SbxValue( SbxDataType, void* = NULL );
+ SbxValue( const SbxValue& );
+ SbxValue& operator=( const SbxValue& );
+ virtual void Clear();
+ virtual BOOL IsFixed() const;
+
+ BOOL IsInteger() const { return BOOL( GetType() == SbxINTEGER ); }
+ BOOL IsLong() const { return BOOL( GetType() == SbxLONG ); }
+ BOOL IsSingle() const { return BOOL( GetType() == SbxSINGLE ); }
+ BOOL IsDouble() const { return BOOL( GetType() == SbxDOUBLE ); }
+ BOOL IsString() const { return BOOL( GetType() == SbxSTRING ); }
+ BOOL IsDate() const { return BOOL( GetType() == SbxDATE ); }
+ BOOL IsCurrency()const { return BOOL( GetType() == SbxCURRENCY ); }
+ BOOL IsObject() const { return BOOL( GetType() == SbxOBJECT ); }
+ BOOL IsDataObject()const{return BOOL( GetType() == SbxDATAOBJECT);}
+ BOOL IsBool() const { return BOOL( GetType() == SbxBOOL ); }
+ BOOL IsErr() const { return BOOL( GetType() == SbxERROR ); }
+ BOOL IsEmpty() const { return BOOL( GetType() == SbxEMPTY ); }
+ BOOL IsNull() const { return BOOL( GetType() == SbxNULL ); }
+ BOOL IsChar() const { return BOOL( GetType() == SbxCHAR ); }
+ BOOL IsByte() const { return BOOL( GetType() == SbxBYTE ); }
+ BOOL IsUShort() const { return BOOL( GetType() == SbxUSHORT ); }
+ BOOL IsULong() const { return BOOL( GetType() == SbxULONG ); }
+ BOOL IsInt() const { return BOOL( GetType() == SbxINT ); }
+ BOOL IsUInt() const { return BOOL( GetType() == SbxUINT ); }
+ BOOL IspChar() const { return BOOL( GetType() == SbxLPSTR ); }
+ BOOL IsNumeric() const;
+ BOOL IsNumericRTL() const; // #41692 Interface for Basic
+ BOOL ImpIsNumeric( BOOL bOnlyIntntl ) const; // Implementation
+
+ virtual SbxClassType GetClass() const;
+ virtual SbxDataType GetType() const;
+ SbxDataType GetFullType() const;
+ BOOL SetType( SbxDataType );
+
+ virtual BOOL Get( SbxValues& ) const;
+ BOOL GetNoBroadcast( SbxValues& );
+ const SbxValues& GetValues_Impl() const { return aData; }
+ virtual BOOL Put( const SbxValues& );
+
+ SbxINT64 GetCurrency() const;
+ SbxINT64 GetLong64() const;
+ SbxUINT64 GetULong64() const;
+ sal_Int64 GetInt64() const;
+ sal_uInt64 GetUInt64() const;
+ INT16 GetInteger() const;
+ INT32 GetLong() const;
+ float GetSingle() const;
+ double GetDouble() const;
+ double GetDate() const;
+ BOOL GetBool() const;
+ UINT16 GetErr() const;
+ const String& GetString() const;
+ const String& GetCoreString() const;
+ SbxDecimal* GetDecimal() const;
+ SbxBase* GetObject() const;
+ BOOL HasObject() const;
+ void* GetData() const;
+ sal_Unicode GetChar() const;
+ BYTE GetByte() const;
+ UINT16 GetUShort() const;
+ UINT32 GetULong() const;
+ int GetInt() const;
+
+ BOOL PutCurrency( const SbxINT64& );
+ BOOL PutLong64( const SbxINT64& );
+ BOOL PutULong64( const SbxUINT64& );
+ BOOL PutInt64( sal_Int64 );
+ BOOL PutUInt64( sal_uInt64 );
+ BOOL PutInteger( INT16 );
+ BOOL PutLong( INT32 );
+ BOOL PutSingle( float );
+ BOOL PutDouble( double );
+ BOOL PutDate( double );
+ BOOL PutBool( BOOL );
+ BOOL PutErr( USHORT );
+ BOOL PutStringExt( const String& ); // with extended analysis (International, "TRUE"/"FALSE")
+ BOOL PutString( const String& );
+ BOOL PutString( const sal_Unicode* ); // Type = SbxSTRING
+ BOOL PutpChar( const sal_Unicode* ); // Type = SbxLPSTR
+ BOOL PutDecimal( SbxDecimal* pDecimal );
+ BOOL PutObject( SbxBase* );
+ BOOL PutData( void* );
+ BOOL PutChar( sal_Unicode );
+ BOOL PutByte( BYTE );
+ BOOL PutUShort( UINT16 );
+ BOOL PutULong( UINT32 );
+ BOOL PutInt( int );
+ BOOL PutEmpty();
+ BOOL PutNull();
+
+ // Special decimal methods
+ BOOL PutDecimal( com::sun::star::bridge::oleautomation::Decimal& rAutomationDec );
+ BOOL fillAutomationDecimal( com::sun::star::bridge::oleautomation::Decimal& rAutomationDec );
+
+ virtual BOOL Convert( SbxDataType );
+ virtual BOOL Compute( SbxOperator, const SbxValue& );
+ virtual BOOL Compare( SbxOperator, const SbxValue& ) const;
+ BOOL Scan( const String&, USHORT* = NULL );
+ void Format( String&, const String* = NULL ) const;
+
+ // Interface for CDbl in Basic
+ static SbxError ScanNumIntnl( const String& rSrc, double& nVal, BOOL bSingle=FALSE );
+
+ // The following operators are definied for easier handling.
+ // Error conditions (overflow, conversions) are not
+ // taken into consideration.
+
+ inline int operator ==( const SbxValue& ) const;
+ inline int operator !=( const SbxValue& ) const;
+ inline int operator <( const SbxValue& ) const;
+ inline int operator >( const SbxValue& ) const;
+ inline int operator <=( const SbxValue& ) const;
+ inline int operator >=( const SbxValue& ) const;
+
+ inline SbxValue& operator *=( const SbxValue& );
+ inline SbxValue& operator /=( const SbxValue& );
+ inline SbxValue& operator %=( const SbxValue& );
+ inline SbxValue& operator +=( const SbxValue& );
+ inline SbxValue& operator -=( const SbxValue& );
+ inline SbxValue& operator &=( const SbxValue& );
+ inline SbxValue& operator |=( const SbxValue& );
+ inline SbxValue& operator ^=( const SbxValue& );
+};
+
+inline int SbxValue::operator==( const SbxValue& r ) const
+{ return Compare( SbxEQ, r ); }
+
+inline int SbxValue::operator!=( const SbxValue& r ) const
+{ return Compare( SbxNE, r ); }
+
+inline int SbxValue::operator<( const SbxValue& r ) const
+{ return Compare( SbxLT, r ); }
+
+inline int SbxValue::operator>( const SbxValue& r ) const
+{ return Compare( SbxGT, r ); }
+
+inline int SbxValue::operator<=( const SbxValue& r ) const
+{ return Compare( SbxLE, r ); }
+
+inline int SbxValue::operator>=( const SbxValue& r ) const
+{ return Compare( SbxGE, r ); }
+
+inline SbxValue& SbxValue::operator*=( const SbxValue& r )
+{ Compute( SbxMUL, r ); return *this; }
+
+inline SbxValue& SbxValue::operator/=( const SbxValue& r )
+{ Compute( SbxDIV, r ); return *this; }
+
+inline SbxValue& SbxValue::operator%=( const SbxValue& r )
+{ Compute( SbxMOD, r ); return *this; }
+
+inline SbxValue& SbxValue::operator+=( const SbxValue& r )
+{ Compute( SbxPLUS, r ); return *this; }
+
+inline SbxValue& SbxValue::operator-=( const SbxValue& r )
+{ Compute( SbxMINUS, r ); return *this; }
+
+inline SbxValue& SbxValue::operator&=( const SbxValue& r )
+{ Compute( SbxAND, r ); return *this; }
+
+inline SbxValue& SbxValue::operator|=( const SbxValue& r )
+{ Compute( SbxOR, r ); return *this; }
+
+inline SbxValue& SbxValue::operator^=( const SbxValue& r )
+{ Compute( SbxXOR, r ); return *this; }
+
+#endif
+
+#ifndef __SBX_SBXVARIABLE_HXX
+#define __SBX_SBXVARIABLE_HXX
+
+class SbxArray;
+class SbxInfo;
+
+#ifndef SBX_ARRAY_DECL_DEFINED
+#define SBX_ARRAY_DECL_DEFINED
+SV_DECL_REF(SbxArray)
+#endif
+
+#ifndef SBX_INFO_DECL_DEFINED
+#define SBX_INFO_DECL_DEFINED
+SV_DECL_REF(SbxInfo)
+#endif
+
+class SfxBroadcaster;
+
+class SbxVariableImpl;
+
+class SbxVariable : public SbxValue
+{
+ friend class SbMethod;
+
+ SbxVariableImpl* mpSbxVariableImpl; // Impl data
+ SfxBroadcaster* pCst; // Broadcaster, if needed
+ String maName; // Name, if available
+ SbxArrayRef mpPar; // Parameter-Array, if set
+ USHORT nHash; // Hash-ID for search
+protected:
+ SbxInfoRef pInfo; // Probably called information
+ sal_uIntPtr nUserData; // User data for Call()
+ SbxObject* pParent; // Currently attached object
+ virtual ~SbxVariable();
+ virtual BOOL LoadData( SvStream&, USHORT );
+ virtual BOOL StoreData( SvStream& ) const;
+public:
+ SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_VARIABLE,2);
+ TYPEINFO();
+ SbxVariable();
+ SbxVariable( SbxDataType, void* = NULL );
+ SbxVariable( const SbxVariable& );
+ SbxVariable& operator=( const SbxVariable& );
+
+ void Dump( SvStream&, BOOL bDumpAll=FALSE );
+
+ virtual void SetName( const String& );
+ virtual const String& GetName( SbxNameType = SbxNAME_NONE ) const;
+ USHORT GetHashCode() const { return nHash; }
+
+ virtual void SetModified( BOOL );
+
+ sal_uIntPtr GetUserData() const { return nUserData; }
+ void SetUserData( sal_uIntPtr n ) { nUserData = n; }
+
+ virtual SbxDataType GetType() const;
+ virtual SbxClassType GetClass() const;
+
+ // Parameter-Interface
+ virtual SbxInfo* GetInfo();
+ void SetInfo( SbxInfo* p );
+ void SetParameters( SbxArray* p );
+ SbxArray* GetParameters() const { return mpPar; }
+
+ // Sfx-Broadcasting-Support:
+ // Due to data reduction and better DLL-hierarchie currently via casting
+ SfxBroadcaster& GetBroadcaster();
+ BOOL IsBroadcaster() const { return BOOL( pCst != NULL ); }
+ virtual void Broadcast( ULONG nHintId );
+
+ inline const SbxObject* GetParent() const { return pParent; }
+ inline SbxObject* GetParent() { return pParent; }
+ virtual void SetParent( SbxObject* );
+
+ static USHORT MakeHashCode( const String& rName );
+};
+
+#ifndef SBX_VARIABLE_DECL_DEFINED
+#define SBX_VARIABLE_DECL_DEFINED
+SV_DECL_REF(SbxVariable)
+#endif
+
+#endif
+
+#endif // _SBXVAR_HXX
diff --git a/basic/inc/basic/testtool.hxx b/basic/inc/basic/testtool.hxx
new file mode 100644
index 000000000000..1cdb42fd042c
--- /dev/null
+++ b/basic/inc/basic/testtool.hxx
@@ -0,0 +1,163 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: testtool.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _BASIC_TESTTOOL_HXX_
+#define _BASIC_TESTTOOL_HXX_
+
+#include <svtools/smplhint.hxx>
+#include <tools/string.hxx>
+
+#define TESTTOOL_DEFAULT_PORT 12479
+#define UNO_DEFAULT_PORT 12480
+#define DEFAULT_HOST "localhost"
+
+#define TT_SIGNATURE_FOR_UNICODE_TEXTFILES "'encoding UTF-8 Do not remove or change this line!"
+
+#define ASSERTION_STACK_PREFIX "Backtrace:"
+
+// #94145# Due to a tab in TT_SIGNATURE_FOR_UNICODE_TEXTFILES which is changed to blanks by some editors
+// this routine became necessary
+BOOL IsTTSignatureForUnicodeTextfile( String aLine );
+
+//#include "testapp.hxx"
+#define ADD_ERROR_QUIET(nNr, aStr) \
+{ \
+ ErrorEntry *pErr; \
+ if ( BasicRuntimeAccess::HasRuntime() ) \
+ { \
+ BasicRuntime aRun = BasicRuntimeAccess::GetRuntime(); \
+ xub_StrLen aErrLn = StarBASIC::GetErl(); \
+ if ( 0 == aErrLn ) \
+ aErrLn = aRun.GetLine(); \
+ pErr = new ErrorEntry(nNr, aStr, \
+ aErrLn, aRun.GetCol1(), aRun.GetCol2()); \
+ } \
+ else \
+ { \
+ pErr = new ErrorEntry(nNr, aStr); \
+ } \
+ P_FEHLERLISTE->C40_INSERT(ErrorEntry, pErr, P_FEHLERLISTE->Count());\
+}
+// ??? Irgendwann noch was mit der UID anfangen !!
+#define ADD_ERROR(nNr, aStr) { \
+ if ( !SbxBase::IsError() ) \
+ SbxBase::SetError( nNr ); \
+ ADD_ERROR_QUIET(nNr, aStr); \
+}
+
+#define POP_ERROR() P_FEHLERLISTE->DeleteAndDestroy(0)
+#define GET_ERROR() P_FEHLERLISTE->GetObject(0)
+#define IS_ERROR() ( P_FEHLERLISTE->Count() > 0 )
+
+// Transmission of error logs
+enum TTLogType { LOG_RUN, LOG_TEST_CASE, LOG_ERROR, LOG_CALL_STACK, LOG_MESSAGE, LOG_WARNING, LOG_ASSERTION, LOG_QA_ERROR, LOG_ASSERTION_STACK };
+
+struct TTDebugData
+{
+public:
+ TTLogType aLogType;
+ String aMsg;
+ String aFilename;
+ xub_StrLen nLine;
+ xub_StrLen nCol1;
+ xub_StrLen nCol2;
+};
+
+struct TTLogMsg
+{
+public:
+ String aLogFileName;
+ TTDebugData aDebugData;
+};
+
+// For transmission of window information from the Testapp
+struct WinInfoRec
+{
+public:
+ String aUId;
+ String aKurzname;
+ String aSlotname;
+ String aLangname;
+ USHORT nRType;
+ String aRName;
+ BOOL bIsReset;
+};
+
+// Defines for syntax Highlighting
+#define TT_KEYWORD ((SbTextType)100) // Including locally executed commands like 'use' ...
+#define TT_REMOTECMD ((SbTextType)101) // Remotely executed commands like 'nodebug'
+#define TT_LOCALCMD ((SbTextType)102) // Locally executed commands like 'use'
+#define TT_CONTROL ((SbTextType)103) // Possibly available control loaded by 'use'
+#define TT_SLOT ((SbTextType)104) // Available Slots loaded by 'use'
+#define TT_METHOD ((SbTextType)105) // Possibly allowed Method for controls
+#define TT_NOMETHOD ((SbTextType)106) // No Possibly allowed Method for controls
+
+#define FILELIST1 ((SbTextType)111) // Symbols in file 1
+#define FILELIST2 ((SbTextType)112) // Symbols in file 2
+#define FILELIST3 ((SbTextType)113) // Symbols in file 3
+#define FILELIST4 ((SbTextType)114) // Symbols in file 4
+
+/// defines for hints from TestToolObj to the Application
+#define SBX_HINT_LANGUAGE_EXTENSION_LOADED SFX_HINT_USER06
+#define SBX_HINT_EXECUTION_STATUS_INFORMATION SFX_HINT_USER07
+
+#define TT_EXECUTION_ENTERWAIT 0x01
+#define TT_EXECUTION_LEAVEWAIT 0x02
+#define TT_EXECUTION_SHOW_ACTION 0x03
+#define TT_EXECUTION_HIDE_ACTION 0x04
+
+class TTExecutionStatusHint : public SfxSimpleHint
+{
+private:
+ USHORT mnType;
+ String maExecutionStatus;
+ String maAdditionalExecutionStatus;
+
+public:
+ TYPEINFO();
+ TTExecutionStatusHint( USHORT nType, sal_Char *pExecutionStatus, const sal_Char *pAdditionalExecutionStatus = "" )
+ : SfxSimpleHint(SBX_HINT_EXECUTION_STATUS_INFORMATION)
+ , mnType( nType )
+ , maExecutionStatus( pExecutionStatus, RTL_TEXTENCODING_ASCII_US )
+ , maAdditionalExecutionStatus( pAdditionalExecutionStatus, RTL_TEXTENCODING_ASCII_US )
+ {;}
+
+ TTExecutionStatusHint( USHORT nType, const String &aExecutionStatus = String(), const String &aAdditionalExecutionStatus = String() )
+ : SfxSimpleHint(SBX_HINT_EXECUTION_STATUS_INFORMATION)
+ , mnType( nType )
+ , maExecutionStatus( aExecutionStatus )
+ , maAdditionalExecutionStatus( aAdditionalExecutionStatus )
+ {;}
+
+ const String& GetExecutionStatus() const { return maExecutionStatus; }
+ const String& GetAdditionalExecutionStatus() const { return maAdditionalExecutionStatus; }
+ USHORT GetType(){ return mnType; }
+};
+
+#endif // _BASIC_TESTTOOL_HXX_
diff --git a/basic/inc/basic/ttglobal.hrc b/basic/inc/basic/ttglobal.hrc
new file mode 100644
index 000000000000..8ebcd8bcf8a9
--- /dev/null
+++ b/basic/inc/basic/ttglobal.hrc
@@ -0,0 +1,52 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ttglobal.hrc,v $
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _TTGLOBAL_HXX
+#define _TTGLOBAL_HXX
+
+///////////////////////////////
+// Error message that go to the Resultfile.
+// *********************
+// *** !!ATTENTION!! ***
+// *********************
+// Theses numbers MUST NOT change ever!
+// Because they are stored in the Resultfiles and if you showed them again
+// the appropriate new or no Strings are viewed.
+///////////////////////////////
+
+// Start of Ressources for the Testtool (own file)
+// > 256 and > 9100 (Biggest res in TT itself)
+#define TT_START 20000 // Messages from /basic/source/testtool
+#define BAS_START 21000 // Messages from /basic/source/app
+#define SVT_START 22000 // Messages from /svtools/source/plugapp
+
+
+#endif
+
diff --git a/basic/inc/basic/ttstrhlp.hxx b/basic/inc/basic/ttstrhlp.hxx
new file mode 100644
index 000000000000..dd26ad5c3400
--- /dev/null
+++ b/basic/inc/basic/ttstrhlp.hxx
@@ -0,0 +1,77 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ttstrhlp.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _BASIC_TTSTRHLP_HXX
+#define _BASIC_TTSTRHLP_HXX
+
+#include <tools/string.hxx>
+
+#define CByteString( constAsciiStr ) ByteString( RTL_CONSTASCII_STRINGPARAM ( constAsciiStr ) )
+#define CUniString( constAsciiStr ) UniString( RTL_CONSTASCII_USTRINGPARAM ( constAsciiStr ) )
+
+#define StartKenn CUniString("%")
+#define EndKenn CUniString("%")
+#define UIdKenn ( StartKenn.AppendAscii("UId") )
+#define MethodKenn ( StartKenn.AppendAscii("Method") )
+#define TypeKenn ( StartKenn.AppendAscii("RType") )
+#define SlotKenn ( StartKenn.AppendAscii("SlotId") )
+#define RcKenn ( StartKenn.AppendAscii("RCommand") )
+#define TabKenn ( StartKenn.AppendAscii("Tab") )
+#define MakeStringParam(Type,aText) ( Type.AppendAscii("=").Append( aText ).Append( EndKenn ) )
+#define MakeStringNumber(Type,nNumber) MakeStringParam (Type, UniString::CreateFromInt32(nNumber))
+#define UIdString(aID) MakeStringParam(UIdKenn,aID.GetText())
+#define MethodString(nNumber) MakeStringNumber(MethodKenn,nNumber)
+#define TypeString(nNumber) MakeStringNumber(TypeKenn,nNumber)
+#define SlotString(nNumber) MakeStringNumber(SlotKenn,nNumber)
+#define RcString(nNumber) MakeStringNumber(RcKenn,nNumber)
+#define TabString(nNumber) MakeStringNumber(TabKenn,nNumber)
+
+#define ResKenn ( StartKenn.AppendAscii("ResId") )
+#define BaseArgKenn ( StartKenn.AppendAscii("Arg") )
+#define ArgKenn(nNumber) ( BaseArgKenn.Append( UniString::CreateFromInt32(nNumber) ) )
+#define ResString(nNumber) MakeStringNumber(ResKenn,nNumber)
+#define ArgString(nNumber, aText) MakeStringParam(ArgKenn(nNumber),aText)
+
+UniString GEN_RES_STR0( ULONG nResId );
+UniString GEN_RES_STR1( ULONG nResId, const String &Text1 );
+UniString GEN_RES_STR2( ULONG nResId, const String &Text1, const String &Text2 );
+UniString GEN_RES_STR3( ULONG nResId, const String &Text1, const String &Text2, const String &Text3 );
+
+#define GEN_RES_STR1c( nResId, Text1 ) GEN_RES_STR1( nResId, CUniString(Text1) )
+#define GEN_RES_STR2c2( nResId, Text1, Text2 ) GEN_RES_STR2( nResId, Text1, CUniString(Text2) )
+#define GEN_RES_STR3c3( nResId, Text1, Text2, Text3 ) GEN_RES_STR3( nResId, Text1, Text2, CUniString(Text3) )
+
+#define IMPL_GEN_RES_STR \
+UniString GEN_RES_STR0( ULONG nResId ) { return ResString( nResId ); } \
+UniString GEN_RES_STR1( ULONG nResId, const UniString &Text1 ) { return GEN_RES_STR0( nResId ).Append( ArgString( 1, Text1 ) ); } \
+UniString GEN_RES_STR2( ULONG nResId, const UniString &Text1, const UniString &Text2 ) { return GEN_RES_STR1( nResId, Text1 ).Append( ArgString( 2, Text2 ) ); } \
+UniString GEN_RES_STR3( ULONG nResId, const UniString &Text1, const UniString &Text2, const UniString &Text3 ) { return GEN_RES_STR2( nResId, Text1, Text2 ).Append( ArgString( 3, Text3 ) );}
+
+#endif
+