tdf#130857 qt weld: Implement QtInstanceWidget::get_text_height
[LibreOffice.git] / basctl / source / inc / basobj.hxx
blob01ac1cbbb13a1ef3a19d883fa52ce7929924a1cf
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 #pragma once
21 #include <basctl/basctldllpublic.hxx>
22 #include <basctl/scriptdocument.hxx>
23 #include <tools/long.hxx>
25 class SbMethod;
26 class SbModule;
27 class SbxVariable;
28 class StarBASIC;
29 class SfxUInt16Item;
30 class SfxBindings;
31 class SfxDispatcher;
32 namespace weld { class Widget; class Window; }
34 namespace basctl
36 void Organize(weld::Window* pParent, const css::uno::Reference<css::frame::XFrame>& xDocFrame, sal_Int16 tabId);
38 // help methods for the general use:
39 SbMethod* CreateMacro( SbModule* pModule, const OUString& rMacroName );
40 void RunMethod( SbMethod const * pMethod );
42 StarBASIC* FindBasic( const SbxVariable* pVar );
43 void StopBasic();
44 tools::Long HandleBasicError( StarBASIC const * pBasic );
45 void BasicStopped( bool* pbAppWindowDisabled = nullptr, bool* pbDispatcherLocked = nullptr, sal_uInt16* pnWaitCount = nullptr,
46 SfxUInt16Item** ppSWActionCount = nullptr, SfxUInt16Item** ppSWLockViewCount = nullptr );
48 SAL_RET_MAYBENULL BasicManager* FindBasicManager( StarBASIC const * pLib );
50 SAL_RET_MAYBENULL SfxBindings* GetBindingsPtr();
52 void InvalidateDebuggerSlots();
54 // libraries
56 css::uno::Sequence< OUString > GetMergedLibraryNames(
57 const css::uno::Reference< css::script::XLibraryContainer >& xModLibContainer,
58 const css::uno::Reference< css::script::XLibraryContainer >& xDlgLibContainer );
60 /** renames a module
62 Will show an error message when renaming fails because the new name is already used.
64 bool RenameModule(
65 weld::Widget* pErrorParent, const ScriptDocument& rDocument,
66 const OUString& rLibName, const OUString& rOldName, const OUString& rNewName );
68 // new methods for macros
70 OUString ChooseMacro(weld::Window* pParent,
71 const css::uno::Reference< css::frame::XModel >& rxLimitToDocument, const css::uno::Reference< css::frame::XFrame >& xDocFrame,
72 bool bChooseOnly );
73 inline OUString ChooseMacro(weld::Window* pParent, const css::uno::Reference<css::frame::XModel>& rLimitToDocument)
74 { return ChooseMacro(pParent, rLimitToDocument, css::uno::Reference< css::frame::XFrame >(), false/*bChooseOnly*/); }
76 /// @throws css::container::NoSuchElementException
77 /// @throws css::uno::RuntimeException
78 css::uno::Sequence< OUString > GetMethodNames(
79 const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rModName );
81 bool HasMethod(
82 const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rModName, const OUString& rMethName );
84 // new methods for dialogs
86 /** renames a dialog
88 Will show an error message when renaming fails because the new name is already used.
90 @throws css::container::ElementExistException
91 @throws css::container::NoSuchElementException
92 @throws css::uno::RuntimeException
94 bool RenameDialog(weld::Widget* pErrorParent, const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rOldName, const OUString& rNewName);
96 bool RemoveDialog( const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rDlgName );
98 } // namespace basctl
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */