merged tag ooo/DEV300_m102
[LibreOffice.git] / basctl / source / inc / basobj.hxx
blobe446ba4b1e999f97ca82a9902b008f9c82b472d6
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
27 #ifndef _BASOBJ_HXX
28 #define _BASOBJ_HXX
30 #include "scriptdocument.hxx"
31 #include <tools/string.hxx>
32 #include <svl/lstner.hxx>
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>
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;
52 namespace BasicIDE
54 void Organize( sal_Int16 tabId );
57 // Hilfsmethoden fuer den allg. Gebrauch:
58 SbMethod* CreateMacro( SbModule* pModule, const String& rMacroName );
59 void RunMethod( SbMethod* pMethod );
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 );
67 sal_Bool IsValidSbxName( const String& rName );
69 BasicManager* FindBasicManager( StarBASIC* pLib );
71 SfxBindings* GetBindingsPtr();
73 void InvalidateDebuggerSlots();
75 // libraries
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 );
81 // new methods for modules
83 ::rtl::OUString GetModule(
84 const ScriptDocument& rDocument, const String& rLibName, const String& rModName )
85 throw( ::com::sun::star::container::NoSuchElementException );
87 /** renames a module
89 Will show an error message when renaming fails because the new name is already used.
91 bool RenameModule(
92 Window* pErrorParent, const ScriptDocument& rDocument,
93 const String& rLibName, const String& rOldName, const String& rNewName );
95 // new methods for macros
97 ::rtl::OUString ChooseMacro( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxLimitToDocument,
98 sal_Bool bChooseOnly, const ::rtl::OUString& rMacroDesc );
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 );
104 sal_Bool HasMethod(
105 const ScriptDocument& rDocument, const String& rLibName, const String& rModName, const String& rMethName );
107 // new methods for dialogs
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 );
113 /** renames a dialog
115 Will show an error message when renaming fails because the new name is already used.
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 );
121 bool RemoveDialog(
122 const ScriptDocument& rDocument, const String& rLibName, const String& rDlgName );
124 void MarkDocumentModified( const ScriptDocument& rDocument );
127 #endif // _BASOBJ_HXX