1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
21 #ifndef INCLUDED_UCB_SOURCE_UCP_WEBDAV_SERFLOCKSTORE_HXX
22 #define INCLUDED_UCB_SOURCE_UCP_WEBDAV_SERFLOCKSTORE_HXX
25 #include <osl/mutex.hxx>
26 #include <rtl/ref.hxx>
27 #include <rtl/ustring.hxx>
28 #include <SerfSession.hxx>
30 namespace http_dav_ucp
38 rtl::Reference
< SerfSession
> m_xSession
;
39 sal_Int32 m_nLastChanceToSendRefreshRequest
;
42 : m_nLastChanceToSendRefreshRequest( -1 ) {}
44 LockInfo( const OUString
& sToken
,
45 rtl::Reference
< SerfSession
> const & xSession
,
46 sal_Int32 nLastChanceToSendRefreshRequest
)
48 m_xSession( xSession
),
49 m_nLastChanceToSendRefreshRequest( nLastChanceToSendRefreshRequest
) {}
52 typedef std::map
< OUString
, LockInfo
> LockInfoMap
;
57 TickerThread
* m_pTickerThread
;
59 LockInfoMap m_aLockInfoMap
;
65 bool finishing() const;
66 OUString
getLockToken( const OUString
& rLock
);
68 void addLock( const OUString
& rLock
,
69 const OUString
& sToken
,
70 rtl::Reference
< SerfSession
> const & xSession
,
71 // time in seconds since Jan 1 1970
72 // -1: infinite lock, no refresh
73 sal_Int32 nLastChanceToSendRefreshRequest
);
75 void updateLock( const OUString
& rLock
,
76 sal_Int32 nLastChanceToSendRefreshRequest
);
78 void removeLock( const OUString
& rLock
);
87 } // namespace http_dav_ucp
89 #endif // INCLUDED_UCB_SOURCE_UCP_WEBDAV_SERFLOCKSTORE_HXX
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */