Foxit PDF SDK
foxit::pdf::actions::SetOCGStateAction Class Reference
Inheritance diagram for foxit::pdf::actions::SetOCGStateAction:
foxit::pdf::actions::Action foxit::Base

Public Types

enum  OCGState { e_OCGStateOn = 0, e_OCGStateOff = 1, e_OCGStateToggle = 2 }
 Enumeration for set ocg state to perform when the set ocg state 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

 SetOCGStateAction (const Action &action)
 Constructor, with parent class object. More...
 
OCGState GetOCGState (int index) const
 Get the state of OCG. More...
 
objects::PDFDictionaryArray GetOCGStateArray (int index) const
 Get the OCG dictionary array. More...
 
int GetOCGStateCount () const
 Get the count of OCG states. More...
 
int InsertOCGStates (const PDFDoc &document, int index, OCGState state, const objects::PDFDictionaryArray &ocg_dict_array)
 Insert the OCG states to action. More...
 
bool IsRadioButtonStatePreserved () const
 Get the radio-button preserved state. More...
 
void RemoveOCGStates (int index)
 Remove the OCG state. More...
 
bool ReplaceOCGStates (const PDFDoc &document, int index, const objects::PDFDictionaryArray &ocg_dict_array)
 Replace the OCG states array. More...
 
void SetRadioButtonStatePreserved (bool is_preserved)
 Set the radio-button preserved state. More...
 
- Public Member Functions inherited from foxit::pdf::actions::Action
 Action (const Action &action)
 Constructor, with another action object. More...
 
 Action (const PDFDoc &document, objects::PDFDictionary *action_dict)
 Constructor, with parameters. 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 foxit::pdf::PDFDoc &document, Type action_type)
 Create a new action, for specified action type. More...
 

Detailed Description

Set-OCG-state action is to sets the state of one or more optional content groups. (For more details, please refer to <PDF Reference 1.7> P667 "Set-OCG-State Actions") Class actions::SetOCGStateAction is derived from Action and offers functions to get/set set-OCG-state action data.

See also
Action

Member Enumeration Documentation

◆ OCGState

Enumeration for set ocg state to perform when the set ocg state action is triggered.

Values of this enumeration should be used alone.

Enumerator
e_OCGStateOn 

Sets the state of subsequent groups to ON.

e_OCGStateOff 

Sets the state of subsequent groups to OFF.

e_OCGStateToggle 

Reverses the state of subsequent groups.

Constructor & Destructor Documentation

◆ SetOCGStateAction()

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

Constructor, with parent class object.

Parameters
[in]actionParent class object.

Member Function Documentation

◆ GetOCGState()

OCGState foxit::pdf::actions::SetOCGStateAction::GetOCGState ( int  index) const

Get the state of OCG.

Parameters
[in]indexThe index of OCG state. Valid range: from 0 to (count-1). count is returned by function SetOCGStateAction::GetOCGStateCount.
Returns
The state of OCG.

◆ GetOCGStateArray()

objects::PDFDictionaryArray foxit::pdf::actions::SetOCGStateAction::GetOCGStateArray ( int  index) const

Get the OCG dictionary array.

Parameters
[in]indexThe index of OCG state. Valid range: from 0 to (count-1). count is returned by function SetOCGStateAction::GetOCGStateCount.
Returns
The OCG dictionary array.

◆ GetOCGStateCount()

int foxit::pdf::actions::SetOCGStateAction::GetOCGStateCount ( ) const

Get the count of OCG states.

Returns
The count of OCG states.

◆ InsertOCGStates()

int foxit::pdf::actions::SetOCGStateAction::InsertOCGStates ( const PDFDoc document,
int  index,
OCGState  state,
const objects::PDFDictionaryArray ocg_dict_array 
)

Insert the OCG states to action.

Parameters
[in]documentA valid PDF document object.
[in]indexThe index of OCG want to insert. The OCG state will be inserted after the index. Valid range: from 0 to (count-1). count is returned by function SetOCGStateAction::GetOCGStateCount.
If this is below 0 or count of OCG state in current action is 0, parameter state is to be inserted to the first position.
If this is larger than count of OCG state in current action, parameter state is to be added to the end.
[in]stateThe OCG state to insert.
[in]ocg_dict_arrayThe OCG dictionary array to insert.
Returns
The index of the inserted OCG states.

◆ IsRadioButtonStatePreserved()

bool foxit::pdf::actions::SetOCGStateAction::IsRadioButtonStatePreserved ( ) const

Get the radio-button preserved state.

If true, indicates that radio-button state relationships between optional content groups should be preserved when the states in the State array are applied. If false, radio-button state relationships, if any, are ignored. Default value: true.

Returns
The preserved state value.

◆ RemoveOCGStates()

void foxit::pdf::actions::SetOCGStateAction::RemoveOCGStates ( int  index)

Remove the OCG state.

Parameters
[in]indexThe index of OCG to remove. Valid range: from 0 to (count-1). count is returned by function SetOCGStateAction::GetOCGStateCount.
Returns
None.

◆ ReplaceOCGStates()

bool foxit::pdf::actions::SetOCGStateAction::ReplaceOCGStates ( const PDFDoc document,
int  index,
const objects::PDFDictionaryArray ocg_dict_array 
)

Replace the OCG states array.

Parameters
[in]documentA valid PDF document object.
[in]indexThe index of OCG want to replace. Valid range: from 0 to (count-1). count is returned by function SetOCGStateAction::GetOCGStateCount.
[in]ocg_dict_arrayThe OCG dictionary array to insert.
Returns
true means is success, while false means not.

◆ SetRadioButtonStatePreserved()

void foxit::pdf::actions::SetOCGStateAction::SetRadioButtonStatePreserved ( bool  is_preserved)

Set the radio-button preserved state.

Parameters
[in]is_preservedThe preserved state value.
Returns
None.