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