LibreOffice Module scripting (master) 1
URIHelper.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
20#pragma once
21
22#include <com/sun/star/script/provider/XScriptURIHelper.hpp>
23#include <com/sun/star/lang/XServiceInfo.hpp>
24#include <com/sun/star/lang/XInitialization.hpp>
25#include <com/sun/star/uno/XComponentContext.hpp>
26#include <com/sun/star/ucb/XSimpleFileAccess3.hpp>
27#include <com/sun/star/uri/XUriReferenceFactory.hpp>
28
29#include <rtl/ustring.hxx>
31
32namespace func_provider
33{
34
36 public ::cppu::WeakImplHelper<
37 css::script::provider::XScriptURIHelper,
38 css::lang::XServiceInfo,
39 css::lang::XInitialization >
40{
41private:
42
43 css::uno::Reference< css::ucb::XSimpleFileAccess3 > m_xSimpleFileAccess;
44 css::uno::Reference<css::uri::XUriReferenceFactory> m_xUriReferenceFactory;
45
46 OUString m_sLanguage;
47 OUString m_sLocation;
48 OUString m_sBaseURI;
49
50 OUString SCRIPTS_PART;
51
52 bool initBaseURI();
53 OUString getLanguagePart(std::u16string_view rStorageURI);
54 static OUString getLanguagePath(const OUString& rLanguagePart);
55
56public:
59 const css::uno::Reference< css::uno::XComponentContext >& xContext );
60
61 virtual ~ScriptingFrameworkURIHelper() override;
62
63 virtual void SAL_CALL
64 initialize( const css::uno::Sequence < css::uno::Any > & args ) override;
65
66 virtual OUString SAL_CALL
67 getRootStorageURI() override;
68
69 virtual OUString SAL_CALL
70 getScriptURI( const OUString& rStorageURI ) override;
71
72 virtual OUString SAL_CALL
73 getStorageURI( const OUString& rScriptURI ) override;
74
75 virtual OUString SAL_CALL
76 getImplementationName() override;
77
78 virtual sal_Bool SAL_CALL
79 supportsService( const OUString& ServiceName ) override;
80
81 virtual css::uno::Sequence< OUString > SAL_CALL
82 getSupportedServiceNames() override;
83};
84
85} // namespace func_provider
86
87/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual OUString SAL_CALL getStorageURI(const OUString &rScriptURI) override
Definition: URIHelper.cxx:202
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &args) override
Definition: URIHelper.cxx:76
virtual OUString SAL_CALL getRootStorageURI() override
Definition: URIHelper.cxx:222
virtual OUString SAL_CALL getImplementationName() override
Definition: URIHelper.cxx:228
virtual ~ScriptingFrameworkURIHelper() override
Definition: URIHelper.cxx:70
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: URIHelper.cxx:241
css::uno::Reference< css::uri::XUriReferenceFactory > m_xUriReferenceFactory
Definition: URIHelper.hxx:44
virtual OUString SAL_CALL getScriptURI(const OUString &rStorageURI) override
Definition: URIHelper.cxx:190
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: URIHelper.cxx:235
OUString getLanguagePart(std::u16string_view rStorageURI)
Definition: URIHelper.cxx:167
static OUString getLanguagePath(const OUString &rLanguagePart)
Definition: URIHelper.cxx:183
css::uno::Reference< css::ucb::XSimpleFileAccess3 > m_xSimpleFileAccess
Definition: URIHelper.hxx:43
ScriptingFrameworkURIHelper(const css::uno::Reference< css::uno::XComponentContext > &xContext)
Definition: URIHelper.cxx:48
unsigned char sal_Bool