Files
odfstudio/scripting/source/singleprov/scriptfile.hxx
T
Neil Roberts e5900bee28 scripting: Add script provider helpers for files with single macros
Adds a set of helpers to implement a script provider where the script
files are the entire macro. The provider only needs to make a subclass
of the abstract SingleScriptFactory class to provide the filename
extension, language name and a method to convert the contents of a file
to an XScript. The parts about handling file browsing and reading the
file contents are in the shared helper code.

This is based on the script provider from Luno.

Change-Id: Id39f3a07e887898650b0d77ec493011fb5acc858
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203216
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-04-30 10:36:31 +02:00

31 lines
947 B
C++

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#pragma once
#include "scriptbrowser.hxx"
namespace singleprovider
{
class ScriptFile : public ScriptBrowser
{
public:
ScriptFile(const std::shared_ptr<ProviderContext>& pProviderContext, const OUString& sName,
const OUString& sBaseUri);
// XBrowseNode
css::uno::Sequence<css::uno::Reference<css::script::browse::XBrowseNode>>
SAL_CALL getChildNodes() override;
sal_Bool SAL_CALL hasChildNodes() override;
sal_Int16 SAL_CALL getType() override;
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */