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/.
12 #include <sal/types.h>
13 #include <string_view>
17 /// Allows creating, updating and writing PDF objects in a container.
18 class SAL_NO_VTABLE SAL_DLLPUBLIC_RTTI PDFObjectContainer
21 /* adds an entry to m_aObjects and returns its index+1,
22 * sets the offset to ~0
24 virtual sal_Int32
createObject() = 0;
25 /* sets the offset of object n to the current position of output file+1
27 virtual bool updateObject(sal_Int32 n
) = 0;
29 // Write pBuffer to the end of the output.
30 virtual bool writeBufferBytes(const void* pBuffer
, sal_uInt64 nBytes
) = 0;
32 // Utility method, reduces verbosity at call sites
33 bool writeBuffer(std::string_view aBuffer
)
35 return writeBufferBytes(aBuffer
.data(), aBuffer
.size());
38 virtual void checkAndEnableStreamEncryption(sal_Int32 nObject
) = 0;
40 virtual void disableStreamEncryption() = 0;
43 ~PDFObjectContainer() noexcept
= default;
47 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */