1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
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.
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).
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.
27 ************************************************************************/
29 #ifndef INCLUDED_UCB_SOURCE_UCP_WEBDAV_NEON_WEBDAVPROVIDER_HXX
30 #define INCLUDED_UCB_SOURCE_UCP_WEBDAV_NEON_WEBDAVPROVIDER_HXX
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"
38 #include <ucbhelper/providerhelper.hxx>
39 #include "PropertyMap.hxx"
41 namespace webdav_ucp
{
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"
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"
60 #define FTP_URL_SCHEME "ftp"
62 #define HTTP_CONTENT_TYPE "application/" HTTP_URL_SCHEME "-content"
64 #define WEBDAV_CONTENT_TYPE HTTP_CONTENT_TYPE
65 #define WEBDAV_COLLECTION_TYPE "application/" VNDSUNSTARWEBDAV_URL_SCHEME "-collection"
68 class ContentProvider
: public ::ucbhelper::ContentProviderImplHelper
70 rtl::Reference
< DAVSessionFactory
> m_xDAVSessionFactory
;
71 std::unique_ptr
<PropertyMap
> m_pProps
;
74 explicit ContentProvider( const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
75 virtual ~ContentProvider() override
;
78 virtual css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& rType
) override
;
79 virtual void SAL_CALL
acquire()
81 virtual void SAL_CALL
release()
85 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() override
;
86 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() override
;
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
;
93 static OUString
getImplementationName_Static();
94 static css::uno::Sequence
< OUString
> getSupportedServiceNames_Static();
96 static css::uno::Reference
< css::lang::XSingleServiceFactory
>
97 createServiceFactory( const css::uno::Reference
<
98 css::lang::XMultiServiceFactory
>& rxServiceMgr
);
101 virtual css::uno::Reference
< css::ucb::XContent
> SAL_CALL
102 queryContent( const css::uno::Reference
< css::ucb::XContentIdentifier
>& Identifier
) override
;
105 // Non-interface methods.
107 void getProperty( const OUString
& rPropName
,
108 css::beans::Property
& rProp
);
115 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */