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>
35 lines
1.0 KiB
C++
35 lines
1.0 KiB
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 ScriptDir : public ScriptBrowser
|
|
{
|
|
public:
|
|
ScriptDir(const std::shared_ptr<ProviderContext>& pProviderContext);
|
|
ScriptDir(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;
|
|
|
|
private:
|
|
OUString nameFromUrl(const OUString& sUrl);
|
|
};
|
|
}
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
|