1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #ifndef _BASOBJ_HXX 28 #define _BASOBJ_HXX 29 30 #include "scriptdocument.hxx" 31 #include <tools/string.hxx> 32 #include <svl/lstner.hxx> 33 34 #ifndef _COM_SUN_STAR_IO_XINPUTSTREAMPROVIDER_HXX_ 35 #include <com/sun/star/io/XInputStreamProvider.hpp> 36 #endif 37 #include <com/sun/star/script/XLibraryContainer.hpp> 38 #include <com/sun/star/frame/XModel.hpp> 39 40 class SfxMacro; 41 class SbMethod; 42 class SbModule; 43 class SbxObject; 44 class SbxVariable; 45 class StarBASIC; 46 class BasicManager; 47 class SfxUInt16Item; 48 class SfxBindings; 49 class Window; 50 struct BasicIDE_Impl; 51 52 namespace BasicIDE 53 { 54 void Organize( sal_Int16 tabId ); 55 56 57 // Hilfsmethoden fuer den allg. Gebrauch: 58 SbMethod* CreateMacro( SbModule* pModule, const String& rMacroName ); 59 void RunMethod( SbMethod* pMethod ); 60 61 StarBASIC* FindBasic( const SbxVariable* pVar ); 62 void StopBasic(); 63 long HandleBasicError( StarBASIC* pBasic ); 64 void BasicStopped( sal_Bool* pbAppWindowDisabled = 0, sal_Bool* pbDispatcherLocked = 0, sal_uInt16* pnWaitCount = 0, 65 SfxUInt16Item** ppSWActionCount = 0, SfxUInt16Item** ppSWLockViewCount = 0 ); 66 67 sal_Bool IsValidSbxName( const String& rName ); 68 69 BasicManager* FindBasicManager( StarBASIC* pLib ); 70 71 SfxBindings* GetBindingsPtr(); 72 73 void InvalidateDebuggerSlots(); 74 75 // libraries 76 77 ::com::sun::star::uno::Sequence< ::rtl::OUString > GetMergedLibraryNames( 78 const ::com::sun::star::uno::Reference< ::com::sun::star::script::XLibraryContainer >& xModLibContainer, 79 const ::com::sun::star::uno::Reference< ::com::sun::star::script::XLibraryContainer >& xDlgLibContainer ); 80 81 // new methods for modules 82 83 ::rtl::OUString GetModule( 84 const ScriptDocument& rDocument, const String& rLibName, const String& rModName ) 85 throw( ::com::sun::star::container::NoSuchElementException ); 86 87 /** renames a module 88 89 Will show an error message when renaming fails because the new name is already used. 90 */ 91 bool RenameModule( 92 Window* pErrorParent, const ScriptDocument& rDocument, 93 const String& rLibName, const String& rOldName, const String& rNewName ); 94 95 // new methods for macros 96 97 ::rtl::OUString ChooseMacro( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxLimitToDocument, 98 sal_Bool bChooseOnly, const ::rtl::OUString& rMacroDesc ); 99 100 ::com::sun::star::uno::Sequence< ::rtl::OUString > GetMethodNames( 101 const ScriptDocument& rDocument, const String& rLibName, const String& rModName ) 102 throw( ::com::sun::star::container::NoSuchElementException ); 103 104 sal_Bool HasMethod( 105 const ScriptDocument& rDocument, const String& rLibName, const String& rModName, const String& rMethName ); 106 107 // new methods for dialogs 108 109 ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStreamProvider > GetDialog( 110 const ScriptDocument& rDocument, const String& rLibName, const String& rDlgName ) 111 throw( ::com::sun::star::container::NoSuchElementException ); 112 113 /** renames a dialog 114 115 Will show an error message when renaming fails because the new name is already used. 116 */ 117 bool RenameDialog( 118 Window* pErrorParent, const ScriptDocument& rDocument, const String& rLibName, const String& rOldName, const String& rNewName ) 119 throw( ::com::sun::star::container::ElementExistException, ::com::sun::star::container::NoSuchElementException ); 120 121 bool RemoveDialog( 122 const ScriptDocument& rDocument, const String& rLibName, const String& rDlgName ); 123 124 void MarkDocumentModified( const ScriptDocument& rDocument ); 125 } 126 127 #endif // _BASOBJ_HXX 128