Foxit PDF SDK
foxit::pdf::actions::Action Class Reference
Inheritance diagram for foxit::pdf::actions::Action:
foxit::Base foxit::pdf::actions::EmbeddedGotoAction foxit::pdf::actions::GotoAction foxit::pdf::actions::HideAction foxit::pdf::actions::ImportDataAction foxit::pdf::actions::JavaScriptAction foxit::pdf::actions::LaunchAction foxit::pdf::actions::NamedAction foxit::pdf::actions::RemoteGotoAction foxit::pdf::actions::RenditionAction foxit::pdf::actions::ResetFormAction foxit::pdf::actions::SubmitFormAction foxit::pdf::actions::URIAction

Public Types

enum  NewWindowFlag { e_NewWindowFlagFalse = 0, e_NewWindowFlagTrue = 1, e_NewWindowFlagNone = 2 }
 Enumeration for new window flag. More...
 
enum  Type {
  e_TypeUnknown = 0, e_TypeGoto = 1, e_TypeGoToR = 2, e_TypeGoToE = 3,
  e_TypeLaunch = 4, e_TypeThread = 5, e_TypeURI = 6, e_TypeSound = 7,
  e_TypeMovie = 8, e_TypeHide = 9, e_TypeNamed = 10, e_TypeSubmitForm = 11,
  e_TypeResetForm = 12, e_TypeImportData = 13, e_TypeJavaScript = 14, e_TypeSetOCGState = 15,
  e_TypeRendition = 16, e_TypeTrans = 17, e_TypeGoTo3DView = 18
}
 Enumeration for action type. More...
 

Public Member Functions

 Action (const PDFDoc &document, objects::PDFDictionary *action_dict)
 Constructor, with parameters. More...
 
 Action (const Action &action)
 Constructor, with another action object. More...
 
 ~Action ()
 Destructor.
 
objects::PDFDictionaryGetDict () const
 Get PDF dictionary of current object. More...
 
PDFDoc GetDocument ()
 Get the PDF document, to which current action belongs. More...
 
Action GetSubAction (int index)
 Get a sub-action by index. More...
 
int GetSubActionCount ()
 Get the count of sub-actions. More...
 
Type GetType ()
 Get action type. More...
 
void InsertSubAction (int index, const Action &sub_action)
 Insert a new sub-action to the location specified by index. More...
 
bool IsEmpty () const
 Check whether current object is empty or not. More...
 
bool operator != (const Action &other) const
 Not equal operator. More...
 
Actionoperator= (const Action &other)
 Assign operator. More...
 
bool operator== (const Action &other) const
 Equal operator. More...
 
void RemoveAllSubActions ()
 Remove all the sub-actions. More...
 
void RemoveSubAction (int index)
 Remove a sub-action, specified by index. More...
 
void SetSubAction (int index, const Action &sub_action)
 Set a sub-action by index. More...
 
- Public Member Functions inherited from foxit::Base
FS_HANDLE Handle () const
 Get the handle of current object. More...
 

Static Public Member Functions

static Action Create (const foxit::pdf::PDFDoc &document, Type action_type)
 Create a new action, for specified action type. More...
 

Detailed Description

PDF supports following standard action types:
"Go-To Action", "Remote Go-To Action", "Embedded Go-To Action", "Launch Action", "Thread Action", "URI Action", "Sound Action","Movie Action", "Hide Action", "Named Action", "Submit-Form Action", "Reset-Form Action", "Import-Data Action", "JavaScript Action", "Set-OCG-State Action", "Rendition Action","Transition Action","Go-To-3D-View Action".
A PDF action may have sub-actions. When this action is triggered, its sub-actions should also be triggered in turn.
Class Action is the base class for all kinds of PDF actions. For concrete action types, please refer to derived classes. Function Action::Create can be used to create a new action – currently only support some action types. Please refer to comment of this function for more details. This class also offers functions to modify sub-actions.

Member Enumeration Documentation

◆ NewWindowFlag

Enumeration for new window flag.

Values of this enumeration should be used alone.

Enumerator
e_NewWindowFlagFalse 

"NewWindow" flag is false.

e_NewWindowFlagTrue 

"NewWindow" flag is true.

e_NewWindowFlagNone 

No "NewWindow" flag.

◆ Type

Enumeration for action type.

Values of this enumeration should be used alone.

Enumerator
e_TypeUnknown 

Action type: unknown action.

e_TypeGoto 

Action type: go-to action.

e_TypeGoToR 

Action type: remote go-to action.

e_TypeGoToE 

Action type: embedded go-to action.

e_TypeLaunch 

Action type: launch action.

e_TypeThread 

Action type: thread action.

e_TypeURI 

Action type: uniform resource identifier (URI) action.

e_TypeSound 

Action type: sound action.

e_TypeMovie 

Action type: movie action.

e_TypeHide 

Action type: hide action.

e_TypeNamed 

Action type: named action.

e_TypeSubmitForm 

Action type: submit-form action.

e_TypeResetForm 

Action type: reset-form action.

e_TypeImportData 

Action type: import-data action.

e_TypeJavaScript 

Action type: JavaScript action.

e_TypeSetOCGState 

Action type: set-OCG-state action.

e_TypeRendition 

Action type: rendition action.

e_TypeTrans 

Action type: transition action.

e_TypeGoTo3DView 

Action type: go-to-3D-view action.

Constructor & Destructor Documentation

◆ Action() [1/2]

foxit::pdf::actions::Action::Action ( const PDFDoc document,
objects::PDFDictionary action_dict 
)
explicit

Constructor, with parameters.

Parameters
[in]documentA valid PDF document object.
[in]action_dictA PDF dictionary object that represents an action.

◆ Action() [2/2]

foxit::pdf::actions::Action::Action ( const Action action)

Constructor, with another action object.

Parameters
[in]actionAnother action object.

Member Function Documentation

◆ Create()

static Action foxit::pdf::actions::Action::Create ( const foxit::pdf::PDFDoc document,
Type  action_type 
)
static

Create a new action, for specified action type.

The newly created action has no action data (except action type) yet. User needs to call the functions in concrete action classes to set action data.

Parameters
[in]documentA valid PDF document, to which the new action belongs.
[in]action_typeAction type, used to specify which type of action is to be created. Currently only support:
actions::Action::e_TypeGoto, Action::e_TypeURI, actions::Action::e_TypeJavaScript, Action::e_TypeNamed, actions::Action::e_TypeGoToR, Action::e_TypeGoToE, actions::Action::e_TypeSubmitForm, Action::e_TypeResetForm, actions::Action::e_TypeHide, Action::e_TypeLaunch, actions::Action::e_TypeImportData, Action::e_TypeRendition.
Returns
A new action object, with no action data.

◆ GetDict()

objects::PDFDictionary* foxit::pdf::actions::Action::GetDict ( ) const

Get PDF dictionary of current object.

Returns
The PDF dictionary.If there is any error, this function will return NULL.

◆ GetDocument()

PDFDoc foxit::pdf::actions::Action::GetDocument ( )

Get the PDF document, to which current action belongs.

Returns
A PDF document object.

◆ GetSubAction()

Action foxit::pdf::actions::Action::GetSubAction ( int  index)

Get a sub-action by index.

Parameters
[in]indexIndex of sub-action to be retrieved. Valid range: from 0 to (count-1). count is returned by function Action::GetSubActionCount.
Returns
An action object that represents the specified sub-action.

◆ GetSubActionCount()

int foxit::pdf::actions::Action::GetSubActionCount ( )

Get the count of sub-actions.

Returns
Count of sub-actions.

◆ GetType()

Type foxit::pdf::actions::Action::GetType ( )

Get action type.

Returns
Action type. Please refer to values starting from Action::e_TypeGoto and this would be one of these values.

◆ InsertSubAction()

void foxit::pdf::actions::Action::InsertSubAction ( int  index,
const Action sub_action 
)

Insert a new sub-action to the location specified by index.

Parameters
[in]indexIndex of the location, where the new sub-action is inserted.
If this index value is below zero, the new sub-action will be inserted to be the first.
If this index value equals or larger than current sub-action count, the new sub-action will be inserted to be the last.
[in]sub_actionNew sub-action to be inserted. Currently only support following types as the new sub-action:
actions::Action::e_TypeGoto, Action::e_TypeURI, actions::Action::e_TypeJavaScript, Action::e_TypeNamed, actions::Action::e_TypeGoToR, Action::e_TypeGoToE, actions::Action::e_TypeSubmitForm, Action::e_TypeResetForm, actions::Action::e_TypeHide, Action::e_TypeLaunch, actions::Action::e_TypeImportData, Action::e_TypeRendition.
Returns
None.

◆ IsEmpty()

bool foxit::pdf::actions::Action::IsEmpty ( ) const

Check whether current object is empty or not.

When the current object is empty, that means current object is useless.

Returns
true means current object is empty, while false means not.

◆ operator !=()

bool foxit::pdf::actions::Action::operator != ( const Action other) const

Not equal operator.

Parameters
[in]otherAnother action object. This function will check if current object is not equal to this one.
Returns
true means not equal, while false means equal.

◆ operator=()

Action& foxit::pdf::actions::Action::operator= ( const Action other)

Assign operator.

Parameters
[in]otherAnother action object, whose value would be assigned to current object.
Returns
Reference to current object itself.

◆ operator==()

bool foxit::pdf::actions::Action::operator== ( const Action other) const

Equal operator.

Parameters
[in]otherAnother action object. This function will check if current object is equal to this one.
Returns
true means equal, while false means not equal.

◆ RemoveAllSubActions()

void foxit::pdf::actions::Action::RemoveAllSubActions ( )

Remove all the sub-actions.

Returns
None.

◆ RemoveSubAction()

void foxit::pdf::actions::Action::RemoveSubAction ( int  index)

Remove a sub-action, specified by index.

Parameters
[in]indexIndex of sub-action to be retrieved. Valid range: from 0 to (count-1). count is returned by function Action::GetSubActionCount.
Returns
None.

◆ SetSubAction()

void foxit::pdf::actions::Action::SetSubAction ( int  index,
const Action sub_action 
)

Set a sub-action by index.

Parameters
[in]indexIndex of sub-action to be retrieved. Valid range: from 0 to (count-1). count is returned by function Action::GetSubActionCount.
[in]sub_actionAn action object to be set as a sub-action. Currently only support following types as sub-action:
actions::Action::e_TypeGoto, Action::e_TypeURI, actions::Action::e_TypeJavaScript, Action::e_TypeNamed, actions::Action::e_TypeGoToR, Action::e_TypeGoToE, actions::Action::e_TypeSubmitForm, Action::e_TypeResetForm, actions::Action::e_TypeHide, Action::e_TypeLaunch, actions::Action::e_TypeImportData, Action::e_TypeRendition.
Returns
None.