LibreOffice Module ucb (master) 1
webdavprovider.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
21#pragma once
22
23#include <sal/config.h>
24
25#include <memory>
26
27#include <rtl/ref.hxx>
28#include <com/sun/star/beans/Property.hpp>
29#include "DAVSessionFactory.hxx"
31#include "PropertyMap.hxx"
32
33namespace com::sun::star::lang {
34class XSingleServiceFactory;
35}
36
37namespace http_dav_ucp {
38
39
40// UNO service name for the provider. This name will be used by the UCB to
41// create instances of the provider.
42inline constexpr OUStringLiteral WEBDAV_CONTENT_PROVIDER_SERVICE_NAME = u"com.sun.star.ucb.WebDAVContentProvider";
43
44// URL scheme. This is the scheme the provider will be able to create
45// contents for. The UCB will select the provider ( i.e. in order to create
46// contents ) according to this scheme.
47#define VNDSUNSTARWEBDAV_URL_SCHEME "vnd.sun.star.webdav"
48#define VNDSUNSTARWEBDAVS_URL_SCHEME u"vnd.sun.star.webdavs"
49#define HTTP_URL_SCHEME u"http"
50#define HTTPS_URL_SCHEME u"https"
51#define DAV_URL_SCHEME u"dav"
52#define DAVS_URL_SCHEME u"davs"
53#define WEBDAV_URL_SCHEME u"webdav"
54#define WEBDAVS_URL_SCHEME u"webdavs"
55
56inline constexpr OUStringLiteral HTTP_CONTENT_TYPE = u"application/" HTTP_URL_SCHEME "-content";
57
58#define WEBDAV_CONTENT_TYPE HTTP_CONTENT_TYPE
59inline constexpr OUStringLiteral WEBDAV_COLLECTION_TYPE = u"application/" VNDSUNSTARWEBDAV_URL_SCHEME "-collection";
60
61
63{
65 std::unique_ptr<PropertyMap> m_pProps;
66
67public:
68 explicit ContentProvider( const css::uno::Reference< css::uno::XComponentContext >& rContext );
69 virtual ~ContentProvider() override;
70
71 // XInterface
72 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
73 virtual void SAL_CALL acquire()
74 noexcept override;
75 virtual void SAL_CALL release()
76 noexcept override;
77
78 // XTypeProvider
79 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
80 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
81
82 // XServiceInfo
83 virtual OUString SAL_CALL getImplementationName() override;
84 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
85 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
86
87 // XContentProvider
88 virtual css::uno::Reference< css::ucb::XContent > SAL_CALL
89 queryContent( const css::uno::Reference< css::ucb::XContentIdentifier >& Identifier ) override;
90
91
92 // Non-interface methods.
93
94 bool getProperty( const OUString & rPropName,
95 css::beans::Property & rProp );
96};
97
98}
99
100/* 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 release() noexcept override
ContentProvider(const css::uno::Reference< css::uno::XComponentContext > &rContext)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
std::unique_ptr< PropertyMap > m_pProps
bool getProperty(const OUString &rPropName, css::beans::Property &rProp)
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual OUString SAL_CALL getImplementationName() override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual void SAL_CALL acquire() noexcept override
rtl::Reference< DAVSessionFactory > m_xDAVSessionFactory
virtual ~ContentProvider() override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
float u
Type
constexpr OUStringLiteral WEBDAV_COLLECTION_TYPE
constexpr OUStringLiteral HTTP_CONTENT_TYPE
constexpr OUStringLiteral WEBDAV_CONTENT_PROVIDER_SERVICE_NAME
unsigned char sal_Bool
signed char sal_Int8
#define HTTP_URL_SCHEME
#define VNDSUNSTARWEBDAV_URL_SCHEME