7#ifndef PDF_ANNOTATION_TYPES_H
8#define PDF_ANNOTATION_TYPES_H
10#include "PdfAnnotationActionBase.h"
11#include "PdfFileSpec.h"
12#include "PdfDestination.h"
13#include "PdfDictionary.h"
18 class PdfQuadPointsProvider
20 friend class PdfAnnotationLink;
21 friend class PdfAnnotationTextMarkupBase;
22 friend class PdfAnnotationRedact;
35 nullable<const PdfArray&> GetQuadPoints()
const
37 auto& dict =
static_cast<const T&
>(*this).GetDictionary();
39 auto obj = dict.FindKey(
"QuadPoints");
40 if (obj ==
nullptr || !obj->TryGetArray(arr))
55 void SetQuadPoints(nullable<const PdfArray&> quadPoints)
57 auto& dict =
static_cast<T&
>(*this).GetDictionary();
58 if (quadPoints ==
nullptr)
59 dict.RemoveKey(
"QuadPoints");
61 dict.AddKey(
"QuadPoints"_n, *quadPoints);
65 class PODOFO_API PdfAnnotationTextMarkupBase :
public PdfAnnotation,
public PdfQuadPointsProvider<PdfAnnotationTextMarkupBase>
67 friend class PdfAnnotationSquiggly;
68 friend class PdfAnnotationHighlight;
69 friend class PdfAnnotationStrikeOut;
70 friend class PdfAnnotationUnderline;
72 PdfAnnotationTextMarkupBase(PdfPage& page, PdfAnnotationType annotType,
const Rect& rect);
73 PdfAnnotationTextMarkupBase(PdfObject& obj, PdfAnnotationType annotType);
77 class PODOFO_API PdfAnnotationCaret final :
public PdfAnnotation
79 friend class PdfAnnotation;
81 PdfAnnotationCaret(PdfPage& page,
const Rect& rect);
82 PdfAnnotationCaret(PdfObject& obj);
86 class PODOFO_API PdfAnnotationFileAttachment final :
public PdfAnnotation
88 friend class PdfAnnotation;
90 PdfAnnotationFileAttachment(PdfPage& page,
const Rect& rect);
91 PdfAnnotationFileAttachment(PdfObject& obj);
101 void SetFileAttachment(
const nullable<PdfFileSpec&>& fileSpec);
109 nullable<PdfFileSpec&> GetFileAttachment();
110 nullable<const PdfFileSpec&> GetFileAttachment()
const;
113 nullable<PdfFileSpec&> getFileAttachment();
116 nullable<std::unique_ptr<PdfFileSpec>> m_FileSpec;
119 class PODOFO_API PdfAnnotationFreeText final :
public PdfAnnotation
121 friend class PdfAnnotation;
123 PdfAnnotationFreeText(PdfPage& page,
const Rect& rect);
124 PdfAnnotationFreeText(PdfObject& obj);
127 class PODOFO_API PdfAnnotationHighlight final :
public PdfAnnotationTextMarkupBase
129 friend class PdfAnnotation;
131 PdfAnnotationHighlight(PdfPage& page,
const Rect& rect);
132 PdfAnnotationHighlight(PdfObject& obj);
135 class PODOFO_API PdfAnnotationInk final :
public PdfAnnotation
137 friend class PdfAnnotation;
139 PdfAnnotationInk(PdfPage& page,
const Rect& rect);
140 PdfAnnotationInk(PdfObject& obj);
143 class PODOFO_API PdfAnnotationLine final :
public PdfAnnotation
145 friend class PdfAnnotation;
147 PdfAnnotationLine(PdfPage& page,
const Rect& rect);
148 PdfAnnotationLine(PdfObject& obj);
151 class PODOFO_API PdfAnnotationLink final :
public PdfAnnotationActionBase,
public PdfQuadPointsProvider<PdfAnnotationLink>
153 friend class PdfAnnotation;
155 PdfAnnotationLink(PdfPage& page,
const Rect& rect);
156 PdfAnnotationLink(PdfObject& obj);
163 void SetDestination(nullable<const PdfDestination&> destination);
170 nullable<PdfDestination&> GetDestination();
171 nullable<const PdfDestination&> GetDestination()
const;
174 nullable<PdfDestination&> getDestination();
175 void onActionSet()
override;
178 nullable<std::unique_ptr<PdfDestination>> m_Destination;
181 class PODOFO_API PdfAnnotationModel3D final :
public PdfAnnotation
183 friend class PdfAnnotation;
185 PdfAnnotationModel3D(PdfPage& page,
const Rect& rect);
186 PdfAnnotationModel3D(PdfObject& obj);
189 class PODOFO_API PdfAnnotationMovie final :
public PdfAnnotation
191 friend class PdfAnnotation;
193 PdfAnnotationMovie(PdfPage& page,
const Rect& rect);
194 PdfAnnotationMovie(PdfObject& obj);
197 class PODOFO_API PdfAnnotationPolygon final :
public PdfAnnotation
199 friend class PdfAnnotation;
201 PdfAnnotationPolygon(PdfPage& page,
const Rect& rect);
202 PdfAnnotationPolygon(PdfObject& obj);
205 class PODOFO_API PdfAnnotationPolyLine final :
public PdfAnnotation
207 friend class PdfAnnotation;
209 PdfAnnotationPolyLine(PdfPage& page,
const Rect& rect);
210 PdfAnnotationPolyLine(PdfObject& obj);
213 class PODOFO_API PdfAnnotationPopup final :
public PdfAnnotation
215 friend class PdfAnnotation;
217 PdfAnnotationPopup(PdfPage& page,
const Rect& rect);
218 PdfAnnotationPopup(PdfObject& obj);
224 void SetOpen(
const nullable<bool>& value);
230 bool GetOpen()
const;
233 class PODOFO_API PdfAnnotationPrinterMark final :
public PdfAnnotation
235 friend class PdfAnnotation;
237 PdfAnnotationPrinterMark(PdfPage& page,
const Rect& rect);
238 PdfAnnotationPrinterMark(PdfObject& obj);
241 class PODOFO_API PdfAnnotationScreen final :
242 public PdfAnnotationActionBase,
243 public PdfAppearanceCharacteristicsProvider<PdfAnnotationScreen>
245 friend class PdfAnnotation;
247 PdfAnnotationScreen(PdfPage& page,
const Rect& rect);
248 PdfAnnotationScreen(PdfObject& obj);
251 class PODOFO_API PdfAnnotationSquiggly final :
public PdfAnnotationTextMarkupBase
253 friend class PdfAnnotation;
255 PdfAnnotationSquiggly(PdfPage& page,
const Rect& rect);
256 PdfAnnotationSquiggly(PdfObject& obj);
260 class PODOFO_API PdfAnnotationStrikeOut final :
public PdfAnnotationTextMarkupBase
262 friend class PdfAnnotation;
264 PdfAnnotationStrikeOut(PdfPage& page,
const Rect& rect);
265 PdfAnnotationStrikeOut(PdfObject& obj);
268 class PODOFO_API PdfAnnotationSound final :
public PdfAnnotation
270 friend class PdfAnnotation;
272 PdfAnnotationSound(PdfPage& page,
const Rect& rect);
273 PdfAnnotationSound(PdfObject& obj);
276 class PODOFO_API PdfAnnotationSquare final :
public PdfAnnotation
278 friend class PdfAnnotation;
280 PdfAnnotationSquare(PdfPage& page,
const Rect& rect);
281 PdfAnnotationSquare(PdfObject& obj);
284 class PODOFO_API PdfAnnotationCircle final :
public PdfAnnotation
286 friend class PdfAnnotation;
288 PdfAnnotationCircle(PdfPage& page,
const Rect& rect);
289 PdfAnnotationCircle(PdfObject& obj);
292 class PODOFO_API PdfAnnotationStamp final :
public PdfAnnotation
294 friend class PdfAnnotation;
296 PdfAnnotationStamp(PdfPage& page,
const Rect& rect);
297 PdfAnnotationStamp(PdfObject& obj);
300 class PODOFO_API PdfAnnotationText final :
public PdfAnnotation
302 friend class PdfAnnotation;
304 PdfAnnotationText(PdfPage& page,
const Rect& rect);
305 PdfAnnotationText(PdfObject& obj);
311 void SetOpen(
const nullable<bool>& value);
317 bool GetOpen()
const;
320 class PODOFO_API PdfAnnotationTrapNet final :
public PdfAnnotation
322 friend class PdfAnnotation;
324 PdfAnnotationTrapNet(PdfPage& page,
const Rect& rect);
325 PdfAnnotationTrapNet(PdfObject& obj);
328 class PODOFO_API PdfAnnotationUnderline final :
public PdfAnnotationTextMarkupBase
330 friend class PdfAnnotation;
332 PdfAnnotationUnderline(PdfPage& page,
const Rect& rect);
333 PdfAnnotationUnderline(PdfObject& obj);
337 class PODOFO_API PdfAnnotationWatermark final :
public PdfAnnotation
339 friend class PdfAnnotation;
341 PdfAnnotationWatermark(PdfPage& page,
const Rect& rect);
342 PdfAnnotationWatermark(PdfObject& obj);
345 class PODOFO_API PdfAnnotationWebMedia final :
public PdfAnnotation
347 friend class PdfAnnotation;
349 PdfAnnotationWebMedia(PdfPage& page,
const Rect& rect);
350 PdfAnnotationWebMedia(PdfObject& obj);
353 class PODOFO_API PdfAnnotationRedact final :
public PdfAnnotation,
public PdfQuadPointsProvider<PdfAnnotationRedact>
355 friend class PdfAnnotation;
357 PdfAnnotationRedact(PdfPage& page,
const Rect& rect);
358 PdfAnnotationRedact(PdfObject& obj);
361 class PODOFO_API PdfAnnotationProjection final :
public PdfAnnotation
363 friend class PdfAnnotation;
365 PdfAnnotationProjection(PdfPage& page,
const Rect& rect);
366 PdfAnnotationProjection(PdfObject& obj);
369 class PODOFO_API PdfAnnotationRichMedia final :
public PdfAnnotation
371 friend class PdfAnnotation;
373 PdfAnnotationRichMedia(PdfPage& page,
const Rect& rect);
374 PdfAnnotationRichMedia(PdfObject& obj);
SPDX-FileCopyrightText: (C) 2022 Francesco Pretto ceztko@gmail.com SPDX-License-Identifier: LGPL-2....
Definition basetypes.h:16