Version 6.1.4.1, tag libreoffice-6.1.4.1
[LibreOffice.git] / basctl / source / inc / basobj.hxx
blob7b84c2f02f27133995318393015fae8482605b3b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_BASCTL_SOURCE_INC_BASOBJ_HXX
20 #define INCLUDED_BASCTL_SOURCE_INC_BASOBJ_HXX
22 #include "scriptdocument.hxx"
24 #include <svl/lstner.hxx>
26 class SbMethod;
27 class SbModule;
28 class SbxVariable;
29 class StarBASIC;
30 class SfxUInt16Item;
31 class SfxBindings;
32 class SfxDispatcher;
33 namespace weld { class Widget; }
35 namespace basctl
37 void Organize( sal_Int16 tabId );
40 // help methods for the general use:
41 SbMethod* CreateMacro( SbModule* pModule, const OUString& rMacroName );
42 void RunMethod( SbMethod const * pMethod );
44 StarBASIC* FindBasic( const SbxVariable* pVar );
45 void StopBasic();
46 long HandleBasicError( StarBASIC const * pBasic );
47 void BasicStopped( bool* pbAppWindowDisabled = nullptr, bool* pbDispatcherLocked = nullptr, sal_uInt16* pnWaitCount = nullptr,
48 SfxUInt16Item** ppSWActionCount = nullptr, SfxUInt16Item** ppSWLockViewCount = nullptr );
50 bool IsValidSbxName( const OUString& rName );
52 BasicManager* FindBasicManager( StarBASIC const * pLib );
54 SfxBindings* GetBindingsPtr();
56 SfxDispatcher* GetDispatcher ();
58 void InvalidateDebuggerSlots();
60 // libraries
62 css::uno::Sequence< OUString > GetMergedLibraryNames(
63 const css::uno::Reference< css::script::XLibraryContainer >& xModLibContainer,
64 const css::uno::Reference< css::script::XLibraryContainer >& xDlgLibContainer );
66 /** renames a module
68 Will show an error message when renaming fails because the new name is already used.
70 bool RenameModule(
71 weld::Widget* pErrorParent, const ScriptDocument& rDocument,
72 const OUString& rLibName, const OUString& rOldName, const OUString& rNewName );
74 // new methods for macros
76 OUString ChooseMacro(
77 const css::uno::Reference< css::frame::XModel >& rxLimitToDocument, const css::uno::Reference< css::frame::XFrame >& xDocFrame,
78 bool bChooseOnly );
79 inline OUString ChooseMacro(
80 const css::uno::Reference< css::frame::XModel >& rxLimitToDocument )
81 { return ChooseMacro(rxLimitToDocument, css::uno::Reference< css::frame::XFrame >(), false/*bChooseOnly*/); }
83 /// @throws css::container::NoSuchElementException
84 /// @throws css::uno::RuntimeException
85 css::uno::Sequence< OUString > GetMethodNames(
86 const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rModName );
88 bool HasMethod(
89 const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rModName, const OUString& rMethName );
91 // new methods for dialogs
93 /** renames a dialog
95 Will show an error message when renaming fails because the new name is already used.
97 @throws css::container::ElementExistException
98 @throws css::container::NoSuchElementException
99 @throws css::uno::RuntimeException
101 bool RenameDialog(weld::Widget* pErrorParent, const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rOldName, const OUString& rNewName);
103 bool RemoveDialog( const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rDlgName );
105 void MarkDocumentModified( const ScriptDocument& rDocument );
107 } // namespace basctl
109 #endif // INCLUDED_BASCTL_SOURCE_INC_BASOBJ_HXX
111 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */