1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 #ifndef _BASOBJ_HXX 24 #define _BASOBJ_HXX 25 26 #include "scriptdocument.hxx" 27 #include <tools/string.hxx> 28 #include <svl/lstner.hxx> 29 30 #ifndef _COM_SUN_STAR_IO_XINPUTSTREAMPROVIDER_HXX_ 31 #include <com/sun/star/io/XInputStreamProvider.hpp> 32 #endif 33 #include <com/sun/star/script/XLibraryContainer.hpp> 34 #include <com/sun/star/frame/XModel.hpp> 35 36 class SfxMacro; 37 class SbMethod; 38 class SbModule; 39 class SbxObject; 40 class SbxVariable; 41 class StarBASIC; 42 class BasicManager; 43 class SfxUInt16Item; 44 class SfxBindings; 45 class Window; 46 struct BasicIDE_Impl; 47 48 namespace BasicIDE 49 { 50 void Organize( sal_Int16 tabId ); 51 52 53 // Hilfsmethoden fuer den allg. Gebrauch: 54 SbMethod* CreateMacro( SbModule* pModule, const String& rMacroName ); 55 void RunMethod( SbMethod* pMethod ); 56 57 StarBASIC* FindBasic( const SbxVariable* pVar ); 58 void StopBasic(); 59 long HandleBasicError( StarBASIC* pBasic ); 60 void BasicStopped( sal_Bool* pbAppWindowDisabled = 0, sal_Bool* pbDispatcherLocked = 0, sal_uInt16* pnWaitCount = 0, 61 SfxUInt16Item** ppSWActionCount = 0, SfxUInt16Item** ppSWLockViewCount = 0 ); 62 63 sal_Bool IsValidSbxName( const String& rName ); 64 65 BasicManager* FindBasicManager( StarBASIC* pLib ); 66 67 SfxBindings* GetBindingsPtr(); 68 69 void InvalidateDebuggerSlots(); 70 71 // libraries 72 73 ::com::sun::star::uno::Sequence< ::rtl::OUString > GetMergedLibraryNames( 74 const ::com::sun::star::uno::Reference< ::com::sun::star::script::XLibraryContainer >& xModLibContainer, 75 const ::com::sun::star::uno::Reference< ::com::sun::star::script::XLibraryContainer >& xDlgLibContainer ); 76 77 // new methods for modules 78 79 ::rtl::OUString GetModule( 80 const ScriptDocument& rDocument, const String& rLibName, const String& rModName ) 81 throw( ::com::sun::star::container::NoSuchElementException ); 82 83 /** renames a module 84 85 Will show an error message when renaming fails because the new name is already used. 86 */ 87 bool RenameModule( 88 Window* pErrorParent, const ScriptDocument& rDocument, 89 const String& rLibName, const String& rOldName, const String& rNewName ); 90 91 // new methods for macros 92 93 ::rtl::OUString ChooseMacro( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxLimitToDocument, 94 sal_Bool bChooseOnly, const ::rtl::OUString& rMacroDesc ); 95 96 ::com::sun::star::uno::Sequence< ::rtl::OUString > GetMethodNames( 97 const ScriptDocument& rDocument, const String& rLibName, const String& rModName ) 98 throw( ::com::sun::star::container::NoSuchElementException ); 99 100 sal_Bool HasMethod( 101 const ScriptDocument& rDocument, const String& rLibName, const String& rModName, const String& rMethName ); 102 103 // new methods for dialogs 104 105 ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStreamProvider > GetDialog( 106 const ScriptDocument& rDocument, const String& rLibName, const String& rDlgName ) 107 throw( ::com::sun::star::container::NoSuchElementException ); 108 109 /** renames a dialog 110 111 Will show an error message when renaming fails because the new name is already used. 112 */ 113 bool RenameDialog( 114 Window* pErrorParent, const ScriptDocument& rDocument, const String& rLibName, const String& rOldName, const String& rNewName ) 115 throw( ::com::sun::star::container::ElementExistException, ::com::sun::star::container::NoSuchElementException ); 116 117 bool RemoveDialog( 118 const ScriptDocument& rDocument, const String& rLibName, const String& rDlgName ); 119 120 void MarkDocumentModified( const ScriptDocument& rDocument ); 121 } 122 123 #endif // _BASOBJ_HXX 124