PoDoFo 1.2.0
Loading...
Searching...
No Matches
PdfElement.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_ELEMENT_H
6#define PDF_ELEMENT_H
7
8#include "PdfObject.h"
9
10namespace PoDoFo {
11
26class PODOFO_API PdfElement
27{
28public:
29
30 virtual ~PdfElement();
31
34 inline PdfObject& GetObject() { return *m_Object; }
35
40 inline const PdfObject& GetObject() const { return *m_Object; }
41
42 PdfDocument& GetDocument() const;
43
44protected:
46
57
58 PdfElement(const PdfElement& element) = default;
59
60private:
61 PdfElement& operator=(const PdfElement& element) = delete;
62
63private:
64 PdfObject* m_Object;
65};
66
67class PODOFO_API PdfDictionaryElement : public PdfElement
68{
69protected:
74 PdfDictionaryElement(PdfDocument& parent,
75 const PdfName& type = PdfName::Null,
76 const PdfName& subtype = PdfName::Null);
77
83 PdfDictionaryElement(PdfObject& obj);
84
85 PdfDictionaryElement(const PdfDictionaryElement& element) = default;
86
87public:
88 PdfDictionary& GetDictionary();
89 const PdfDictionary& GetDictionary() const;
90};
91
92class PODOFO_API PdfArrayElement : public PdfElement
93{
94protected:
97 PdfArrayElement(PdfDocument& parent);
98
104 PdfArrayElement(PdfObject& obj);
105
106 PdfArrayElement(const PdfArrayElement& element) = default;
107
108public:
109 PdfArray& GetArray();
110 const PdfArray& GetArray() const;
111};
112
113};
114
115#endif // PDF_ELEMENT_H
PdfDocument is the core interface for working with PDF documents.
Definition PdfDocument.h:108
PdfElement is a common base class for all elements in a PDF file.
Definition PdfElement.h:27
PdfObject & GetObject()
Get access to the internal object.
Definition PdfElement.h:34
const PdfObject & GetObject() const
Get access to the internal object This is an overloaded member function.
Definition PdfElement.h:40
This class represents a PDF indirect Object in memory.
Definition PdfObject.h:31
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
PdfDataType
Every PDF datatype that can occur in a PDF file is referenced by an own enum (e.g.
Definition PdfDeclarations.h:152