LibreOffice Module ucb (master) 1
DAVSession.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20
21#pragma once
22
23#include <memory>
24#include <rtl/ustring.hxx>
25#include <com/sun/star/io/XInputStream.hpp>
26#include <com/sun/star/io/XOutputStream.hpp>
27#include <utility>
28#include "DAVResource.hxx"
29#include "DAVSessionFactory.hxx"
30#include "DAVTypes.hxx"
32
33namespace com { namespace sun { namespace star { namespace beans {
34 struct NamedValue;
35} } } }
36
37namespace com::sun::star::ucb {
38 struct Lock;
39}
40
41namespace http_dav_ucp
42{
43
44class DAVAuthListener;
45
47{
48public:
49 void acquire()
50 {
51 osl_atomic_increment( &m_nRefCount );
52 }
53
54 void release()
55 {
56 if ( osl_atomic_decrement( &m_nRefCount ) == 0 )
57 {
58 m_xFactory->releaseElement( this );
59 delete this;
60 }
61 }
62
63 virtual bool CanUse( const OUString & rURI,
64 const ::com::sun::star::uno::Sequence<::com::sun::star::beans::NamedValue>& rFlags ) = 0;
65
66 virtual bool UsesProxy() = 0;
67
68 // DAV methods
69
70 virtual void OPTIONS( const OUString & inPath,
71 DAVOptions & rOptions,
72 const DAVRequestEnvironment & rEnv ) = 0;
73
74 // allprop & named
76 virtual void PROPFIND( const OUString & inPath,
77 const Depth inDepth,
78 const std::vector< OUString > & inPropertyNames,
79 std::vector< DAVResource > & ioResources,
80 const DAVRequestEnvironment & rEnv ) = 0;
81
82 // propnames
84 virtual void PROPFIND( const OUString & inPath,
85 const Depth inDepth,
86 std::vector< DAVResourceInfo > & ioResInfo,
87 const DAVRequestEnvironment & rEnv ) = 0;
88
90 virtual void PROPPATCH( const OUString & inPath,
91 const std::vector< ProppatchValue > & inValues,
92 const DAVRequestEnvironment & rEnv ) = 0;
93
95 virtual void HEAD( const OUString & inPath,
96 const std::vector< OUString > & inHeaderNames,
97 DAVResource & ioResource,
98 const DAVRequestEnvironment & rEnv ) = 0;
99
101 virtual css::uno::Reference< css::io::XInputStream >
102 GET( const OUString & inPath,
103 const DAVRequestEnvironment & rEnv ) = 0;
104
106 virtual void GET( const OUString & inPath,
107 css::uno::Reference< css::io::XOutputStream >& o,
108 const DAVRequestEnvironment & rEnv ) = 0;
109
111 virtual css::uno::Reference< css::io::XInputStream >
112 GET( const OUString & inPath,
113 const std::vector< OUString > & inHeaderNames,
114 DAVResource & ioResource,
115 const DAVRequestEnvironment & rEnv ) = 0;
116
118 virtual void
119 GET( const OUString & inPath,
120 css::uno::Reference< css::io::XOutputStream >& o,
121 const std::vector< OUString > & inHeaderNames,
122 DAVResource & ioResource,
123 const DAVRequestEnvironment & rEnv ) = 0;
124
126 virtual void PUT( const OUString & inPath,
127 const css::uno::Reference< css::io::XInputStream >& s,
128 const DAVRequestEnvironment & rEnv ) = 0;
129
131 virtual css::uno::Reference< css::io::XInputStream >
132 POST( const OUString & inPath,
133 const OUString & rContentType,
134 const OUString & rReferer,
135 const css::uno::Reference< css::io::XInputStream > & inInputStream,
136 const DAVRequestEnvironment & rEnv ) = 0;
137
139 virtual void POST( const OUString & inPath,
140 const OUString & rContentType,
141 const OUString & rReferer,
142 const css::uno::Reference< css::io::XInputStream > & inInputStream,
143 css::uno::Reference< css::io::XOutputStream > & oOutputStream,
144 const DAVRequestEnvironment & rEnv ) = 0;
145
147 virtual void MKCOL( const OUString & inPath,
148 const DAVRequestEnvironment & rEnv ) = 0;
149
151 virtual void COPY( const OUString & inSource,
152 const OUString & inDestination,
153 const DAVRequestEnvironment & rEnv,
154 bool inOverwrite = false ) = 0;
155
157 virtual void MOVE( const OUString & inSource,
158 const OUString & inDestination,
159 const DAVRequestEnvironment & rEnv,
160 bool inOverwrite = false ) = 0;
161
163 virtual void DESTROY( const OUString & inPath,
164 const DAVRequestEnvironment & rEnv ) = 0;
165
166 // set new lock.
168 virtual void LOCK( const OUString & inPath,
169 css::ucb::Lock & inLock,
170 const DAVRequestEnvironment & rEnv ) = 0;
171
173 virtual void UNLOCK( const OUString & inPath,
174 const DAVRequestEnvironment & rEnv ) = 0;
175
177 virtual void abort() = 0;
178
179protected:
181 : m_xFactory(std::move( xFactory )), m_nRefCount( 0 ) {}
182
183 virtual ~DAVSession() {}
184
185private:
187 DAVSessionFactory::Map::iterator m_aContainerIt;
188 oslInterlockedCount m_nRefCount;
189
190 friend class DAVSessionFactory;
191 friend struct std::default_delete< DAVSession >;
192};
193
194} // namespace http_dav_ucp
195
196/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void MKCOL(const OUString &inPath, const DAVRequestEnvironment &rEnv)=0
virtual void LOCK(const OUString &inPath, css::ucb::Lock &inLock, const DAVRequestEnvironment &rEnv)=0
virtual void COPY(const OUString &inSource, const OUString &inDestination, const DAVRequestEnvironment &rEnv, bool inOverwrite=false)=0
virtual void UNLOCK(const OUString &inPath, const DAVRequestEnvironment &rEnv)=0
virtual css::uno::Reference< css::io::XInputStream > GET(const OUString &inPath, const std::vector< OUString > &inHeaderNames, DAVResource &ioResource, const DAVRequestEnvironment &rEnv)=0
virtual css::uno::Reference< css::io::XInputStream > GET(const OUString &inPath, const DAVRequestEnvironment &rEnv)=0
virtual void GET(const OUString &inPath, css::uno::Reference< css::io::XOutputStream > &o, const DAVRequestEnvironment &rEnv)=0
virtual void abort()=0
virtual bool CanUse(const OUString &rURI, const ::com::sun::star::uno::Sequence<::com::sun::star::beans::NamedValue > &rFlags)=0
virtual void PROPFIND(const OUString &inPath, const Depth inDepth, const std::vector< OUString > &inPropertyNames, std::vector< DAVResource > &ioResources, const DAVRequestEnvironment &rEnv)=0
virtual void GET(const OUString &inPath, css::uno::Reference< css::io::XOutputStream > &o, const std::vector< OUString > &inHeaderNames, DAVResource &ioResource, const DAVRequestEnvironment &rEnv)=0
virtual css::uno::Reference< css::io::XInputStream > POST(const OUString &inPath, const OUString &rContentType, const OUString &rReferer, const css::uno::Reference< css::io::XInputStream > &inInputStream, const DAVRequestEnvironment &rEnv)=0
virtual void PROPFIND(const OUString &inPath, const Depth inDepth, std::vector< DAVResourceInfo > &ioResInfo, const DAVRequestEnvironment &rEnv)=0
virtual void OPTIONS(const OUString &inPath, DAVOptions &rOptions, const DAVRequestEnvironment &rEnv)=0
DAVSessionFactory::Map::iterator m_aContainerIt
Definition: DAVSession.hxx:187
oslInterlockedCount m_nRefCount
Definition: DAVSession.hxx:188
virtual bool UsesProxy()=0
DAVSession(rtl::Reference< DAVSessionFactory > xFactory)
Definition: DAVSession.hxx:180
virtual void HEAD(const OUString &inPath, const std::vector< OUString > &inHeaderNames, DAVResource &ioResource, const DAVRequestEnvironment &rEnv)=0
virtual void DESTROY(const OUString &inPath, const DAVRequestEnvironment &rEnv)=0
virtual void PUT(const OUString &inPath, const css::uno::Reference< css::io::XInputStream > &s, const DAVRequestEnvironment &rEnv)=0
virtual void MOVE(const OUString &inSource, const OUString &inDestination, const DAVRequestEnvironment &rEnv, bool inOverwrite=false)=0
virtual void PROPPATCH(const OUString &inPath, const std::vector< ProppatchValue > &inValues, const DAVRequestEnvironment &rEnv)=0
virtual void POST(const OUString &inPath, const OUString &rContentType, const OUString &rReferer, const css::uno::Reference< css::io::XInputStream > &inInputStream, css::uno::Reference< css::io::XOutputStream > &oOutputStream, const DAVRequestEnvironment &rEnv)=0
rtl::Reference< DAVSessionFactory > m_xFactory
Definition: DAVSession.hxx:186
Reference< XSingleServiceFactory > xFactory