xref: /trunk/main/scripting/source/provider/BrowseNodeFactoryImpl.hxx (revision 45c5a00162811bd03b87fcb4fe9996782f2b59ec)
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 
60     virtual sal_Bool SAL_CALL
61         supportsService( ::rtl::OUString const & serviceName );
62 
63     virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL
64         getSupportedServiceNames();
65 
66     // XBrowseNodeFactory
67     virtual css::uno::Reference< css::script::browse::XBrowseNode > SAL_CALL
68         createView( sal_Int16 viewType );
69     private:
70     css::uno::Reference< css::script::browse::XBrowseNode >
71         getSelectorHierarchy();
72 
73     css::uno::Reference< css::script::browse::XBrowseNode >
74         getOrganizerHierarchy();
75 };
76 
77 
78 } // namespace browsenodefactory
79