bump product version to 5.0.4.1
[LibreOffice.git] / ucb / source / ucp / hierarchy / hierarchydatasource.hxx
blob4a695a7099131526ed5ddb7519c9643c000fcec1
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_UCB_SOURCE_UCP_HIERARCHY_HIERARCHYDATASOURCE_HXX
21 #define INCLUDED_UCB_SOURCE_UCP_HIERARCHY_HIERARCHYDATASOURCE_HXX
23 #include <osl/mutex.hxx>
24 #include <com/sun/star/lang/XComponent.hpp>
25 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
26 #include <com/sun/star/lang/XServiceInfo.hpp>
27 #include <com/sun/star/lang/XTypeProvider.hpp>
28 #include <com/sun/star/uno/XComponentContext.hpp>
29 #include <cppuhelper/weak.hxx>
30 #include <ucbhelper/macros.hxx>
32 namespace cppu { class OInterfaceContainerHelper; }
34 namespace hierarchy_ucp {
38 class HierarchyDataSource : public cppu::OWeakObject,
39 public css::lang::XServiceInfo,
40 public css::lang::XTypeProvider,
41 public css::lang::XComponent,
42 public css::lang::XMultiServiceFactory
44 osl::Mutex m_aMutex;
45 css::uno::Reference< css::uno::XComponentContext > m_xContext;
46 css::uno::Reference< css::lang::XMultiServiceFactory > m_xConfigProvider;
47 cppu::OInterfaceContainerHelper * m_pDisposeEventListeners;
49 public:
50 HierarchyDataSource( const css::uno::Reference< css::uno::XComponentContext > & rxContext );
51 virtual ~HierarchyDataSource();
53 // XInterface
54 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType )
55 throw( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
56 virtual void SAL_CALL acquire()
57 throw() SAL_OVERRIDE;
58 virtual void SAL_CALL release()
59 throw() SAL_OVERRIDE;
61 // XServiceInfo
62 virtual OUString SAL_CALL getImplementationName()
63 throw( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
64 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
65 throw( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
66 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
67 throw( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
69 static OUString getImplementationName_Static();
70 static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
72 static css::uno::Reference< css::lang::XSingleServiceFactory > createServiceFactory( const css::uno::Reference<
73 css::lang::XMultiServiceFactory >& rxServiceMgr );
75 // XTypeProvider
76 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
77 throw( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
78 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes()
79 throw( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
81 // XComponent
82 virtual void SAL_CALL dispose()
83 throw ( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
84 virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener > & xListener )
85 throw ( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
86 virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener > & aListener )
87 throw ( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
89 // XMultiServiceFactory
90 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance( const OUString & aServiceSpecifier )
91 throw ( css::uno::Exception,
92 css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
93 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArguments( const OUString & ServiceSpecifier,
94 const css::uno::Sequence<
95 css::uno::Any > & Arguments )
96 throw ( css::uno::Exception,
97 css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
98 virtual css::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames()
99 throw ( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
101 // Non-Interface methods
103 private:
104 css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArguments( const OUString & ServiceSpecifier,
105 const css::uno::Sequence<
106 css::uno::Any > & Arguments,
107 bool bCheckArgs )
108 throw ( css::uno::Exception, css::uno::RuntimeException );
110 css::uno::Reference< css::lang::XMultiServiceFactory > getConfigProvider();
112 static bool createConfigPath( const OUString & rInPath, OUString & rOutPath );
115 } // namespace hierarchy_ucp
117 #endif // INCLUDED_UCB_SOURCE_UCP_HIERARCHY_HIERARCHYDATASOURCE_HXX
119 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */