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 #include <rtl/ustring.hxx>
25 #include <cppuhelper/implbase2.hxx>
26 
27 #include <com/sun/star/uno/XComponentContext.hpp>
28 #include <com/sun/star/lang/XServiceInfo.hpp>
29 #include <com/sun/star/uno/RuntimeException.hpp>
30 #include <com/sun/star/registry/XRegistryKey.hpp>
31 
32 #include <com/sun/star/script/browse/XBrowseNode.hpp>
33 #include <com/sun/star/script/browse/BrowseNodeTypes.hpp>
34 #include <com/sun/star/script/browse/XBrowseNodeFactory.hpp>
35 
36 namespace browsenodefactory
37 {
38 // for simplification
39 #define css ::com::sun::star
40 
41 class BrowseNodeFactoryImpl :
42     public ::cppu::WeakImplHelper2 <
43         css::script::browse::XBrowseNodeFactory,
44         css::lang::XServiceInfo >
45 {
46 private:
47     css::uno::Reference< css::uno::XComponentContext > m_xComponentContext;
48     css::uno::Reference< css::script::browse::XBrowseNode > m_xSelectorBrowseNode;
49 
50 protected:
51     virtual ~BrowseNodeFactoryImpl();
52 
53 public:
54     BrowseNodeFactoryImpl(
55         css::uno::Reference< css::uno::XComponentContext > const & xComponentContext );
56 
57     // XServiceInfo
58     virtual ::rtl::OUString SAL_CALL getImplementationName()
59         throw ( css::uno::RuntimeException );
60 
61     virtual sal_Bool SAL_CALL
62         supportsService( ::rtl::OUString const & serviceName )
63             throw ( css::uno::RuntimeException );
64 
65     virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL
66         getSupportedServiceNames()
67             throw ( css::uno::RuntimeException );
68 
69     // XBrowseNodeFactory
70     virtual css::uno::Reference< css::script::browse::XBrowseNode > SAL_CALL
71         createView( sal_Int16 viewType )
72             throw ( css::uno::RuntimeException );
73     private:
74     css::uno::Reference< css::script::browse::XBrowseNode >
75         getSelectorHierarchy()
76             throw ( css::uno::RuntimeException );
77 
78     css::uno::Reference< css::script::browse::XBrowseNode >
79         getOrganizerHierarchy()
80             throw ( css::uno::RuntimeException );
81 };
82 
83 
84 } // namespace browsenodefactory
85