foxit::pdf::actions::RenditionAction Class Reference
Inheritance diagram for foxit::pdf::actions::RenditionAction:
foxit::pdf::actions::Action foxit::Base

Public Types

enum  OperationType {
  e_OpTypeNone = -1, e_OpTypeAssociate = 0, e_OpTypeStop = 1, e_OpTypePause = 2,
  e_OpTypeResume = 3, e_OpTypePlay = 4
}
 Enumeration for operation type to perform when the rendition action is triggered. More...
 
- Public Types inherited from foxit::pdf::actions::Action
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

 RenditionAction (const Action &action)
 Constructor, with parent class object. More...
 
WString GetJavaScript ()
 Get the JavaScript script to be executed. More...
 
OperationType GetOperationType ()
 Get the operation type of current rendition action when being triggered. More...
 
Rendition GetRendition (int index)
 Get a rendition by index. More...
 
int GetRenditionCount () const
 Get the count of rendition objects. More...
 
annots::Screen GetScreenAnnot ()
 Get the related screen annotation. More...
 
void InsertRendition (const Rendition &rendition, int index=-1)
 Insert a rendition to current rendition action, at the position specified by index. More...
 
void RemoveRendition (const Rendition &rendition)
 Remove a rendition object from current rendition action. More...
 
void SetJavaScript (const WString &script)
 Set the JavaScript script to be executed. More...
 
void SetOperationType (OperationType op_type)
 Set the operation type of current rendition action when being triggered. More...
 
void SetScreenAnnot (const annots::Screen &screen_annot)
 Set related screen annotation. More...
 
- Public Member Functions inherited from foxit::pdf::actions::Action
 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...
 

Additional Inherited Members

- Static Public Member Functions inherited from foxit::pdf::actions::Action
static Action Create (const PDFDoc &document, Type action_type)
 Create a new action, for specified action type. More...
 

Detailed Description

Rendition action is to control the playing of multimedia content. (For more details, please refer to <PDF Reference 1.7> P668 "Rendition Actions") Class LaunchAction is derived from Action and offers functions to get/set rendition action data.

See also
Action

Member Enumeration Documentation

◆ OperationType

Enumeration for operation type to perform when the rendition action is triggered.

Values of this enumeration should be used alone.

Enumerator
e_OpTypeNone 

No operation is specified.

e_OpTypeAssociate 

Associate rendition to related screen annotation.

If no rendition is associated with related screen annotation, play rendition (which is specified in rendition action), associating it with the annotation. If a rendition is already associated with related screen annotation, it is stopped, and the new rendition (which is specified in rendition action) is associated with the annotation.

e_OpTypeStop 

Stop any rendition being played in association with related screen annotation and remove the association. If no rendition is being played, there is no effect.

e_OpTypePause 

Pause any rendition being played in association with related screen annotation. If no rendition is being played, there is no effect.

e_OpTypeResume 

Resume any rendition being played in association with related screen annotation. If no rendition is being played or the rendition is not paused, there is no effect.

e_OpTypePlay 

Play rendition (which is specified in rendition action), associating it with related screen annotation. If a rendition is already associated with the annotation, resume that rendition if it is paused; otherwise, do nothing.

Constructor & Destructor Documentation

◆ RenditionAction()

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

Constructor, with parent class object.

Parameters
[in]actionParent class object.

Member Function Documentation

◆ GetJavaScript()

WString foxit::pdf::actions::RenditionAction::GetJavaScript ( )

Get the JavaScript script to be executed.

As a useful rendition action, it should contain a JavaScript script to be executed or is specified an operation type to be performed when triggered. If both JavaScript script and operation type exist, application should execute JavaScript; if application is unable to execute JavaScript script, then perform as operation type defines. If no JavaScript script and operation type is invalid, that means the action is invalid.

Returns
A JavaScript script.

◆ GetOperationType()

OperationType foxit::pdf::actions::RenditionAction::GetOperationType ( )

Get the operation type of current rendition action when being triggered.

As a useful rendition action, it should contain a JavaScript script to be executed or is specified an operation type to be performed when triggered. If both JavaScript script and operation type exist, application should execute JavaScript; if application is unable to execute JavaScript script, then perform as operation type defines. If no JavaScript script and operation type is invalid, that means the action is invalid.

Returns
Operation type. Please refer to values starting from RenditionAction::e_OpTypeNone and this would be one of these values.

◆ GetRendition()

Rendition foxit::pdf::actions::RenditionAction::GetRendition ( int  index)

Get a rendition by index.

Parameters
[in]indexIndex of rendition object to be retrieved. Valid range: from 0 to (count-1). count is returned by function RenditionAction::GetRenditionCount.
Returns
A Rendition object.

◆ GetRenditionCount()

int foxit::pdf::actions::RenditionAction::GetRenditionCount ( ) const

Get the count of rendition objects.

Returns
The count of rendition objects.

◆ GetScreenAnnot()

annots::Screen foxit::pdf::actions::RenditionAction::GetScreenAnnot ( )

Get the related screen annotation.

Returns
An annots::Screen object.

◆ InsertRendition()

void foxit::pdf::actions::RenditionAction::InsertRendition ( const Rendition rendition,
int  index = -1 
)

Insert a rendition to current rendition action, at the position specified by index.

Rendition object is necessary for a rendition action when operation type is RenditionAction::e_OpTypeAssociate or RenditionAction::e_OpTypeAssociate.

Parameters
[in]renditionA rendition object to be inserted.
[in]indexIndex that specifies where to insert the rendition object. If index is below 0 or bigger than (count-1), the input rendition will be inserted to be the end. count is returned by function RenditionAction::GetRenditionCount.
Returns
None.

◆ RemoveRendition()

void foxit::pdf::actions::RenditionAction::RemoveRendition ( const Rendition rendition)

Remove a rendition object from current rendition action.

Parameters
[in]renditionA rendition object to be removed from current rendition action.
Returns
None.

◆ SetJavaScript()

void foxit::pdf::actions::RenditionAction::SetJavaScript ( const WString script)

Set the JavaScript script to be executed.

As a useful rendition action, it should contain a JavaScript script to be executed or is specified an operation type to be performed when triggered. If both JavaScript script and operation type exist, application should execute JavaScript; if application is unable to execute JavaScript script, then perform as operation type defines. If no JavaScript script and operation type is invalid, that means the action is invalid.

Parameters
[in]scriptA JavaScript script to be set.
Returns
None.

◆ SetOperationType()

void foxit::pdf::actions::RenditionAction::SetOperationType ( OperationType  op_type)

Set the operation type of current rendition action when being triggered.

As a useful rendition action, it should contain a JavaScript script to be executed or is specified an operation type to be performed when triggered. If both JavaScript script and operation type exist, application should execute JavaScript; if application is unable to execute JavaScript script, then perform as operation type defines. If no JavaScript script and operation type is invalid, that means the action is invalid.

Parameters
[in]op_typeOperation type. Please refer to values starting from RenditionAction::e_OpTypeAssociate and this should be one of these values. If set value RenditionAction::e_OpTypeNone, that means no operation type is specified.
Returns
None.

◆ SetScreenAnnot()

void foxit::pdf::actions::RenditionAction::SetScreenAnnot ( const annots::Screen screen_annot)

Set related screen annotation.

This property is necessary when operation type is set with valid value.

Parameters
[in]screen_annotAn annots::Screen object to be set as related screen annotation.
Returns
None.

Foxit Software Corporation Logo
@2018 Foxit Software Incorporated. All rights reserved.