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