nss: upgrade to release 3.73
[LibreOffice.git] / scripting / source / provider / URIHelper.hxx
blob7cf91e686b8d32c21e0552ba966af63ade60f887
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 .
20 #ifndef INCLUDED_SCRIPTING_SOURCE_PROVIDER_URIHELPER_HXX
21 #define INCLUDED_SCRIPTING_SOURCE_PROVIDER_URIHELPER_HXX
23 #include <com/sun/star/script/provider/XScriptURIHelper.hpp>
24 #include <com/sun/star/lang/XServiceInfo.hpp>
25 #include <com/sun/star/lang/XInitialization.hpp>
26 #include <com/sun/star/uno/XComponentContext.hpp>
27 #include <com/sun/star/ucb/XSimpleFileAccess3.hpp>
28 #include <com/sun/star/uri/XUriReferenceFactory.hpp>
30 #include <rtl/ustring.hxx>
31 #include <cppuhelper/implbase.hxx>
33 namespace func_provider
36 class ScriptingFrameworkURIHelper :
37 public ::cppu::WeakImplHelper<
38 css::script::provider::XScriptURIHelper,
39 css::lang::XServiceInfo,
40 css::lang::XInitialization >
42 private:
44 css::uno::Reference< css::ucb::XSimpleFileAccess3 > m_xSimpleFileAccess;
45 css::uno::Reference<css::uri::XUriReferenceFactory> m_xUriReferenceFactory;
47 OUString m_sLanguage;
48 OUString m_sLocation;
49 OUString m_sBaseURI;
51 OUString SCRIPTS_PART;
53 bool initBaseURI();
54 OUString getLanguagePart(const OUString& rStorageURI);
55 static OUString getLanguagePath(const OUString& rLanguagePart);
57 public:
58 /// @throws css::uno::RuntimeException
59 explicit ScriptingFrameworkURIHelper(
60 const css::uno::Reference< css::uno::XComponentContext >& xContext );
62 virtual ~ScriptingFrameworkURIHelper() override;
64 virtual void SAL_CALL
65 initialize( const css::uno::Sequence < css::uno::Any > & args ) override;
67 virtual OUString SAL_CALL
68 getRootStorageURI() override;
70 virtual OUString SAL_CALL
71 getScriptURI( const OUString& rStorageURI ) override;
73 virtual OUString SAL_CALL
74 getStorageURI( const OUString& rScriptURI ) override;
76 virtual OUString SAL_CALL
77 getImplementationName() override;
79 virtual sal_Bool SAL_CALL
80 supportsService( const OUString& ServiceName ) override;
82 virtual css::uno::Sequence< OUString > SAL_CALL
83 getSupportedServiceNames() override;
86 } // namespace func_provider
87 #endif // INCLUDED_SCRIPTING_SOURCE_PROVIDER_URIHELPER_HXX
89 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */