All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Action.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------------------
2 // Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved.
3 // Consult legal.txt regarding legal and license information.
4 //---------------------------------------------------------------------------------------
5 #ifndef PDFTRON_H_CPPPDFAction
6 #define PDFTRON_H_CPPPDFAction
7 
8 #include <PDF/FileSpec.h>
9 #include <SDF/Obj.h>
10 #include <C/PDF/TRN_Action.h>
12 #include <PDF/KeyStrokeEventData.h>
13 
14 namespace pdftron {
15  namespace PDF {
16 
17 class Destination;
18 
31 class Action
32 {
33 public:
34 
45  static Action CreateGoto(class Destination dest);
46 
57  static Action CreateGoto(const UChar* key, int key_sz, class Destination dest);
58 
72  static Action CreateGotoRemote(const FileSpec& file, int page_num);
73 
85  static Action CreateGotoRemote(const FileSpec& file, int page_num, bool new_window);
86 
98  static Action CreateURI(SDF::SDFDoc& doc, const char* uri);
99 
111  static Action CreateURI(SDF::SDFDoc& doc, UString& uri);
112 
122  static Action CreateSubmitForm(const FileSpec& url);
123 
131  static Action CreateLaunch(SDF::SDFDoc& doc, const char* path);
132 
141 #ifndef SWIG
142  static Action CreateHideField(SDF::SDFDoc& sdfdoc, int list_length, const char** field);
143 #endif
144  static Action CreateHideField(SDF::SDFDoc& sdfdoc, const std::vector<std::string>& field);
145 
153  static Action CreateImportData(SDF::SDFDoc& doc, const char* path);
154 
161  static Action CreateResetForm(SDF::SDFDoc& doc);
162 
170  static Action CreateJavaScript(SDF::SDFDoc& doc, const char* script);
171 
180  Action (SDF::Obj in_obj = 0);
181 
189  Action (const Action& in_action);
190 
198  Action& operator=(const Action& in_action);
199 
207  bool operator==(const Action& in_action);
208 
217  bool IsValid() const;
218 
219 
224  enum Type
225  {
246  };
247 
251  Type GetType() const;
252 
258  void Execute();
259 
268 
273  bool NeedsWriteLock();
274 
288  SDF::Obj GetNext() const;
289 
298  class Destination GetDest();
299 
300 
307  {
310  e_export_format = 2, // submit in HTML format if set, FDF format if clear
313  e_xfdf = 5,
320  // bit 12 is unused by PDF standard
322  };
323 
329  bool GetFormActionFlag( FormActionFlag flag ) const ;
330 
337  void SetFormActionFlag( FormActionFlag flag, bool value );
338 
339 
343  SDF::Obj GetSDFObj () const;
344 
345 
346  //for xamarin use only
347  static Action* CreateInternal(ptrdiff_t impl);
348  ptrdiff_t GetHandleInternal();
349 
350 // @cond PRIVATE_DOC
351 #ifndef SWIGHIDDEN
352  Action(TRN_Action impl);
353  TRN_Action mp_action;
354 #endif
355 // @endcond
356 };
357 
358  } // namespace PDF
359 } // namespace pdftron
360 
361 
362 #include <Impl/Page.inl>
363 
364 #endif // PDFTRON_H_CPPPDFAction
Action & operator=(const Action &in_action)
Action(SDF::Obj in_obj=0)
(PDF 1.6) Set the current view of a 3D annotation
Definition: Action.h:243
bool GetFormActionFlag(FormActionFlag flag) const
static Action CreateURI(SDF::SDFDoc &doc, const char *uri)
KeyStrokeActionResult ExecuteKeyStrokeAction(const KeyStrokeEventData &data)
class Destination GetDest()
SDF::Obj GetNext() const
static Action CreateGoto(class Destination dest)
Import field values from a file.
Definition: Action.h:238
Resolve a uniform resource identifier.
Definition: Action.h:231
Adobe supplement to ISO 32000; specifies a command to be sent to rich media annotation&#39;s handler...
Definition: Action.h:244
Go to a destination in the current document.
Definition: Action.h:226
Set an annotation&#39;s Hidden flag.
Definition: Action.h:234
static Action CreateJavaScript(SDF::SDFDoc &doc, const char *script)
Set fields to their default values.
Definition: Action.h:237
static Action CreateSubmitForm(const FileSpec &url)
Execute a JavaScript script.
Definition: Action.h:239
Type GetType() const
Send data to a uniform resource locator.
Definition: Action.h:236
static Action CreateResetForm(SDF::SDFDoc &doc)
(&#39;Go-to embedded&#39;; PDF 1.6) Go to a destination in an embedded file.
Definition: Action.h:228
TRN_UChar UChar
Definition: BasicTypes.h:12
Begin reading an article thread.
Definition: Action.h:230
Unknown Action type.
Definition: Action.h:245
Launch an application, usually to open a file.
Definition: Action.h:229
Execute an action predefined by the viewer application.
Definition: Action.h:235
static Action * CreateInternal(ptrdiff_t impl)
static Action CreateImportData(SDF::SDFDoc &doc, const char *path)
static Action CreateGotoRemote(const FileSpec &file, int page_num)
void SetFormActionFlag(FormActionFlag flag, bool value)
ptrdiff_t GetHandleInternal()
bool operator==(const Action &in_action)
(PDF 1.5) Set the states of optional content groups.
Definition: Action.h:240
bool IsValid() const
static Action CreateLaunch(SDF::SDFDoc &doc, const char *path)
static Action CreateHideField(SDF::SDFDoc &sdfdoc, int list_length, const char **field)
(PDF 1.5) Controls the playing of multimedia content.
Definition: Action.h:241
Updates the display of a document, using a transition dictionary.
Definition: Action.h:242
(&#39;Go-to remote&#39;) Go to a destination in another document.
Definition: Action.h:227
SDF::Obj GetSDFObj() const