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::PDFDictionary * | GetDict () 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... | |
Action & | operator= (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... | |
![]() | |
FS_HANDLE | Handle () const |
Get the handle of current object. More... | |
Static Public Member Functions | |
static Action | Create (const PDFDoc &document, Type action_type) |
Create a new action, for specified action type. More... | |
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.
Enumeration for action type.
Values of this enumeration should be used alone.
|
explicit |
Constructor, with parameters.
[in] | document | A valid PDF document object. |
[in] | action_dict | A PDF dictionary object that represents an action. |
foxit::pdf::actions::Action::Action | ( | const Action & | action | ) |
Constructor, with another action object.
[in] | action | Another action object. |
|
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.
[in] | document | A valid PDF document, to which the new action belongs. |
[in] | action_type | Action 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. |
objects::PDFDictionary* foxit::pdf::actions::Action::GetDict | ( | ) | const |
Get PDF dictionary of current object.
PDFDoc foxit::pdf::actions::Action::GetDocument | ( | ) |
Get the PDF document, to which current action belongs.
Action foxit::pdf::actions::Action::GetSubAction | ( | int | index | ) |
Get a sub-action by index.
[in] | index | Index of sub-action to be retrieved. Valid range: from 0 to (count-1). count is returned by function Action::GetSubActionCount. |
int foxit::pdf::actions::Action::GetSubActionCount | ( | ) |
Get the count of sub-actions.
Type foxit::pdf::actions::Action::GetType | ( | ) |
Get action type.
void foxit::pdf::actions::Action::InsertSubAction | ( | int | index, |
const Action & | sub_action | ||
) |
Insert a new sub-action to the location specified by index.
[in] | index | Index 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_action | New 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. |
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.
bool foxit::pdf::actions::Action::operator!= | ( | const Action & | other | ) | const |
Not equal operator.
[in] | other | Another action object. This function will check if current object is not equal to this one. |
Assign operator.
[in] | other | Another action object, whose value would be assigned to current object. |
bool foxit::pdf::actions::Action::operator== | ( | const Action & | other | ) | const |
Equal operator.
[in] | other | Another action object. This function will check if current object is equal to this one. |
void foxit::pdf::actions::Action::RemoveAllSubActions | ( | ) |
Remove all the sub-actions.
void foxit::pdf::actions::Action::RemoveSubAction | ( | int | index | ) |
Remove a sub-action, specified by index.
[in] | index | Index of sub-action to be retrieved. Valid range: from 0 to (count-1). count is returned by function Action::GetSubActionCount. |
void foxit::pdf::actions::Action::SetSubAction | ( | int | index, |
const Action & | sub_action | ||
) |
Set a sub-action by index.
[in] | index | Index of sub-action to be retrieved. Valid range: from 0 to (count-1). count is returned by function Action::GetSubActionCount. |
[in] | sub_action | An 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. |