10#include "PdfElement.h"
49class PODOFO_API
PdfAction :
public PdfDictionaryElement
52 friend class PdfAnnotationActionBase;
54 friend class PdfActionGoTo;
55 friend class PdfActionGoToR;
56 friend class PdfActionGoToE;
57 friend class PdfActionLaunch;
58 friend class PdfActionThread;
59 friend class PdfActionURI;
60 friend class PdfActionSound;
61 friend class PdfActionMovie;
62 friend class PdfActionHide;
63 friend class PdfActionNamed;
64 friend class PdfActionSubmitForm;
65 friend class PdfActionResetForm;
66 friend class PdfActionImportData;
67 friend class PdfActionJavaScript;
68 friend class PdfActionSetOCGState;
69 friend class PdfActionRendition;
70 friend class PdfActionTrans;
71 friend class PdfActionGoTo3DView;
72 friend class PdfActionRichMediaExecute;
94 template <
typename TAction>
110class PODOFO_API PdfActionGoTo final :
public PdfAction
112 friend class PdfAction;
114 PdfActionGoTo(PdfDocument& doc);
116 PdfActionGoTo(PdfObject& obj);
118 PdfActionGoTo(
const PdfActionGoTo&) =
default;
122class PODOFO_API PdfActionGoToR final :
public PdfAction
124 friend class PdfAction;
126 PdfActionGoToR(PdfDocument& doc);
128 PdfActionGoToR(PdfObject& obj);
130 PdfActionGoToR(
const PdfActionGoToR&) =
default;
134class PODOFO_API PdfActionGoToE final :
public PdfAction
136 friend class PdfAction;
138 PdfActionGoToE(PdfDocument& doc);
140 PdfActionGoToE(PdfObject& obj);
142 PdfActionGoToE(
const PdfActionGoToE&) =
default;
146class PODOFO_API PdfActionLaunch final :
public PdfAction
148 friend class PdfAction;
150 PdfActionLaunch(PdfDocument& doc);
152 PdfActionLaunch(PdfObject& obj);
154 PdfActionLaunch(
const PdfActionLaunch&) =
default;
158class PODOFO_API PdfActionThread final :
public PdfAction
160 friend class PdfAction;
162 PdfActionThread(PdfDocument& doc);
164 PdfActionThread(PdfObject& obj);
166 PdfActionThread(
const PdfActionThread&) =
default;
170class PODOFO_API PdfActionURI final :
public PdfAction
172 friend class PdfAction;
174 PdfActionURI(PdfDocument& doc);
176 PdfActionURI(PdfObject& obj);
178 PdfActionURI(
const PdfActionURI&) =
default;
183 void SetURI(nullable<const PdfString&> uri);
187 nullable<const PdfString&> GetURI()
const;
190class PODOFO_API PdfActionSound final :
public PdfAction
192 friend class PdfAction;
194 PdfActionSound(PdfDocument& doc);
196 PdfActionSound(PdfObject& obj);
198 PdfActionSound(
const PdfActionSound&) =
default;
202class PODOFO_API PdfActionMovie final :
public PdfAction
204 friend class PdfAction;
206 PdfActionMovie(PdfDocument& doc);
208 PdfActionMovie(PdfObject& obj);
210 PdfActionMovie(
const PdfActionMovie&) =
default;
214class PODOFO_API PdfActionHide final :
public PdfAction
216 friend class PdfAction;
218 PdfActionHide(PdfDocument& doc);
220 PdfActionHide(PdfObject& obj);
222 PdfActionHide(
const PdfActionHide&) =
default;
226class PODOFO_API PdfActionNamed final :
public PdfAction
228 friend class PdfAction;
230 PdfActionNamed(PdfDocument& doc);
232 PdfActionNamed(PdfObject& obj);
234 PdfActionNamed(
const PdfActionNamed&) =
default;
238class PODOFO_API PdfActionSubmitForm final :
public PdfAction
240 friend class PdfAction;
242 PdfActionSubmitForm(PdfDocument& doc);
244 PdfActionSubmitForm(PdfObject& obj);
246 PdfActionSubmitForm(
const PdfActionSubmitForm&) =
default;
250class PODOFO_API PdfActionResetForm final :
public PdfAction
252 friend class PdfAction;
254 PdfActionResetForm(PdfDocument& doc);
256 PdfActionResetForm(PdfObject& obj);
258 PdfActionResetForm(
const PdfActionResetForm&) =
default;
262class PODOFO_API PdfActionImportData final :
public PdfAction
264 friend class PdfAction;
266 PdfActionImportData(PdfDocument& doc);
268 PdfActionImportData(PdfObject& obj);
270 PdfActionImportData(
const PdfActionImportData&) =
default;
274class PODOFO_API PdfActionJavaScript final :
public PdfAction
276 friend class PdfAction;
278 PdfActionJavaScript(PdfDocument& doc);
280 PdfActionJavaScript(PdfObject& obj);
282 PdfActionJavaScript(
const PdfActionJavaScript&) =
default;
286 void SetScript(nullable<const PdfString&> script);
290 nullable<const PdfString&> GetScript()
const;
293class PODOFO_API PdfActionSetOCGState final :
public PdfAction
295 friend class PdfAction;
297 PdfActionSetOCGState(PdfDocument& doc);
299 PdfActionSetOCGState(PdfObject& obj);
301 PdfActionSetOCGState(
const PdfActionSetOCGState&) =
default;
305class PODOFO_API PdfActionRendition final :
public PdfAction
307 friend class PdfAction;
309 PdfActionRendition(PdfDocument& doc);
311 PdfActionRendition(PdfObject& obj);
313 PdfActionRendition(
const PdfActionRendition&) =
default;
317class PODOFO_API PdfActionTrans :
public PdfAction
319 friend class PdfAction;
321 PdfActionTrans(PdfDocument& doc);
323 PdfActionTrans(PdfObject& obj);
325 PdfActionTrans(
const PdfActionTrans&) =
default;
329class PODOFO_API PdfActionGoTo3DView final :
public PdfAction
331 friend class PdfAction;
333 PdfActionGoTo3DView(PdfDocument& doc);
335 PdfActionGoTo3DView(PdfObject& obj);
337 PdfActionGoTo3DView(
const PdfActionGoTo3DView&) =
default;
341class PODOFO_API PdfActionRichMediaExecute final :
public PdfAction
343 friend class PdfAction;
345 PdfActionRichMediaExecute(PdfDocument& doc);
347 PdfActionRichMediaExecute(PdfObject& obj);
349 PdfActionRichMediaExecute(
const PdfActionRichMediaExecute&) =
default;
353template<
typename TAction>
356 if (std::is_same_v<TAction, PdfActionGoTo>)
357 return PdfActionType::GoTo;
358 else if (std::is_same_v<TAction, PdfActionGoToR>)
359 return PdfActionType::GoToR;
360 else if (std::is_same_v<TAction, PdfActionGoToE>)
361 return PdfActionType::GoToE;
362 else if (std::is_same_v<TAction, PdfActionLaunch>)
363 return PdfActionType::Launch;
364 else if (std::is_same_v<TAction, PdfActionThread>)
365 return PdfActionType::Thread;
366 else if (std::is_same_v<TAction, PdfActionURI>)
367 return PdfActionType::URI;
368 else if (std::is_same_v<TAction, PdfActionSound>)
369 return PdfActionType::Sound;
370 else if (std::is_same_v<TAction, PdfActionMovie>)
371 return PdfActionType::Movie;
372 else if (std::is_same_v<TAction, PdfActionHide>)
373 return PdfActionType::Hide;
374 else if (std::is_same_v<TAction, PdfActionNamed>)
375 return PdfActionType::Named;
376 else if (std::is_same_v<TAction, PdfActionSubmitForm>)
377 return PdfActionType::SubmitForm;
378 else if (std::is_same_v<TAction, PdfActionResetForm>)
379 return PdfActionType::ResetForm;
380 else if (std::is_same_v<TAction, PdfActionImportData>)
381 return PdfActionType::ImportData;
382 else if (std::is_same_v<TAction, PdfActionJavaScript>)
383 return PdfActionType::JavaScript;
384 else if (std::is_same_v<TAction, PdfActionSetOCGState>)
385 return PdfActionType::SetOCGState;
386 else if (std::is_same_v<TAction, PdfActionRendition>)
387 return PdfActionType::Rendition;
388 else if (std::is_same_v<TAction, PdfActionTrans>)
389 return PdfActionType::Trans;
390 else if (std::is_same_v<TAction, PdfActionGoTo3DView>)
391 return PdfActionType::GoTo3DView;
392 else if (std::is_same_v<TAction, PdfActionRichMediaExecute>)
393 return PdfActionType::RichMediaExecute;
395 return PdfActionType::Unknown;
This file should be included as the FIRST file in every header of PoDoFo lib.
An action that can be performed in a PDF document.
Definition PdfAction.h:50
PdfActionType GetType() const
Get the type of this action.
Definition PdfAction.h:85
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
This class represents a PDF indirect Object in memory.
Definition PdfObject.h:31
A PDF outline item has a title and a destination.
Definition PdfOutlines.h:33
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
@ Create
Create a new file or truncate existing one for writing/reading.
PdfActionType
The type of the action.
Definition PdfAction.h:25