1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 
25 #ifndef _FRAMEWORK_SCRIPT_STORAGEBRIDGE_HXX_
26 #define _FRAMEWORK_SCRIPT_STORAGEBRIDGE_HXX_
27 
28 #include <cppuhelper/implbase1.hxx>
29 #include <com/sun/star/uno/XComponentContext.hpp>
30 
31 #include <drafts/com/sun/star/script/framework/storage/XScriptInfoAccess.hpp>
32 #include "StorageBridgeFactory.hxx"
33 
34 namespace scripting_runtimemgr
35 {
36 // for simplification
37 #define css ::com::sun::star
38 #define dcsssf ::drafts::com::sun::star::script::framework
39 
40 class StorageBridge : public ::cppu::WeakImplHelper1< dcsssf::storage::XScriptInfoAccess >
41 {
42     friend class StorageBridgeFactory;
43 public:
44     //XScriptInfoAccess
45     //=========================================================================
46     /**
47      * Get the implementations for a given URI
48      *
49      * @param queryURI
50      *      The URI to get the implementations for
51      *
52      * @return XScriptURI
53      *      The URIs of the implementations
54      */
55     virtual css::uno::Sequence< css::uno::Reference< dcsssf::storage::XScriptInfo > >
56         SAL_CALL getImplementations(
57             const ::rtl::OUString& queryURI )
58         throw ( css::lang::IllegalArgumentException,
59             css::uno::RuntimeException );
60     //=========================================================================
61     /**
62      * Get the all logical names stored in this storage
63      *
64      * @return sequence < ::rtl::OUString >
65      *      The logical names
66      */
67     virtual css::uno::Sequence< ::rtl::OUString >
68         SAL_CALL getScriptLogicalNames()
69         throw ( css::lang::IllegalArgumentException, css::uno::RuntimeException );
70 private:
71     StorageBridge( const css::uno::Reference< css::uno::XComponentContext >& xContext,
72         sal_Int32 sid );
73 
74     void initStorage() throw ( css::uno::RuntimeException );
75     css::uno::Reference< css::uno::XComponentContext > m_xContext;
76     css::uno::Reference< dcsssf::storage::XScriptInfoAccess > m_xScriptInfoAccess;
77     sal_Int32 m_sid;
78 };
79 }
80 
81 #endif //_COM_SUN_STAR_SCRIPTING_STORAGEBRIDGE_HXX_
82