12 #include "PdfElement.h"
53 class PODOFO_API
PdfAction :
public PdfDictionaryElement
56 friend class PdfAnnotationActionBase;
58 friend class PdfActionGoTo;
59 friend class PdfActionGoToR;
60 friend class PdfActionGoToE;
61 friend class PdfActionLaunch;
62 friend class PdfActionThread;
63 friend class PdfActionURI;
64 friend class PdfActionSound;
65 friend class PdfActionMovie;
66 friend class PdfActionHide;
67 friend class PdfActionNamed;
68 friend class PdfActionSubmitForm;
69 friend class PdfActionResetForm;
70 friend class PdfActionImportData;
71 friend class PdfActionJavaScript;
72 friend class PdfActionSetOCGState;
73 friend class PdfActionRendition;
74 friend class PdfActionTrans;
75 friend class PdfActionGoTo3DView;
76 friend class PdfActionRichMediaExecute;
92 static bool TryCreateFromObject(
PdfObject& obj, std::unique_ptr<PdfAction>& action);
99 template <
typename TAction>
116 class PODOFO_API PdfActionGoTo final :
public PdfAction
118 friend class PdfAction;
120 PdfActionGoTo(PdfDocument& doc);
122 PdfActionGoTo(PdfObject& obj);
124 PdfActionGoTo(
const PdfActionGoTo&) =
default;
128 class PODOFO_API PdfActionGoToR final :
public PdfAction
130 friend class PdfAction;
132 PdfActionGoToR(PdfDocument& doc);
134 PdfActionGoToR(PdfObject& obj);
136 PdfActionGoToR(
const PdfActionGoToR&) =
default;
140 class PODOFO_API PdfActionGoToE final :
public PdfAction
142 friend class PdfAction;
144 PdfActionGoToE(PdfDocument& doc);
146 PdfActionGoToE(PdfObject& obj);
148 PdfActionGoToE(
const PdfActionGoToE&) =
default;
152 class PODOFO_API PdfActionLaunch final :
public PdfAction
154 friend class PdfAction;
156 PdfActionLaunch(PdfDocument& doc);
158 PdfActionLaunch(PdfObject& obj);
160 PdfActionLaunch(
const PdfActionLaunch&) =
default;
164 class PODOFO_API PdfActionThread final :
public PdfAction
166 friend class PdfAction;
168 PdfActionThread(PdfDocument& doc);
170 PdfActionThread(PdfObject& obj);
172 PdfActionThread(
const PdfActionThread&) =
default;
176 class PODOFO_API PdfActionURI final :
public PdfAction
178 friend class PdfAction;
180 PdfActionURI(PdfDocument& doc);
182 PdfActionURI(PdfObject& obj);
184 PdfActionURI(
const PdfActionURI&) =
default;
190 void SetURI(nullable<const PdfString&> uri);
195 nullable<const PdfString&> GetURI()
const;
198 class PODOFO_API PdfActionSound final :
public PdfAction
200 friend class PdfAction;
202 PdfActionSound(PdfDocument& doc);
204 PdfActionSound(PdfObject& obj);
206 PdfActionSound(
const PdfActionSound&) =
default;
210 class PODOFO_API PdfActionMovie final :
public PdfAction
212 friend class PdfAction;
214 PdfActionMovie(PdfDocument& doc);
216 PdfActionMovie(PdfObject& obj);
218 PdfActionMovie(
const PdfActionMovie&) =
default;
222 class PODOFO_API PdfActionHide final :
public PdfAction
224 friend class PdfAction;
226 PdfActionHide(PdfDocument& doc);
228 PdfActionHide(PdfObject& obj);
230 PdfActionHide(
const PdfActionHide&) =
default;
234 class PODOFO_API PdfActionNamed final :
public PdfAction
236 friend class PdfAction;
238 PdfActionNamed(PdfDocument& doc);
240 PdfActionNamed(PdfObject& obj);
242 PdfActionNamed(
const PdfActionNamed&) =
default;
246 class PODOFO_API PdfActionSubmitForm final :
public PdfAction
248 friend class PdfAction;
250 PdfActionSubmitForm(PdfDocument& doc);
252 PdfActionSubmitForm(PdfObject& obj);
254 PdfActionSubmitForm(
const PdfActionSubmitForm&) =
default;
258 class PODOFO_API PdfActionResetForm final :
public PdfAction
260 friend class PdfAction;
262 PdfActionResetForm(PdfDocument& doc);
264 PdfActionResetForm(PdfObject& obj);
266 PdfActionResetForm(
const PdfActionResetForm&) =
default;
270 class PODOFO_API PdfActionImportData final :
public PdfAction
272 friend class PdfAction;
274 PdfActionImportData(PdfDocument& doc);
276 PdfActionImportData(PdfObject& obj);
278 PdfActionImportData(
const PdfActionImportData&) =
default;
282 class PODOFO_API PdfActionJavaScript final :
public PdfAction
284 friend class PdfAction;
286 PdfActionJavaScript(PdfDocument& doc);
288 PdfActionJavaScript(PdfObject& obj);
290 PdfActionJavaScript(
const PdfActionJavaScript&) =
default;
292 void SetScript(nullable<const PdfString&> script);
294 nullable<const PdfString&> GetScript()
const;
297 class PODOFO_API PdfActionSetOCGState final :
public PdfAction
299 friend class PdfAction;
301 PdfActionSetOCGState(PdfDocument& doc);
303 PdfActionSetOCGState(PdfObject& obj);
305 PdfActionSetOCGState(
const PdfActionSetOCGState&) =
default;
309 class PODOFO_API PdfActionRendition final :
public PdfAction
311 friend class PdfAction;
313 PdfActionRendition(PdfDocument& doc);
315 PdfActionRendition(PdfObject& obj);
317 PdfActionRendition(
const PdfActionRendition&) =
default;
321 class PODOFO_API PdfActionTrans :
public PdfAction
323 friend class PdfAction;
325 PdfActionTrans(PdfDocument& doc);
327 PdfActionTrans(PdfObject& obj);
329 PdfActionTrans(
const PdfActionTrans&) =
default;
333 class PODOFO_API PdfActionGoTo3DView final :
public PdfAction
335 friend class PdfAction;
337 PdfActionGoTo3DView(PdfDocument& doc);
339 PdfActionGoTo3DView(PdfObject& obj);
341 PdfActionGoTo3DView(
const PdfActionGoTo3DView&) =
default;
345 class PODOFO_API PdfActionRichMediaExecute final :
public PdfAction
347 friend class PdfAction;
349 PdfActionRichMediaExecute(PdfDocument& doc);
351 PdfActionRichMediaExecute(PdfObject& obj);
353 PdfActionRichMediaExecute(
const PdfActionRichMediaExecute&) =
default;
357 template<
typename TAction>
360 if (std::is_same_v<TAction, PdfActionGoTo>)
361 return PdfActionType::GoTo;
362 else if (std::is_same_v<TAction, PdfActionGoToR>)
363 return PdfActionType::GoToR;
364 else if (std::is_same_v<TAction, PdfActionGoToE>)
365 return PdfActionType::GoToE;
366 else if (std::is_same_v<TAction, PdfActionLaunch>)
367 return PdfActionType::Launch;
368 else if (std::is_same_v<TAction, PdfActionThread>)
369 return PdfActionType::Thread;
370 else if (std::is_same_v<TAction, PdfActionURI>)
371 return PdfActionType::URI;
372 else if (std::is_same_v<TAction, PdfActionSound>)
373 return PdfActionType::Sound;
374 else if (std::is_same_v<TAction, PdfActionMovie>)
375 return PdfActionType::Movie;
376 else if (std::is_same_v<TAction, PdfActionHide>)
377 return PdfActionType::Hide;
378 else if (std::is_same_v<TAction, PdfActionNamed>)
379 return PdfActionType::Named;
380 else if (std::is_same_v<TAction, PdfActionSubmitForm>)
381 return PdfActionType::SubmitForm;
382 else if (std::is_same_v<TAction, PdfActionResetForm>)
383 return PdfActionType::ResetForm;
384 else if (std::is_same_v<TAction, PdfActionImportData>)
385 return PdfActionType::ImportData;
386 else if (std::is_same_v<TAction, PdfActionJavaScript>)
387 return PdfActionType::JavaScript;
388 else if (std::is_same_v<TAction, PdfActionSetOCGState>)
389 return PdfActionType::SetOCGState;
390 else if (std::is_same_v<TAction, PdfActionRendition>)
391 return PdfActionType::Rendition;
392 else if (std::is_same_v<TAction, PdfActionTrans>)
393 return PdfActionType::Trans;
394 else if (std::is_same_v<TAction, PdfActionGoTo3DView>)
395 return PdfActionType::GoTo3DView;
396 else if (std::is_same_v<TAction, PdfActionRichMediaExecute>)
397 return PdfActionType::RichMediaExecute;
399 return PdfActionType::Unknown;
SPDX-FileCopyrightText: (C) 2005 Dominik Seichter domseichter@web.de SPDX-FileCopyrightText: (C) 2020...
An action that can be performed in a PDF document.
Definition: PdfAction.h:54
PdfActionType GetType() const
Get the type of this action.
Definition: PdfAction.h:90
The PDF dictionary data type of PoDoFo (inherits from PdfDataContainer, the base class for such repre...
Definition: PdfDictionary.h:82
PdfDocument is the core interface for working with PDF documents.
Definition: PdfDocument.h:108
This class represents a PDF indirect Object in memory.
Definition: PdfObject.h:35
A PDF outline item has an title and a destination.
Definition: PdfOutlines.h:39
SPDX-FileCopyrightText: (C) 2022 Francesco Pretto ceztko@gmail.com SPDX-License-Identifier: LGPL-2....
Definition: basetypes.h:16
PdfActionType
The type of the action.
Definition: PdfAction.h:28
@ Create
Create a new file or truncate existing one for writing/reading.