LibreOffice Module basctl (master) 1
basobj.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#pragma once
20
21#include "scriptdocument.hxx"
22#include <tools/long.hxx>
23
24class SbMethod;
25class SbModule;
26class SbxVariable;
27class StarBASIC;
28class SfxUInt16Item;
29class SfxBindings;
30class SfxDispatcher;
31namespace weld { class Widget; class Window; }
32
33namespace basctl
34{
35 void Organize(weld::Window* pParent, const css::uno::Reference<css::frame::XFrame>& xDocFrame, sal_Int16 tabId);
36
37 // help methods for the general use:
38 SbMethod* CreateMacro( SbModule* pModule, const OUString& rMacroName );
39 void RunMethod( SbMethod const * pMethod );
40
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 );
46
47 bool IsValidSbxName( std::u16string_view rName );
48
50
52
54
56
57 // libraries
58
59 css::uno::Sequence< OUString > GetMergedLibraryNames(
60 const css::uno::Reference< css::script::XLibraryContainer >& xModLibContainer,
61 const css::uno::Reference< css::script::XLibraryContainer >& xDlgLibContainer );
62
67 bool RenameModule(
68 weld::Widget* pErrorParent, const ScriptDocument& rDocument,
69 const OUString& rLibName, const OUString& rOldName, const OUString& rNewName );
70
71 // new methods for macros
72
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*/); }
78
81 css::uno::Sequence< OUString > GetMethodNames(
82 const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rModName );
83
84 bool HasMethod(
85 const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rModName, const OUString& rMethName );
86
87 // new methods for dialogs
88
97 bool RenameDialog(weld::Widget* pErrorParent, const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rOldName, const OUString& rNewName);
98
99 bool RemoveDialog( const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rDlgName );
100
101 void MarkDocumentModified( const ScriptDocument& rDocument );
102
103} // namespace basctl
104
105/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
encapsulates a document which contains Basic scripts and dialogs
void RunMethod(SbMethod const *pMethod)
Definition: basobj3.cxx:276
SfxBindings * GetBindingsPtr()
Definition: basobj3.cxx:426
tools::Long HandleBasicError(StarBASIC const *pBasic)
Definition: basobj3.cxx:369
void BasicStopped(bool *pbAppWindowDisabled, bool *pbDispatcherLocked, sal_uInt16 *pnWaitCount, SfxUInt16Item **ppSWActionCount, SfxUInt16Item **ppSWLockViewCount)
Definition: basobj3.cxx:300
bool HasMethod(ScriptDocument const &rDocument, OUString const &rLibName, OUString const &rModName, OUString const &rMethName)
Definition: basobj2.cxx:402
bool IsValidSbxName(std::u16string_view rName)
Definition: basobj2.cxx:81
OUString ChooseMacro(weld::Window *pParent, const uno::Reference< frame::XModel > &rxLimitToDocument, const uno::Reference< frame::XFrame > &xDocFrame, bool bChooseOnly)
Definition: basobj2.cxx:228
SbMethod * CreateMacro(SbModule *pModule, const OUString &rMacroName)
Definition: basobj3.cxx:63
void Organize(weld::Window *pParent, const css::uno::Reference< css::frame::XFrame > &xDocFrame, sal_Int16 tabId)
Definition: basobj2.cxx:73
bool RemoveDialog(const ScriptDocument &rDocument, const OUString &rLibName, const OUString &rDlgName)
Definition: basobj3.cxx:203
SfxDispatcher * GetDispatcher()
Definition: basobj3.cxx:454
void MarkDocumentModified(const ScriptDocument &rDocument)
Definition: basobj3.cxx:249
BasicManager * FindBasicManager(StarBASIC const *pLib)
Definition: basobj3.cxx:225
void StopBasic()
Definition: basobj3.cxx:283
StarBASIC * FindBasic(const SbxVariable *pVar)
Definition: basobj3.cxx:217
void InvalidateDebuggerSlots()
Definition: basobj3.cxx:343
bool RenameDialog(weld::Widget *pErrorParent, ScriptDocument const &rDocument, OUString const &rLibName, OUString const &rOldName, OUString const &rNewName)
renames a dialog
Definition: basobj3.cxx:138
bool RenameModule(weld::Widget *pErrorParent, const ScriptDocument &rDocument, const OUString &rLibName, const OUString &rOldName, const OUString &rNewName)
renames a module
Definition: basobj2.cxx:130
Sequence< OUString > GetMethodNames(const ScriptDocument &rDocument, const OUString &rLibName, const OUString &rModName)
Definition: basobj2.cxx:356
Sequence< OUString > GetMergedLibraryNames(const Reference< script::XLibraryContainer > &xModLibContainer, const Reference< script::XLibraryContainer > &xDlgLibContainer)
Definition: basobj2.cxx:98
long Long