LibreOffice Module svl (master) 1
msodocumentlockfile.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
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
10#ifndef INCLUDED_SVL_MSODOCUMENTLOCKFILE_HXX
11#define INCLUDED_SVL_MSODOCUMENTLOCKFILE_HXX
12
13#include <svl/svldllapi.h>
15
16#define MSO_WORD_LOCKFILE_SIZE 162
17#define MSO_EXCEL_AND_POWERPOINT_LOCKFILE_SIZE 165
18#define MSO_USERNAME_MAX_LENGTH 52
19
20namespace svt
21{
24{
25private:
26 enum class AppType
27 {
28 Word,
29 Excel,
30 PowerPoint
31 };
32 static AppType getAppType(std::u16string_view sOrigURL);
34
35 virtual void
36 WriteEntryToStream(std::unique_lock<std::mutex>& rGuard, const LockFileEntry& aEntry,
37 const css::uno::Reference<css::io::XOutputStream>& xStream) override;
38
39 virtual css::uno::Reference<css::io::XInputStream>
40 OpenStream(std::unique_lock<std::mutex>& rGuard) override;
41
42 virtual LockFileEntry GetLockDataImpl(std::unique_lock<std::mutex>& rGuard) override;
43
44public:
45 MSODocumentLockFile(std::u16string_view aOrigURL);
46 virtual ~MSODocumentLockFile() override;
47
48 virtual void RemoveFile() override;
49
50 static bool IsMSOSupportedFileFormat(std::u16string_view aURL);
51};
52}
53
54#endif
55
56/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
Generalized class for LO and MSO lockfile handling.
Class implementing reading and writing MSO lockfiles.
#define SVL_DLLPUBLIC
Definition: svldllapi.h:28