LibreOffice Module ucb (master)  1
neon/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  *
4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5  *
6  * Copyright 2000, 2010 Oracle and/or its affiliates.
7  *
8  * OpenOffice.org - a multi-platform office productivity suite
9  *
10  * This file is part of OpenOffice.org.
11  *
12  * OpenOffice.org is free software: you can redistribute it and/or modify
13  * it under the terms of the GNU Lesser General Public License version 3
14  * only, as published by the Free Software Foundation.
15  *
16  * OpenOffice.org is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Lesser General Public License version 3 for more details
20  * (a copy is included in the LICENSE file that accompanied this code).
21  *
22  * You should have received a copy of the GNU Lesser General Public License
23  * version 3 along with OpenOffice.org. If not, see
24  * <http://www.openoffice.org/license.html>
25  * for a copy of the LGPLv3 License.
26  *
27  ************************************************************************/
28 
29 #pragma once
30 
31 #include <memory>
32 #include <config_lgpl.h>
33 #include <rtl/ref.hxx>
34 #include <com/sun/star/beans/Property.hpp>
35 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
36 #include "DAVSessionFactory.hxx"
38 #include "PropertyMap.hxx"
39 
40 namespace webdav_ucp {
41 
42 
43 // UNO service name for the provider. This name will be used by the UCB to
44 // create instances of the provider.
45 #define WEBDAV_CONTENT_PROVIDER_SERVICE_NAME "com.sun.star.ucb.WebDAVContentProvider"
46 
47 // URL scheme. This is the scheme the provider will be able to create
48 // contents for. The UCB will select the provider ( i.e. in order to create
49 // contents ) according to this scheme.
50 #define VNDSUNSTARWEBDAV_URL_SCHEME "vnd.sun.star.webdav"
51 #define VNDSUNSTARWEBDAVS_URL_SCHEME u"vnd.sun.star.webdavs"
52 #define HTTP_URL_SCHEME "http"
53 #define HTTPS_URL_SCHEME "https"
54 #define DAV_URL_SCHEME u"dav"
55 #define DAVS_URL_SCHEME u"davs"
56 #define WEBDAV_URL_SCHEME u"webdav"
57 #define WEBDAVS_URL_SCHEME u"webdavs"
58 
59 #define FTP_URL_SCHEME "ftp"
60 
61 #define HTTP_CONTENT_TYPE "application/" HTTP_URL_SCHEME "-content"
62 
63 #define WEBDAV_CONTENT_TYPE HTTP_CONTENT_TYPE
64 #define WEBDAV_COLLECTION_TYPE "application/" VNDSUNSTARWEBDAV_URL_SCHEME "-collection"
65 
66 
68 {
70  std::unique_ptr<PropertyMap> m_pProps;
71 
72 public:
73  explicit ContentProvider( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
74  virtual ~ContentProvider() override;
75 
76  // XInterface
77  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
78  virtual void SAL_CALL acquire()
79  noexcept override;
80  virtual void SAL_CALL release()
81  noexcept override;
82 
83  // XTypeProvider
84  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
85  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
86 
87  // XServiceInfo
88  virtual OUString SAL_CALL getImplementationName() override;
89  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
90  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
91 
92  // XContentProvider
93  virtual css::uno::Reference< css::ucb::XContent > SAL_CALL
94  queryContent( const css::uno::Reference< css::ucb::XContentIdentifier >& Identifier ) override;
95 
96 
97  // Non-interface methods.
98 
99  void getProperty( const OUString & rPropName,
100  css::beans::Property & rProp );
101 };
102 
103 }
104 
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Type
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
signed char sal_Int8
std::unique_ptr< PropertyMap > m_pProps
virtual void SAL_CALL acquire() noexcept override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
virtual css::uno::Reference< css::ucb::XContent > SAL_CALL queryContent(const css::uno::Reference< css::ucb::XContentIdentifier > &Identifier) override
unsigned char sal_Bool
virtual void SAL_CALL release() noexcept override
void getProperty(const OUString &rPropName, css::beans::Property &rProp)
ContentProvider(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
virtual OUString SAL_CALL getImplementationName() override
rtl::Reference< DAVSessionFactory > m_xDAVSessionFactory
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override