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