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-2023 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 
29 class Action
30 {
31 public:
32 
43  static Action CreateGoto(class Destination dest);
44 
55  static Action CreateGoto(const UChar* key, int key_sz, class Destination dest);
56 
70  static Action CreateGotoRemote(const FileSpec& file, int page_num);
71 
83  static Action CreateGotoRemote(const FileSpec& file, int page_num, bool new_window);
84 
96  static Action CreateURI(SDF::SDFDoc& doc, const char* uri);
97 
109  static Action CreateURI(SDF::SDFDoc& doc, UString& uri);
110 
120  static Action CreateSubmitForm(const FileSpec& url);
121 
129  static Action CreateLaunch(SDF::SDFDoc& doc, const char* path);
130 
139 #ifndef SWIG
140  static Action CreateHideField(SDF::SDFDoc& sdfdoc, int list_length, const char** field);
141 #endif
142  static Action CreateHideField(SDF::SDFDoc& sdfdoc, const std::vector<std::string>& field);
143 
151  static Action CreateImportData(SDF::SDFDoc& doc, const char* path);
152 
159  static Action CreateResetForm(SDF::SDFDoc& doc);
160 
168  static Action CreateJavaScript(SDF::SDFDoc& doc, const char* script);
169 
178  Action (SDF::Obj in_obj = 0);
179 
187  Action (const Action& in_action);
188 
196  Action& operator=(const Action& in_action);
197 
205  bool operator==(const Action& in_action);
206 
215  bool IsValid() const;
216 
217 
222  enum Type
223  {
244  };
245 
249  Type GetType() const;
250 
256  void Execute();
257 
266 
271  bool NeedsWriteLock();
272 
286  SDF::Obj GetNext() const;
287 
296  class Destination GetDest();
297 
298 
305  {
308  e_export_format = 2, // submit in HTML format if set, FDF format if clear
311  e_xfdf = 5,
318  // bit 12 is unused by PDF standard
320  };
321 
327  bool GetFormActionFlag( FormActionFlag flag ) const ;
328 
335  void SetFormActionFlag( FormActionFlag flag, bool value );
336 
337 
341  SDF::Obj GetSDFObj () const;
342 
343 
344  //for xamarin use only
345  static Action* CreateInternal(ptrdiff_t impl);
346  ptrdiff_t GetHandleInternal();
347 
348 // @cond PRIVATE_DOC
349 #ifndef SWIGHIDDEN
350  Action(TRN_Action impl);
351  TRN_Action mp_action;
352 #endif
353 // @endcond
354 };
355 
356  } // namespace PDF
357 } // namespace pdftron
358 
359 
360 #include <Impl/Page.inl>
361 
362 #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:241
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:236
Resolve a uniform resource identifier.
Definition: Action.h:229
Adobe supplement to ISO 32000; specifies a command to be sent to rich media annotation&#39;s handler...
Definition: Action.h:242
Go to a destination in the current document.
Definition: Action.h:224
Set an annotation&#39;s Hidden flag.
Definition: Action.h:232
static Action CreateJavaScript(SDF::SDFDoc &doc, const char *script)
Set fields to their default values.
Definition: Action.h:235
static Action CreateSubmitForm(const FileSpec &url)
Execute a JavaScript script.
Definition: Action.h:237
Type GetType() const
Send data to a uniform resource locator.
Definition: Action.h:234
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:226
TRN_UChar UChar
Definition: BasicTypes.h:12
Begin reading an article thread.
Definition: Action.h:228
Unknown Action type.
Definition: Action.h:243
Launch an application, usually to open a file.
Definition: Action.h:227
Execute an action predefined by the viewer application.
Definition: Action.h:233
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:238
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:239
Updates the display of a document, using a transition dictionary.
Definition: Action.h:240
(&#39;Go-to remote&#39;) Go to a destination in another document.
Definition: Action.h:225
SDF::Obj GetSDFObj() const