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 _WEBDAV_UCP_PROVIDER_HXX
30 #define _WEBDAV_UCP_PROVIDER_HXX
32 #include <rtl/ref.hxx>
33 #include <com/sun/star/beans/Property.hpp>
34 #include "DAVSessionFactory.hxx"
35 #include <ucbhelper/providerhelper.hxx>
36 #include "PropertyMap.hxx"
38 namespace webdav_ucp
{
40 //=========================================================================
42 // UNO service name for the provider. This name will be used by the UCB to
43 // create instances of the provider.
44 #define WEBDAV_CONTENT_PROVIDER_SERVICE_NAME \
45 "com.sun.star.ucb.WebDAVContentProvider"
46 #define WEBDAV_CONTENT_PROVIDER_SERVICE_NAME_LENGTH 38
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 WEBDAV_URL_SCHEME \
53 #define WEBDAV_URL_SCHEME_LENGTH 19
55 #define HTTP_URL_SCHEME "http"
56 #define HTTP_URL_SCHEME_LENGTH 4
58 #define HTTPS_URL_SCHEME "https"
59 #define HTTPS_URL_SCHEME_LENGTH 5
61 #define DAV_URL_SCHEME "dav"
62 #define DAV_URL_SCHEME_LENGTH 3
64 #define DAVS_URL_SCHEME "davs"
65 #define DAVS_URL_SCHEME_LENGTH 4
69 #define FTP_URL_SCHEME "ftp"
71 #define HTTP_CONTENT_TYPE \
72 "application/" HTTP_URL_SCHEME "-content"
74 #define WEBDAV_CONTENT_TYPE HTTP_CONTENT_TYPE
75 #define WEBDAV_COLLECTION_TYPE \
76 "application/" WEBDAV_URL_SCHEME "-collection"
78 //=========================================================================
80 class ContentProvider
: public ::ucbhelper::ContentProviderImplHelper
82 rtl::Reference
< DAVSessionFactory
> m_xDAVSessionFactory
;
83 PropertyMap
* m_pProps
;
86 ContentProvider( const ::com::sun::star::uno::Reference
<
87 ::com::sun::star::lang::XMultiServiceFactory
>& rSMgr
);
88 virtual ~ContentProvider();
100 virtual ::com::sun::star::uno::Reference
<
101 ::com::sun::star::ucb::XContent
> SAL_CALL
102 queryContent( const ::com::sun::star::uno::Reference
<
103 ::com::sun::star::ucb::XContentIdentifier
>& Identifier
)
104 throw( ::com::sun::star::ucb::IllegalIdentifierException
,
105 ::com::sun::star::uno::RuntimeException
);
107 //////////////////////////////////////////////////////////////////////
108 // Additional interfaces
109 //////////////////////////////////////////////////////////////////////
111 //////////////////////////////////////////////////////////////////////
112 // Non-interface methods.
113 //////////////////////////////////////////////////////////////////////
115 rtl::Reference
< DAVSessionFactory
> getDAVSessionFactory()
116 { return m_xDAVSessionFactory
; }
118 bool getProperty( const ::rtl::OUString
& rPropName
,
119 ::com::sun::star::beans::Property
& rProp
,
120 bool bStrict
= false );
127 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */