- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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>
11 #include <PDF/KeyStrokeActionResult.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 {
226 e_GoTo,
227 e_GoToR,
228 e_GoToE,
229 e_Launch,
230 e_Thread,
231 e_URI,
232 e_Sound,
233 e_Movie,
234 e_Hide,
235 e_Named,
236 e_SubmitForm,
237 e_ResetForm,
238 e_ImportData,
239 e_JavaScript,
240 e_SetOCGState,
241 e_Rendition,
242 e_Trans,
243 e_GoTo3DView,
244 e_RichMediaExecute,
245 e_Unknown
246 };
247
251 Type GetType() const;
252
258 void Execute();
259
267 KeyStrokeActionResult ExecuteKeyStrokeAction(const KeyStrokeEventData& data);
268
273 bool NeedsWriteLock();
274
288 SDF::Obj GetNext() const;
289
298 class Destination GetDest();
299
300
306 enum FormActionFlag
307 {
308 e_exclude = 0,
309 e_include_no_value_fields = 1,
310 e_export_format = 2, // submit in HTML format if set, FDF format if clear
311 e_get_method = 3,
312 e_submit_coordinates = 4,
313 e_xfdf = 5,
314 e_include_append_saves = 6,
315 e_include_annotations = 7,
316 e_submit_pdf = 8,
317 e_canonical_format = 9,
318 e_excl_non_user_annots = 10,
319 e_excl_F_key = 11,
320 // bit 12 is unused by PDF standard
321 e_embed_form = 13
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
pdftron::PDF::Action::operator=
Action & operator=(const Action &in_action)
pdftron::PDF::Action::FormActionFlag
FormActionFlag
Definition: Action.h:306
pdftron::PDF::Action::Action
Action(SDF::Obj in_obj=0)
pdftron::PDF::Action::e_GoTo3DView
(PDF 1.6) Set the current view of a 3D annotation
Definition: Action.h:243
pdftron::PDF::Action::e_include_annotations
Definition: Action.h:315
pdftron::PDF::Action::GetFormActionFlag
bool GetFormActionFlag(FormActionFlag flag) const
pdftron::PDF::Action::CreateURI
static Action CreateURI(SDF::SDFDoc &doc, const char *uri)
pdftron::PDF::Action::ExecuteKeyStrokeAction
KeyStrokeActionResult ExecuteKeyStrokeAction(const KeyStrokeEventData &data)
pdftron::PDF::Action::GetDest
class Destination GetDest()
pdftron::PDF::Action::GetNext
SDF::Obj GetNext() const
pdftron::PDF::Action::CreateGoto
static Action CreateGoto(class Destination dest)
pdftron::PDF::Action::e_ImportData
Import field values from a file.
Definition: Action.h:238
pdftron::PDF::Action::e_URI
Resolve a uniform resource identifier.
Definition: Action.h:231
pdftron::PDF::Action::e_RichMediaExecute
Adobe supplement to ISO 32000; specifies a command to be sent to rich media annotation&#39;s handler...
Definition: Action.h:244
pdftron::PDF::Action::e_Sound
Play a sound.
Definition: Action.h:232
pdftron::PDF::Action::e_GoTo
Go to a destination in the current document.
Definition: Action.h:226
pdftron::PDF::Action::e_Hide
Set an annotation&#39;s Hidden flag.
Definition: Action.h:234
KeyStrokeActionResult.h
pdftron::PDF::Action::e_get_method
Definition: Action.h:311
pdftron::PDF::Action::CreateJavaScript
static Action CreateJavaScript(SDF::SDFDoc &doc, const char *script)
pdftron::PDF::Action::Execute
void Execute()
pdftron::PDF::Action::e_excl_non_user_annots
Definition: Action.h:318
pdftron::PDF::Action::e_ResetForm
Set fields to their default values.
Definition: Action.h:237
FileSpec.h
pdftron::PDF::Action::CreateSubmitForm
static Action CreateSubmitForm(const FileSpec &url)
pdftron::PDF::Action::e_JavaScript
Execute a JavaScript script.
Definition: Action.h:239
pdftron::PDF::Action::GetType
Type GetType() const
pdftron::PDF::Action::e_include_append_saves
Definition: Action.h:314
pdftron::PDF::Action::e_SubmitForm
Send data to a uniform resource locator.
Definition: Action.h:236
pdftron::PDF::Action::CreateResetForm
static Action CreateResetForm(SDF::SDFDoc &doc)
pdftron::PDF::Action::e_GoToE
(&#39;Go-to embedded&#39;; PDF 1.6) Go to a destination in an embedded file.
Definition: Action.h:228
pdftron::PDF::KeyStrokeEventData
Definition: KeyStrokeEventData.h:9
pdftron::PDF::FileSpec
Definition: FileSpec.h:37
pdftron::PDF::Action::e_canonical_format
Definition: Action.h:317
pdftron::PDF::KeyStrokeActionResult
Definition: KeyStrokeActionResult.h:10
pdftron::PDF::Action::e_Movie
Play a movie.
Definition: Action.h:233
pdftron::PDF::Action::e_excl_F_key
Definition: Action.h:319
pdftron::SDF::SDFDoc
Definition: SDFDoc.h:67
Obj.h
pdftron::UChar
TRN_UChar UChar
Definition: BasicTypes.h:12
pdftron::PDF::Action::e_exclude
Definition: Action.h:308
pdftron::PDF::Action::e_Thread
Begin reading an article thread.
Definition: Action.h:230
pdftron::PDF::Action::e_export_format
Definition: Action.h:310
pdftron::PDF::Action::e_Unknown
Unknown Action type.
Definition: Action.h:245
pdftron::PDF::Action::e_Launch
Launch an application, usually to open a file.
Definition: Action.h:229
pdftron::PDF::Action::e_Named
Execute an action predefined by the viewer application.
Definition: Action.h:235
pdftron::PDF::Action::Type
Type
Definition: Action.h:224
pdftron::PDF::Action::CreateInternal
static Action * CreateInternal(ptrdiff_t impl)
KeyStrokeEventData.h
pdftron::PDF::Destination
Definition: Destination.h:30
pdftron::PDF::Action::CreateImportData
static Action CreateImportData(SDF::SDFDoc &doc, const char *path)
pdftron::PDF::Action::CreateGotoRemote
static Action CreateGotoRemote(const FileSpec &file, int page_num)
pdftron::PDF::Action::SetFormActionFlag
void SetFormActionFlag(FormActionFlag flag, bool value)
pdftron::PDF::Action::GetHandleInternal
ptrdiff_t GetHandleInternal()
pdftron::PDF::Action::NeedsWriteLock
bool NeedsWriteLock()
pdftron::PDF::Action::operator==
bool operator==(const Action &in_action)
pdftron::PDF::Action::e_SetOCGState
(PDF 1.5) Set the states of optional content groups.
Definition: Action.h:240
pdftron::PDF::Action::e_submit_pdf
Definition: Action.h:316
pdftron::PDF::Action::IsValid
bool IsValid() const
pdftron::PDF::Action
Definition: Action.h:31
pdftron::PDF::Action::CreateLaunch
static Action CreateLaunch(SDF::SDFDoc &doc, const char *path)
pdftron::PDF::Action::e_embed_form
Definition: Action.h:321
pdftron::PDF::Action::e_submit_coordinates
Definition: Action.h:312
pdftron::SDF::Obj
Definition: Obj.h:40
pdftron::PDF::Action::CreateHideField
static Action CreateHideField(SDF::SDFDoc &sdfdoc, int list_length, const char **field)
pdftron::PDF::Action::e_Rendition
(PDF 1.5) Controls the playing of multimedia content.
Definition: Action.h:241
pdftron::PDF::Action::e_include_no_value_fields
Definition: Action.h:309
pdftron::PDF::Action::e_Trans
Updates the display of a document, using a transition dictionary.
Definition: Action.h:242
pdftron::UString
Definition: UString.h:27
pdftron::PDF::Action::e_GoToR
(&#39;Go-to remote&#39;) Go to a destination in another document.
Definition: Action.h:227
pdftron::PDF::Action::e_xfdf
Definition: Action.h:313
pdftron::PDF::Action::GetSDFObj
SDF::Obj GetSDFObj() const