1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #include <rtl/ustring.hxx>
29 #include <cppuhelper/implbase2.hxx>
30 
31 #include <com/sun/star/uno/XComponentContext.hpp>
32 #include <com/sun/star/lang/XServiceInfo.hpp>
33 #include <com/sun/star/uno/RuntimeException.hpp>
34 #include <com/sun/star/registry/XRegistryKey.hpp>
35 
36 #include <com/sun/star/script/browse/XBrowseNode.hpp>
37 #include <com/sun/star/script/browse/BrowseNodeTypes.hpp>
38 #include <com/sun/star/script/browse/XBrowseNodeFactory.hpp>
39 
40 namespace browsenodefactory
41 {
42 // for simplification
43 #define css ::com::sun::star
44 
45 class BrowseNodeFactoryImpl :
46     public ::cppu::WeakImplHelper2 <
47         css::script::browse::XBrowseNodeFactory,
48         css::lang::XServiceInfo >
49 {
50 private:
51     css::uno::Reference< css::uno::XComponentContext > m_xComponentContext;
52     css::uno::Reference< css::script::browse::XBrowseNode > m_xSelectorBrowseNode;
53 
54 protected:
55     virtual ~BrowseNodeFactoryImpl();
56 
57 public:
58     BrowseNodeFactoryImpl(
59         css::uno::Reference< css::uno::XComponentContext > const & xComponentContext );
60 
61     // XServiceInfo
62     virtual ::rtl::OUString SAL_CALL getImplementationName()
63         throw ( css::uno::RuntimeException );
64 
65     virtual sal_Bool SAL_CALL
66         supportsService( ::rtl::OUString const & serviceName )
67             throw ( css::uno::RuntimeException );
68 
69     virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL
70         getSupportedServiceNames()
71             throw ( css::uno::RuntimeException );
72 
73     // XBrowseNodeFactory
74     virtual css::uno::Reference< css::script::browse::XBrowseNode > SAL_CALL
75         createView( sal_Int16 viewType )
76             throw ( css::uno::RuntimeException );
77     private:
78     css::uno::Reference< css::script::browse::XBrowseNode >
79         getSelectorHierarchy()
80             throw ( css::uno::RuntimeException );
81 
82     css::uno::Reference< css::script::browse::XBrowseNode >
83         getOrganizerHierarchy()
84             throw ( css::uno::RuntimeException );
85 };
86 
87 
88 } // namespace browsenodefactory
89