PoDoFo 1.2.0
Loading...
Searching...
No Matches
PdfDataContainer.h
1// SPDX-FileCopyrightText: 2006 Dominik Seichter <domseichter@web.de>
2// SPDX-FileCopyrightText: 2020 Francesco Pretto <ceztko@gmail.com>
3// SPDX-License-Identifier: LGPL-2.0-or-later OR MPL-2.0
4
5#ifndef PDF_CONTAINER_DATATYPE_H
6#define PDF_CONTAINER_DATATYPE_H
7
8#include "PdfBaseDataTypes.h"
9#include "PdfObject.h"
10
11namespace PoDoFo {
12
13class PdfDocument;
14
17class PODOFO_API PdfDataContainer : public PdfDataProvider<PdfDataContainer>
18{
19 friend class PdfObject;
20 friend class PdfArray;
21 friend class PdfDictionary;
22
23private:
29
30public:
31 virtual ~PdfDataContainer();
32
36 inline const PdfObject* GetOwner() const { return m_Owner; }
37 inline PdfObject* GetOwner() { return m_Owner; }
38
45 const PdfStatefulEncrypt* encrypt, charbuff& buffer) const = 0;
46
47protected:
48 virtual void resetDirty() = 0;
49 PdfObject* GetIndirectObject(const PdfReference& reference) const;
50 PdfDocument* GetObjectDocument();
51 void SetDirty();
52 bool IsIndirectReferenceAllowed(const PdfObject& obj);
53 virtual void setChildrenParent() = 0;
54 void AssertMutable() const;
55
56private:
57 void SetOwner(PdfObject& owner);
58 void ResetDirty();
59
60private:
61 PdfObject* m_Owner;
62};
63
64class PODOFO_API PdfIndirectIterableBase
65{
66 template <typename TObject, typename TListIterator>
68
69 template <typename TObject, typename TMapIterator>
71
72private:
73 PdfIndirectIterableBase();
74
75 PdfIndirectIterableBase(PdfDataContainer& container);
76
77protected:
78 static PdfObject* GetObject(const PdfIndirectObjectList& list, const PdfReference& ref);
79
80 PdfIndirectObjectList* GetObjects() const { return m_Objects; }
81
82private:
83 PdfIndirectObjectList* m_Objects;
84};
85
86}
87
88#endif // PDF_CONTAINER_DATATYPE_H
An interface for writing blocks of data to a data source.
Definition OutputStream.h:15
Helper class to iterate through array indirect objects.
Definition PdfArray.h:19
This class represents a PdfArray Use it for all arrays that are written to a PDF file.
Definition PdfArray.h:76
A PdfDataProvider object with a PdfObject owner, specialized in holding objects.
Definition PdfDataContainer.h:18
virtual void Write(OutputStream &stream, PdfWriteFlags writeMode, const PdfStatefulEncrypt *encrypt, charbuff &buffer) const =0
Write the complete datatype to a file.
const PdfObject * GetOwner() const
Definition PdfDataContainer.h:36
An helper class to inherit to provide common serialization methods.
Definition PdfBaseDataTypes.h:36
Helper class to iterate through indirect objects.
Definition PdfDictionary.h:18
The PDF dictionary data type of PoDoFo (inherits from PdfDataContainer, the base class for such repre...
Definition PdfDictionary.h:77
PdfDocument is the core interface for working with PDF documents.
Definition PdfDocument.h:108
A list of PdfObjects that constitutes the indirect object list of the document The PdfParser will rea...
Definition PdfIndirectObjectList.h:28
This class represents a PDF indirect Object in memory.
Definition PdfObject.h:31
A reference is a pointer to a object in the PDF file of the form "4 0 R", where 4 is the object numbe...
Definition PdfReference.h:20
Convenient type for char array storage and/or buffer with std::string compatibility.
Definition basetypes.h:30
All classes, functions, types and enums of PoDoFo are members of these namespace.
Definition basetypes.h:13
PdfWriteFlags
Specify additional options for writing the PDF.
Definition PdfDeclarations.h:136