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
27class PODOFO_API PdfElement
28{
29public:
30
31 virtual ~PdfElement();
32
36 inline PdfObject& GetObject() { return *m_Object; }
37
43 inline const PdfObject& GetObject() const { return *m_Object; }
44
45 PdfDocument& GetDocument() const;
46
47protected:
49
61
62 PdfElement(const PdfElement& element) = default;
63
64private:
65 PdfElement& operator=(const PdfElement& element) = delete;
66
67private:
68 PdfObject* m_Object;
69};
70
71class PODOFO_API PdfDictionaryElement : public PdfElement
72{
73protected:
79 PdfDictionaryElement(PdfDocument& parent,
80 const PdfName& type = PdfName::Null,
81 const PdfName& subtype = PdfName::Null);
82
89 PdfDictionaryElement(PdfObject& obj);
90
91 PdfDictionaryElement(const PdfDictionaryElement& element) = default;
92
93public:
94 PdfDictionary& GetDictionary();
95 const PdfDictionary& GetDictionary() const;
96};
97
98class PODOFO_API PdfArrayElement : public PdfElement
99{
100protected:
104 PdfArrayElement(PdfDocument& parent);
105
112 PdfArrayElement(PdfObject& obj);
113
114 PdfArrayElement(const PdfArrayElement& element) = default;
115
116public:
117 PdfArray& GetArray();
118 const PdfArray& GetArray() const;
119};
120
121};
122
123#endif // PDF_ELEMENT_H
PdfDocument is the core interface for working with PDF documents.
Definition PdfDocument.h:109
PdfElement is a common base class for all elements in a PDF file.
Definition PdfElement.h:28
PdfObject & GetObject()
Get access to the internal object.
Definition PdfElement.h:36
const PdfObject & GetObject() const
Get access to the internal object This is an overloaded member function.
Definition PdfElement.h:43
This class represents a PDF indirect Object in memory.
Definition PdfObject.h:33
Convenient type for char array storage and/or buffer with std::string compatibility.
Definition basetypes.h:35
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:165