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 "DAVResource.hxx"
28#include "DAVSessionFactory.hxx"
29#include "DAVTypes.hxx"
31
32namespace com { namespace sun { namespace star { namespace beans {
33 struct NamedValue;
34} } } }
35
36namespace com::sun::star::ucb {
37 struct Lock;
38}
39
40namespace http_dav_ucp
41{
42
43class DAVAuthListener;
44
46{
47public:
48 void acquire()
49 {
50 osl_atomic_increment( &m_nRefCount );
51 }
52
53 void release()
54 {
55 if ( osl_atomic_decrement( &m_nRefCount ) == 0 )
56 {
57 m_xFactory->releaseElement( this );
58 delete this;
59 }
60 }
61
62 virtual bool CanUse( const OUString & rURI,
63 const ::com::sun::star::uno::Sequence<::com::sun::star::beans::NamedValue>& rFlags ) = 0;
64
65 virtual bool UsesProxy() = 0;
66
67 // DAV methods
68
69 virtual void OPTIONS( const OUString & inPath,
70 DAVOptions & rOptions,
71 const DAVRequestEnvironment & rEnv ) = 0;
72
73 // allprop & named
75 virtual void PROPFIND( const OUString & inPath,
76 const Depth inDepth,
77 const std::vector< OUString > & inPropertyNames,
78 std::vector< DAVResource > & ioResources,
79 const DAVRequestEnvironment & rEnv ) = 0;
80
81 // propnames
83 virtual void PROPFIND( const OUString & inPath,
84 const Depth inDepth,
85 std::vector< DAVResourceInfo > & ioResInfo,
86 const DAVRequestEnvironment & rEnv ) = 0;
87
89 virtual void PROPPATCH( const OUString & inPath,
90 const std::vector< ProppatchValue > & inValues,
91 const DAVRequestEnvironment & rEnv ) = 0;
92
94 virtual void HEAD( const OUString & inPath,
95 const std::vector< OUString > & inHeaderNames,
96 DAVResource & ioResource,
97 const DAVRequestEnvironment & rEnv ) = 0;
98
100 virtual css::uno::Reference< css::io::XInputStream >
101 GET( const OUString & inPath,
102 const DAVRequestEnvironment & rEnv ) = 0;
103
105 virtual void GET( const OUString & inPath,
106 css::uno::Reference< css::io::XOutputStream >& o,
107 const DAVRequestEnvironment & rEnv ) = 0;
108
110 virtual css::uno::Reference< css::io::XInputStream >
111 GET( const OUString & inPath,
112 const std::vector< OUString > & inHeaderNames,
113 DAVResource & ioResource,
114 const DAVRequestEnvironment & rEnv ) = 0;
115
117 virtual void
118 GET( const OUString & inPath,
119 css::uno::Reference< css::io::XOutputStream >& o,
120 const std::vector< OUString > & inHeaderNames,
121 DAVResource & ioResource,
122 const DAVRequestEnvironment & rEnv ) = 0;
123
125 virtual void PUT( const OUString & inPath,
126 const css::uno::Reference< css::io::XInputStream >& s,
127 const DAVRequestEnvironment & rEnv ) = 0;
128
130 virtual css::uno::Reference< css::io::XInputStream >
131 POST( const OUString & inPath,
132 const OUString & rContentType,
133 const OUString & rReferer,
134 const css::uno::Reference< css::io::XInputStream > & inInputStream,
135 const DAVRequestEnvironment & rEnv ) = 0;
136
138 virtual void POST( const OUString & inPath,
139 const OUString & rContentType,
140 const OUString & rReferer,
141 const css::uno::Reference< css::io::XInputStream > & inInputStream,
142 css::uno::Reference< css::io::XOutputStream > & oOutputStream,
143 const DAVRequestEnvironment & rEnv ) = 0;
144
146 virtual void MKCOL( const OUString & inPath,
147 const DAVRequestEnvironment & rEnv ) = 0;
148
150 virtual void COPY( const OUString & inSource,
151 const OUString & inDestination,
152 const DAVRequestEnvironment & rEnv,
153 bool inOverwrite = false ) = 0;
154
156 virtual void MOVE( const OUString & inSource,
157 const OUString & inDestination,
158 const DAVRequestEnvironment & rEnv,
159 bool inOverwrite = false ) = 0;
160
162 virtual void DESTROY( const OUString & inPath,
163 const DAVRequestEnvironment & rEnv ) = 0;
164
165 // set new lock.
167 virtual void LOCK( const OUString & inPath,
168 css::ucb::Lock & inLock,
169 const DAVRequestEnvironment & rEnv ) = 0;
170
172 virtual void UNLOCK( const OUString & inPath,
173 const DAVRequestEnvironment & rEnv ) = 0;
174
176 virtual void abort() = 0;
177
178protected:
180
182 : m_xFactory( rFactory ), m_nRefCount( 0 ) {}
183
184 virtual ~DAVSession() {}
185
186private:
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
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
DAVSession(rtl::Reference< DAVSessionFactory > const &rFactory)
Definition: DAVSession.hxx:181
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:179