android: Update app-specific/MIME type icons
[LibreOffice.git] / basctl / source / inc / basobj.hxx
blob70c603d4548ae473f7c785bf6a6a0761db879b89
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 "scriptdocument.hxx"
22 #include <tools/long.hxx>
24 class SbMethod;
25 class SbModule;
26 class SbxVariable;
27 class StarBASIC;
28 class SfxUInt16Item;
29 class SfxBindings;
30 class SfxDispatcher;
31 namespace weld { class Widget; class Window; }
33 namespace basctl
35 void Organize(weld::Window* pParent, const css::uno::Reference<css::frame::XFrame>& xDocFrame, sal_Int16 tabId);
37 // help methods for the general use:
38 SbMethod* CreateMacro( SbModule* pModule, const OUString& rMacroName );
39 void RunMethod( SbMethod const * pMethod );
41 StarBASIC* FindBasic( const SbxVariable* pVar );
42 void StopBasic();
43 tools::Long HandleBasicError( StarBASIC const * pBasic );
44 void BasicStopped( bool* pbAppWindowDisabled = nullptr, bool* pbDispatcherLocked = nullptr, sal_uInt16* pnWaitCount = nullptr,
45 SfxUInt16Item** ppSWActionCount = nullptr, SfxUInt16Item** ppSWLockViewCount = nullptr );
47 bool IsValidSbxName( std::u16string_view rName );
49 BasicManager* FindBasicManager( StarBASIC const * pLib );
51 SfxBindings* GetBindingsPtr();
53 SfxDispatcher* GetDispatcher ();
55 void InvalidateDebuggerSlots();
57 // libraries
59 css::uno::Sequence< OUString > GetMergedLibraryNames(
60 const css::uno::Reference< css::script::XLibraryContainer >& xModLibContainer,
61 const css::uno::Reference< css::script::XLibraryContainer >& xDlgLibContainer );
63 /** renames a module
65 Will show an error message when renaming fails because the new name is already used.
67 bool RenameModule(
68 weld::Widget* pErrorParent, const ScriptDocument& rDocument,
69 const OUString& rLibName, const OUString& rOldName, const OUString& rNewName );
71 // new methods for macros
73 OUString ChooseMacro(weld::Window* pParent,
74 const css::uno::Reference< css::frame::XModel >& rxLimitToDocument, const css::uno::Reference< css::frame::XFrame >& xDocFrame,
75 bool bChooseOnly );
76 inline OUString ChooseMacro(weld::Window* pParent, const css::uno::Reference<css::frame::XModel>& rLimitToDocument)
77 { return ChooseMacro(pParent, rLimitToDocument, css::uno::Reference< css::frame::XFrame >(), false/*bChooseOnly*/); }
79 /// @throws css::container::NoSuchElementException
80 /// @throws css::uno::RuntimeException
81 css::uno::Sequence< OUString > GetMethodNames(
82 const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rModName );
84 bool HasMethod(
85 const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rModName, const OUString& rMethName );
87 // new methods for dialogs
89 /** renames a dialog
91 Will show an error message when renaming fails because the new name is already used.
93 @throws css::container::ElementExistException
94 @throws css::container::NoSuchElementException
95 @throws css::uno::RuntimeException
97 bool RenameDialog(weld::Widget* pErrorParent, const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rOldName, const OUString& rNewName);
99 bool RemoveDialog( const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rDlgName );
101 void MarkDocumentModified( const ScriptDocument& rDocument );
103 } // namespace basctl
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */