2010-10-27 13:11:31 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-07-06 17:28:37 +01:00
|
|
|
/*
|
|
|
|
* 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/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2005-02-11 15:34:38 +00:00
|
|
|
|
2014-04-18 22:47:44 +02:00
|
|
|
#ifndef INCLUDED_SCRIPTING_SOURCE_PROVIDER_URIHELPER_HXX
|
|
|
|
#define INCLUDED_SCRIPTING_SOURCE_PROVIDER_URIHELPER_HXX
|
2005-02-11 15:34:38 +00:00
|
|
|
|
|
|
|
#include <com/sun/star/script/provider/XScriptURIHelper.hpp>
|
|
|
|
#include <com/sun/star/lang/XServiceInfo.hpp>
|
|
|
|
#include <com/sun/star/lang/XInitialization.hpp>
|
|
|
|
#include <com/sun/star/uno/XComponentContext.hpp>
|
|
|
|
#include <com/sun/star/uno/RuntimeException.hpp>
|
2012-05-29 17:17:28 +02:00
|
|
|
#include <com/sun/star/ucb/SimpleFileAccess.hpp>
|
2005-02-11 15:34:38 +00:00
|
|
|
#include <com/sun/star/uri/XUriReferenceFactory.hpp>
|
|
|
|
|
2006-06-19 09:22:16 +00:00
|
|
|
#include <rtl/ustring.hxx>
|
2015-08-29 07:48:41 +09:00
|
|
|
#include <cppuhelper/implbase.hxx>
|
2005-02-11 15:34:38 +00:00
|
|
|
|
|
|
|
namespace func_provider
|
|
|
|
{
|
|
|
|
|
|
|
|
class ScriptingFrameworkURIHelper :
|
2015-08-29 07:48:41 +09:00
|
|
|
public ::cppu::WeakImplHelper<
|
2005-02-11 15:34:38 +00:00
|
|
|
css::script::provider::XScriptURIHelper,
|
|
|
|
css::lang::XServiceInfo,
|
|
|
|
css::lang::XInitialization >
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
|
2012-11-02 17:46:30 +02:00
|
|
|
css::uno::Reference< css::ucb::XSimpleFileAccess3 > m_xSimpleFileAccess;
|
2005-02-11 15:34:38 +00:00
|
|
|
css::uno::Reference<css::uri::XUriReferenceFactory> m_xUriReferenceFactory;
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString m_sLanguage;
|
|
|
|
OUString m_sLocation;
|
|
|
|
OUString m_sBaseURI;
|
2005-02-11 15:34:38 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString SCRIPTS_PART;
|
2005-02-11 15:34:38 +00:00
|
|
|
|
|
|
|
bool initBaseURI();
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString getLanguagePart(const OUString& rStorageURI);
|
2015-04-10 11:07:36 +02:00
|
|
|
static OUString getLanguagePath(const OUString& rLanguagePart);
|
2005-02-11 15:34:38 +00:00
|
|
|
|
|
|
|
public:
|
2017-01-19 17:52:02 +01:00
|
|
|
/// @throws css::uno::RuntimeException
|
2015-11-02 09:52:33 +00:00
|
|
|
explicit ScriptingFrameworkURIHelper(
|
2017-01-26 12:28:58 +01:00
|
|
|
const css::uno::Reference< css::uno::XComponentContext >& xContext );
|
2005-02-11 15:34:38 +00:00
|
|
|
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~ScriptingFrameworkURIHelper() override;
|
2005-02-11 15:34:38 +00:00
|
|
|
|
|
|
|
virtual void SAL_CALL
|
2017-01-26 12:28:58 +01:00
|
|
|
initialize( const css::uno::Sequence < css::uno::Any > & args ) override;
|
2005-02-11 15:34:38 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
virtual OUString SAL_CALL
|
2017-01-26 12:28:58 +01:00
|
|
|
getRootStorageURI() override;
|
2005-02-11 15:34:38 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
virtual OUString SAL_CALL
|
2017-01-26 12:28:58 +01:00
|
|
|
getScriptURI( const OUString& rStorageURI ) override;
|
2005-02-11 15:34:38 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
virtual OUString SAL_CALL
|
2017-01-26 12:28:58 +01:00
|
|
|
getStorageURI( const OUString& rScriptURI ) override;
|
2005-02-11 15:34:38 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
virtual OUString SAL_CALL
|
2017-01-26 12:28:58 +01:00
|
|
|
getImplementationName() override;
|
2005-02-11 15:34:38 +00:00
|
|
|
|
|
|
|
virtual sal_Bool SAL_CALL
|
2017-01-26 12:28:58 +01:00
|
|
|
supportsService( const OUString& ServiceName ) override;
|
2005-02-11 15:34:38 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
virtual css::uno::Sequence< OUString > SAL_CALL
|
2017-01-26 12:28:58 +01:00
|
|
|
getSupportedServiceNames() override;
|
2005-02-11 15:34:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace func_provider
|
2014-04-18 22:47:44 +02:00
|
|
|
#endif // INCLUDED_SCRIPTING_SOURCE_PROVIDER_URIHELPER_HXX
|
2010-10-27 13:11:31 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|