fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / ucb / source / ucp / webdav / DAVSession.hxx
blob45a13838edca64fe5807ae92f433618758d9d670
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
22 #ifndef INCLUDED_UCB_SOURCE_UCP_WEBDAV_DAVSESSION_HXX
23 #define INCLUDED_UCB_SOURCE_UCP_WEBDAV_DAVSESSION_HXX
25 #include <memory>
26 #include <rtl/ustring.hxx>
27 #include <com/sun/star/io/XInputStream.hpp>
28 #include <com/sun/star/io/XOutputStream.hpp>
29 #include "DAVException.hxx"
30 #include "DAVProperties.hxx"
31 #include "DAVResource.hxx"
32 #include "DAVSessionFactory.hxx"
33 #include "DAVTypes.hxx"
34 #include "DAVRequestEnvironment.hxx"
36 namespace com { namespace sun { namespace star { namespace ucb {
37 struct Lock;
38 } } } }
40 namespace http_dav_ucp
43 class DAVAuthListener;
45 class DAVSession
47 public:
48 inline void acquire()
50 osl_incrementInterlockedCount( &m_nRefCount );
53 void release()
55 if ( osl_decrementInterlockedCount( &m_nRefCount ) == 0 )
57 m_xFactory->releaseElement( this );
58 delete this;
62 virtual bool CanUse( const OUString & inPath ) = 0;
64 virtual bool UsesProxy() = 0;
66 // DAV methods
69 // NOT USED
71 virtual void OPTIONS( const OUString & inPath,
72 DAVCapabilities & outCapabilities,
73 const DAVRequestEnvironment & rEnv )
74 throw( DAVException ) = 0;
77 // allprop & named
78 virtual void PROPFIND( const OUString & inPath,
79 const Depth inDepth,
80 const std::vector< OUString > & inPropertyNames,
81 std::vector< DAVResource > & ioResources,
82 const DAVRequestEnvironment & rEnv )
83 throw( DAVException ) = 0;
85 // propnames
86 virtual void PROPFIND( const OUString & inPath,
87 const Depth inDepth,
88 std::vector< DAVResourceInfo > & ioResInfo,
89 const DAVRequestEnvironment & rEnv )
90 throw( DAVException ) = 0;
92 virtual void PROPPATCH( const OUString & inPath,
93 const std::vector< ProppatchValue > & inValues,
94 const DAVRequestEnvironment & rEnv )
95 throw( DAVException ) = 0;
97 virtual void HEAD( const OUString & inPath,
98 const std::vector< OUString > & inHeaderNames,
99 DAVResource & ioResource,
100 const DAVRequestEnvironment & rEnv )
101 throw( DAVException ) = 0;
103 virtual com::sun::star::uno::Reference< com::sun::star::io::XInputStream >
104 GET( const OUString & inPath,
105 const DAVRequestEnvironment & rEnv )
106 throw( DAVException ) = 0;
108 virtual void GET( const OUString & inPath,
109 com::sun::star::uno::Reference<
110 com::sun::star::io::XOutputStream >& o,
111 const DAVRequestEnvironment & rEnv )
112 throw( DAVException ) = 0;
114 virtual com::sun::star::uno::Reference< com::sun::star::io::XInputStream >
115 GET( const OUString & inPath,
116 const std::vector< OUString > & inHeaderNames,
117 DAVResource & ioResource,
118 const DAVRequestEnvironment & rEnv )
119 throw( DAVException ) = 0;
121 virtual void
122 GET( const OUString & inPath,
123 com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& o,
124 const std::vector< OUString > & inHeaderNames,
125 DAVResource & ioResource,
126 const DAVRequestEnvironment & rEnv )
127 throw( DAVException ) = 0;
129 virtual void PUT( const OUString & inPath,
130 const com::sun::star::uno::Reference<
131 com::sun::star::io::XInputStream >& s,
132 const DAVRequestEnvironment & rEnv )
133 throw( DAVException ) = 0;
135 virtual com::sun::star::uno::Reference< com::sun::star::io::XInputStream >
136 POST( const OUString & inPath,
137 const OUString & rContentType,
138 const OUString & rReferer,
139 const com::sun::star::uno::Reference<
140 com::sun::star::io::XInputStream > & inInputStream,
141 const DAVRequestEnvironment & rEnv )
142 throw ( DAVException ) = 0;
144 virtual void POST( const OUString & inPath,
145 const OUString & rContentType,
146 const OUString & rReferer,
147 const com::sun::star::uno::Reference<
148 com::sun::star::io::XInputStream > & inInputStream,
149 com::sun::star::uno::Reference<
150 com::sun::star::io::XOutputStream > & oOutputStream,
151 const DAVRequestEnvironment & rEnv )
152 throw ( DAVException ) = 0;
154 virtual void MKCOL( const OUString & inPath,
155 const DAVRequestEnvironment & rEnv )
156 throw( DAVException ) = 0;
158 virtual void COPY( const OUString & inSource,
159 const OUString & inDestination,
160 const DAVRequestEnvironment & rEnv,
161 bool inOverwrite = false )
162 throw( DAVException ) = 0;
164 virtual void MOVE( const OUString & inSource,
165 const OUString & inDestination,
166 const DAVRequestEnvironment & rEnv,
167 bool inOverwrite = false )
168 throw( DAVException ) = 0;
170 virtual void DESTROY( const OUString & inPath,
171 const DAVRequestEnvironment & rEnv )
172 throw( DAVException ) = 0;
174 // set new lock.
175 virtual void LOCK( const OUString & inPath,
176 com::sun::star::ucb::Lock & inLock,
177 const DAVRequestEnvironment & rEnv )
178 throw ( DAVException ) = 0;
180 // refresh existing lock.
181 virtual sal_Int64 LOCK( const OUString & inPath,
182 sal_Int64 nTimeout,
183 const DAVRequestEnvironment & rEnv )
184 throw ( DAVException ) = 0;
186 virtual void UNLOCK( const OUString & inPath,
187 const DAVRequestEnvironment & rEnv )
188 throw ( DAVException ) = 0;
190 virtual void abort()
191 throw( DAVException ) = 0;
193 protected:
194 rtl::Reference< DAVSessionFactory > m_xFactory;
196 DAVSession( rtl::Reference< DAVSessionFactory > const & rFactory )
197 : m_xFactory( rFactory ), m_nRefCount( 0 ) {}
199 virtual ~DAVSession() {}
201 private:
202 DAVSessionFactory::Map::iterator m_aContainerIt;
203 oslInterlockedCount m_nRefCount;
205 friend class DAVSessionFactory;
206 friend struct std::default_delete< DAVSession >;
209 } // namespace http_dav_ucp
211 #endif // INCLUDED_UCB_SOURCE_UCP_WEBDAV_DAVSESSION_HXX
213 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */