merge the formfield patch from ooo-build
[ooovba.git] / ucb / source / ucp / webdav / webdavprovider.hxx
blobdbf89e5ce245781c1a12c0301097d267a6e6df9a
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: webdavprovider.hxx,v $
10 * $Revision: 1.11 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _WEBDAV_UCP_PROVIDER_HXX
32 #define _WEBDAV_UCP_PROVIDER_HXX
34 #include <rtl/ref.hxx>
35 #include <com/sun/star/beans/Property.hpp>
36 #include "DAVSessionFactory.hxx"
37 #include <ucbhelper/providerhelper.hxx>
38 #include "PropertyMap.hxx"
40 namespace webdav_ucp {
42 //=========================================================================
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 \
47 "com.sun.star.ucb.WebDAVContentProvider"
48 #define WEBDAV_CONTENT_PROVIDER_SERVICE_NAME_LENGTH 38
50 // URL scheme. This is the scheme the provider will be able to create
51 // contents for. The UCB will select the provider ( i.e. in order to create
52 // contents ) according to this scheme.
53 #define WEBDAV_URL_SCHEME \
54 "vnd.sun.star.webdav"
56 #define HTTP_URL_SCHEME "http"
58 #define HTTPS_URL_SCHEME "https"
60 #define DAV_URL_SCHEME "dav"
61 #define DAV_URL_SCHEME_LENGTH 3
63 #define DAVS_URL_SCHEME "davs"
64 #define DAVS_URL_SCHEME_LENGTH 4
68 #define FTP_URL_SCHEME "ftp"
70 #define DAV_URL_SCHEME "dav"
71 #define DAVS_URL_SCHEME "davs"
73 #define PLAIN_WEBDAV_URL_SCHEME "webdav"
74 #define PLAIN_WEBDAVS_URL_SCHEME "webdavs"
76 #define HTTP_CONTENT_TYPE \
77 "application/" HTTP_URL_SCHEME "-content"
79 #define WEBDAV_CONTENT_TYPE HTTP_CONTENT_TYPE
80 #define WEBDAV_COLLECTION_TYPE \
81 "application/" WEBDAV_URL_SCHEME "-collection"
83 //=========================================================================
85 class ContentProvider : public ::ucbhelper::ContentProviderImplHelper
87 rtl::Reference< DAVSessionFactory > m_xDAVSessionFactory;
88 PropertyMap * m_pProps;
90 public:
91 ContentProvider( const ::com::sun::star::uno::Reference<
92 ::com::sun::star::lang::XMultiServiceFactory >& rSMgr );
93 virtual ~ContentProvider();
95 // XInterface
96 XINTERFACE_DECL()
98 // XTypeProvider
99 XTYPEPROVIDER_DECL()
101 // XServiceInfo
102 XSERVICEINFO_DECL()
104 // XContentProvider
105 virtual ::com::sun::star::uno::Reference<
106 ::com::sun::star::ucb::XContent > SAL_CALL
107 queryContent( const ::com::sun::star::uno::Reference<
108 ::com::sun::star::ucb::XContentIdentifier >& Identifier )
109 throw( ::com::sun::star::ucb::IllegalIdentifierException,
110 ::com::sun::star::uno::RuntimeException );
112 //////////////////////////////////////////////////////////////////////
113 // Additional interfaces
114 //////////////////////////////////////////////////////////////////////
116 //////////////////////////////////////////////////////////////////////
117 // Non-interface methods.
118 //////////////////////////////////////////////////////////////////////
120 rtl::Reference< DAVSessionFactory > getDAVSessionFactory()
121 { return m_xDAVSessionFactory; }
123 bool getProperty( const ::rtl::OUString & rPropName,
124 ::com::sun::star::beans::Property & rProp,
125 bool bStrict = false );
130 #endif