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