LibreOffice Module ucb (master) 1
hierarchyprovider.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
23#include <com/sun/star/lang/XInitialization.hpp>
24#include <com/sun/star/lang/XMultiServiceFactory.hpp>
25#include <unordered_map>
26
27namespace com::sun::star {
28 namespace container {
29 class XHierarchicalNameAccess;
30 }
31 namespace util {
32 class XOfficeInstallationDirectories;
33 }
34}
35
36namespace hierarchy_ucp {
37
38
39#define HIERARCHY_URL_SCHEME \
40 "vnd.sun.star.hier"
41#define HIERARCHY_URL_SCHEME_LENGTH 17
42
43inline constexpr OUStringLiteral HIERARCHY_FOLDER_CONTENT_TYPE =
44 u"application/" HIERARCHY_URL_SCHEME "-folder";
45inline constexpr OUStringLiteral HIERARCHY_LINK_CONTENT_TYPE =
46 u"application/" HIERARCHY_URL_SCHEME "-link";
47
49{
50 css::uno::Reference< css::lang::XMultiServiceFactory > xConfigProvider;
51 css::uno::Reference< css::container::XHierarchicalNameAccess > xRootReadAccess;
53
55};
56
57typedef std::unordered_map
58<
59 OUString, // service specifier
60 ConfigProviderMapEntry
61>
63
65 public css::lang::XInitialization
66{
68 css::uno::Reference< css::util::XOfficeInstallationDirectories > m_xOfficeInstDirs;
69
70public:
72 const css::uno::Reference< css::uno::XComponentContext >& rxContext );
73 virtual ~HierarchyContentProvider() override;
74
75 // XInterface
76 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
77 virtual void SAL_CALL acquire()
78 noexcept override;
79 virtual void SAL_CALL release()
80 noexcept override;
81
82 // XTypeProvider
83 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
84 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
85
86 // XServiceInfo
87 virtual OUString SAL_CALL getImplementationName() override;
88 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
89 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
90
91 // XContentProvider
92 virtual css::uno::Reference< css::ucb::XContent > SAL_CALL
93 queryContent( const css::uno::Reference< css::ucb::XContentIdentifier >& Identifier ) override;
94
95 // XInitialization
96 virtual void SAL_CALL
97 initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
98
99 // Non-Interface methods
100 css::uno::Reference< css::lang::XMultiServiceFactory >
101 getConfigProvider( const OUString & rServiceSpecifier );
102 css::uno::Reference< css::container::XHierarchicalNameAccess >
103 getRootConfigReadNameAccess( const OUString & rServiceSpecifier );
104
105 // Note: may return an empty reference.
106 css::uno::Reference< css::util::XOfficeInstallationDirectories >
108};
109
110} // namespace hierarchy_ucp
111
112/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::uno::Reference< css::ucb::XContent > SAL_CALL queryContent(const css::uno::Reference< css::ucb::XContentIdentifier > &Identifier) override
virtual void SAL_CALL acquire() noexcept override
css::uno::Reference< css::lang::XMultiServiceFactory > getConfigProvider(const OUString &rServiceSpecifier)
virtual void SAL_CALL release() noexcept override
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
css::uno::Reference< css::util::XOfficeInstallationDirectories > m_xOfficeInstDirs
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
css::uno::Reference< css::container::XHierarchicalNameAccess > getRootConfigReadNameAccess(const OUString &rServiceSpecifier)
HierarchyContentProvider(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
virtual OUString SAL_CALL getImplementationName() override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
css::uno::Reference< css::util::XOfficeInstallationDirectories > getOfficeInstallationDirectories()
float u
#define HIERARCHY_URL_SCHEME
Type
constexpr OUStringLiteral HIERARCHY_LINK_CONTENT_TYPE
constexpr OUStringLiteral HIERARCHY_FOLDER_CONTENT_TYPE
std::unordered_map< OUString, ConfigProviderMapEntry > ConfigProviderMap
css::uno::Reference< css::container::XHierarchicalNameAccess > xRootReadAccess
css::uno::Reference< css::lang::XMultiServiceFactory > xConfigProvider
unsigned char sal_Bool
signed char sal_Int8