10#include "PdfElement.h"
51class PODOFO_API
PdfAction :
public PdfDictionaryElement
54 friend class PdfAnnotationActionBase;
56 friend class PdfActionGoTo;
57 friend class PdfActionGoToR;
58 friend class PdfActionGoToE;
59 friend class PdfActionLaunch;
60 friend class PdfActionThread;
61 friend class PdfActionURI;
62 friend class PdfActionSound;
63 friend class PdfActionMovie;
64 friend class PdfActionHide;
65 friend class PdfActionNamed;
66 friend class PdfActionSubmitForm;
67 friend class PdfActionResetForm;
68 friend class PdfActionImportData;
69 friend class PdfActionJavaScript;
70 friend class PdfActionSetOCGState;
71 friend class PdfActionRendition;
72 friend class PdfActionTrans;
73 friend class PdfActionGoTo3DView;
74 friend class PdfActionRichMediaExecute;
97 template <
typename TAction>
114class PODOFO_API PdfActionGoTo final :
public PdfAction
116 friend class PdfAction;
118 PdfActionGoTo(PdfDocument& doc);
120 PdfActionGoTo(PdfObject& obj);
122 PdfActionGoTo(
const PdfActionGoTo&) =
default;
126class PODOFO_API PdfActionGoToR final :
public PdfAction
128 friend class PdfAction;
130 PdfActionGoToR(PdfDocument& doc);
132 PdfActionGoToR(PdfObject& obj);
134 PdfActionGoToR(
const PdfActionGoToR&) =
default;
138class PODOFO_API PdfActionGoToE final :
public PdfAction
140 friend class PdfAction;
142 PdfActionGoToE(PdfDocument& doc);
144 PdfActionGoToE(PdfObject& obj);
146 PdfActionGoToE(
const PdfActionGoToE&) =
default;
150class PODOFO_API PdfActionLaunch final :
public PdfAction
152 friend class PdfAction;
154 PdfActionLaunch(PdfDocument& doc);
156 PdfActionLaunch(PdfObject& obj);
158 PdfActionLaunch(
const PdfActionLaunch&) =
default;
162class PODOFO_API PdfActionThread final :
public PdfAction
164 friend class PdfAction;
166 PdfActionThread(PdfDocument& doc);
168 PdfActionThread(PdfObject& obj);
170 PdfActionThread(
const PdfActionThread&) =
default;
174class PODOFO_API PdfActionURI final :
public PdfAction
176 friend class PdfAction;
178 PdfActionURI(PdfDocument& doc);
180 PdfActionURI(PdfObject& obj);
182 PdfActionURI(
const PdfActionURI&) =
default;
188 void SetURI(nullable<const PdfString&> uri);
193 nullable<const PdfString&> GetURI()
const;
196class PODOFO_API PdfActionSound final :
public PdfAction
198 friend class PdfAction;
200 PdfActionSound(PdfDocument& doc);
202 PdfActionSound(PdfObject& obj);
204 PdfActionSound(
const PdfActionSound&) =
default;
208class PODOFO_API PdfActionMovie final :
public PdfAction
210 friend class PdfAction;
212 PdfActionMovie(PdfDocument& doc);
214 PdfActionMovie(PdfObject& obj);
216 PdfActionMovie(
const PdfActionMovie&) =
default;
220class PODOFO_API PdfActionHide final :
public PdfAction
222 friend class PdfAction;
224 PdfActionHide(PdfDocument& doc);
226 PdfActionHide(PdfObject& obj);
228 PdfActionHide(
const PdfActionHide&) =
default;
232class PODOFO_API PdfActionNamed final :
public PdfAction
234 friend class PdfAction;
236 PdfActionNamed(PdfDocument& doc);
238 PdfActionNamed(PdfObject& obj);
240 PdfActionNamed(
const PdfActionNamed&) =
default;
244class PODOFO_API PdfActionSubmitForm final :
public PdfAction
246 friend class PdfAction;
248 PdfActionSubmitForm(PdfDocument& doc);
250 PdfActionSubmitForm(PdfObject& obj);
252 PdfActionSubmitForm(
const PdfActionSubmitForm&) =
default;
256class PODOFO_API PdfActionResetForm final :
public PdfAction
258 friend class PdfAction;
260 PdfActionResetForm(PdfDocument& doc);
262 PdfActionResetForm(PdfObject& obj);
264 PdfActionResetForm(
const PdfActionResetForm&) =
default;
268class PODOFO_API PdfActionImportData final :
public PdfAction
270 friend class PdfAction;
272 PdfActionImportData(PdfDocument& doc);
274 PdfActionImportData(PdfObject& obj);
276 PdfActionImportData(
const PdfActionImportData&) =
default;
280class PODOFO_API PdfActionJavaScript final :
public PdfAction
282 friend class PdfAction;
284 PdfActionJavaScript(PdfDocument& doc);
286 PdfActionJavaScript(PdfObject& obj);
288 PdfActionJavaScript(
const PdfActionJavaScript&) =
default;
290 void SetScript(nullable<const PdfString&> script);
292 nullable<const PdfString&> GetScript()
const;
295class PODOFO_API PdfActionSetOCGState final :
public PdfAction
297 friend class PdfAction;
299 PdfActionSetOCGState(PdfDocument& doc);
301 PdfActionSetOCGState(PdfObject& obj);
303 PdfActionSetOCGState(
const PdfActionSetOCGState&) =
default;
307class PODOFO_API PdfActionRendition final :
public PdfAction
309 friend class PdfAction;
311 PdfActionRendition(PdfDocument& doc);
313 PdfActionRendition(PdfObject& obj);
315 PdfActionRendition(
const PdfActionRendition&) =
default;
319class PODOFO_API PdfActionTrans :
public PdfAction
321 friend class PdfAction;
323 PdfActionTrans(PdfDocument& doc);
325 PdfActionTrans(PdfObject& obj);
327 PdfActionTrans(
const PdfActionTrans&) =
default;
331class PODOFO_API PdfActionGoTo3DView final :
public PdfAction
333 friend class PdfAction;
335 PdfActionGoTo3DView(PdfDocument& doc);
337 PdfActionGoTo3DView(PdfObject& obj);
339 PdfActionGoTo3DView(
const PdfActionGoTo3DView&) =
default;
343class PODOFO_API PdfActionRichMediaExecute final :
public PdfAction
345 friend class PdfAction;
347 PdfActionRichMediaExecute(PdfDocument& doc);
349 PdfActionRichMediaExecute(PdfObject& obj);
351 PdfActionRichMediaExecute(
const PdfActionRichMediaExecute&) =
default;
355template<
typename TAction>
358 if (std::is_same_v<TAction, PdfActionGoTo>)
359 return PdfActionType::GoTo;
360 else if (std::is_same_v<TAction, PdfActionGoToR>)
361 return PdfActionType::GoToR;
362 else if (std::is_same_v<TAction, PdfActionGoToE>)
363 return PdfActionType::GoToE;
364 else if (std::is_same_v<TAction, PdfActionLaunch>)
365 return PdfActionType::Launch;
366 else if (std::is_same_v<TAction, PdfActionThread>)
367 return PdfActionType::Thread;
368 else if (std::is_same_v<TAction, PdfActionURI>)
369 return PdfActionType::URI;
370 else if (std::is_same_v<TAction, PdfActionSound>)
371 return PdfActionType::Sound;
372 else if (std::is_same_v<TAction, PdfActionMovie>)
373 return PdfActionType::Movie;
374 else if (std::is_same_v<TAction, PdfActionHide>)
375 return PdfActionType::Hide;
376 else if (std::is_same_v<TAction, PdfActionNamed>)
377 return PdfActionType::Named;
378 else if (std::is_same_v<TAction, PdfActionSubmitForm>)
379 return PdfActionType::SubmitForm;
380 else if (std::is_same_v<TAction, PdfActionResetForm>)
381 return PdfActionType::ResetForm;
382 else if (std::is_same_v<TAction, PdfActionImportData>)
383 return PdfActionType::ImportData;
384 else if (std::is_same_v<TAction, PdfActionJavaScript>)
385 return PdfActionType::JavaScript;
386 else if (std::is_same_v<TAction, PdfActionSetOCGState>)
387 return PdfActionType::SetOCGState;
388 else if (std::is_same_v<TAction, PdfActionRendition>)
389 return PdfActionType::Rendition;
390 else if (std::is_same_v<TAction, PdfActionTrans>)
391 return PdfActionType::Trans;
392 else if (std::is_same_v<TAction, PdfActionGoTo3DView>)
393 return PdfActionType::GoTo3DView;
394 else if (std::is_same_v<TAction, PdfActionRichMediaExecute>)
395 return PdfActionType::RichMediaExecute;
397 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:52
PdfActionType GetType() const
Get the type of this action.
Definition PdfAction.h:88
The PDF dictionary data type of PoDoFo (inherits from PdfDataContainer, the base class for such repre...
Definition PdfDictionary.h:80
PdfDocument is the core interface for working with PDF documents.
Definition PdfDocument.h:109
This class represents a PDF indirect Object in memory.
Definition PdfObject.h:33
A PDF outline item has an title and a destination.
Definition PdfOutlines.h:37
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
@ Create
Create a new file or truncate existing one for writing/reading.
PdfActionType
The type of the action.
Definition PdfAction.h:26