xref: /trunk/main/basctl/source/inc/basobj.hxx (revision 9c15e1abd703a7953928d7a80655ae1a76a41f6d)
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 
82     /** renames a module
83 
84         Will show an error message when renaming fails because the new name is already used.
85     */
86     bool                 RenameModule(
87         Window* pErrorParent, const ScriptDocument& rDocument,
88         const String& rLibName, const String& rOldName, const String& rNewName );
89 
90     // new methods for macros
91 
92     ::rtl::OUString     ChooseMacro( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxLimitToDocument,
93         sal_Bool bChooseOnly, const ::rtl::OUString& rMacroDesc );
94 
95     ::com::sun::star::uno::Sequence< ::rtl::OUString > GetMethodNames(
96         const ScriptDocument& rDocument, const String& rLibName, const String& rModName );
97 
98     sal_Bool                    HasMethod(
99         const ScriptDocument& rDocument, const String& rLibName, const String& rModName, const String& rMethName );
100 
101     // new methods for dialogs
102 
103     ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStreamProvider > GetDialog(
104         const ScriptDocument& rDocument, const String& rLibName, const String& rDlgName );
105 
106     /** renames a dialog
107 
108         Will show an error message when renaming fails because the new name is already used.
109     */
110     bool                 RenameDialog(
111         Window* pErrorParent, const ScriptDocument& rDocument, const String& rLibName, const String& rOldName, const String& rNewName );
112 
113     bool                 RemoveDialog(
114         const ScriptDocument& rDocument, const String& rLibName, const String& rDlgName );
115 
116     void                MarkDocumentModified( const ScriptDocument& rDocument );
117 }
118 
119 #endif  // _BASOBJ_HXX
120