1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: URIHelper.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _FRAMEWORK_SCRIPT_PROVIDER_XSCRIPTURIHELPER_HXX_
32 #define _FRAMEWORK_SCRIPT_PROVIDER_XSCRIPTURIHELPER_HXX_
34 #include <com/sun/star/script/provider/XScriptURIHelper.hpp>
35 #include <com/sun/star/lang/XServiceInfo.hpp>
36 #include <com/sun/star/lang/XInitialization.hpp>
37 #include <com/sun/star/uno/XComponentContext.hpp>
38 #include <com/sun/star/uno/RuntimeException.hpp>
39 #include <com/sun/star/ucb/XSimpleFileAccess.hpp>
40 #include <com/sun/star/uri/XUriReferenceFactory.hpp>
42 #include <rtl/ustring.hxx>
43 #include <cppuhelper/implbase3.hxx>
45 namespace func_provider
48 #define css ::com::sun::star
50 class ScriptingFrameworkURIHelper
:
51 public ::cppu::WeakImplHelper3
<
52 css::script::provider::XScriptURIHelper
,
53 css::lang::XServiceInfo
,
54 css::lang::XInitialization
>
58 css::uno::Reference
< css::ucb::XSimpleFileAccess
> m_xSimpleFileAccess
;
59 css::uno::Reference
<css::uri::XUriReferenceFactory
> m_xUriReferenceFactory
;
61 ::rtl::OUString m_sLanguage
;
62 ::rtl::OUString m_sLocation
;
63 ::rtl::OUString m_sBaseURI
;
65 ::rtl::OUString SCRIPTS_PART
;
68 ::rtl::OUString
getLanguagePart(const ::rtl::OUString
& rStorageURI
);
69 ::rtl::OUString
getLanguagePath(const ::rtl::OUString
& rLanguagePart
);
73 ScriptingFrameworkURIHelper(
74 const css::uno::Reference
< css::uno::XComponentContext
>& xContext
)
75 throw( css::uno::RuntimeException
);
77 ~ScriptingFrameworkURIHelper();
80 initialize( const css::uno::Sequence
< css::uno::Any
> & args
)
81 throw ( css::uno::Exception
, css::uno::RuntimeException
);
83 virtual ::rtl::OUString SAL_CALL
85 throw ( ::com::sun::star::uno::RuntimeException
);
87 virtual ::rtl::OUString SAL_CALL
88 getScriptURI( const ::rtl::OUString
& rStorageURI
)
89 throw( css::lang::IllegalArgumentException
,
90 css::uno::RuntimeException
);
92 virtual ::rtl::OUString SAL_CALL
93 getStorageURI( const ::rtl::OUString
& rScriptURI
)
94 throw( css::lang::IllegalArgumentException
,
95 css::uno::RuntimeException
);
97 virtual ::rtl::OUString SAL_CALL
98 getImplementationName()
99 throw( css::uno::RuntimeException
);
101 virtual sal_Bool SAL_CALL
102 supportsService( const ::rtl::OUString
& ServiceName
)
103 throw( css::uno::RuntimeException
);
105 virtual css::uno::Sequence
< ::rtl::OUString
> SAL_CALL
106 getSupportedServiceNames()
107 throw( css::uno::RuntimeException
);
110 } // namespace func_provider
111 #endif //_FRAMEWORK_SCRIPT_PROVIDER_XSCRIPTURIHELPER_HXX_