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

Public Types

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

Public Member Functions

 SetOCGStateAction (Action action)
 Constructor, with parent class object. More...
 
SetOCGStateAction.OCGState GetOCGState (int index)
 Get the state of OCG. More...
 
PDFDictionaryArray GetOCGStateArray (int index)
 Get the OCG dictionary array. More...
 
int GetOCGStateCount ()
 Get the count of OCG states. More...
 
int InsertOCGStates (PDFDoc document, int index, SetOCGStateAction.OCGState state, PDFDictionaryArray ocg_dict_array)
 Insert the OCG states to action. More...
 
bool IsRadioButtonStatePreserved ()
 Get the radio-button preserved state. More...
 
void RemoveOCGStates (int index)
 Remove the OCG state. More...
 
bool ReplaceOCGStates (PDFDoc document, int index, 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 (PDFDoc document, PDFDictionary action_dict)
 Constructor, with parameters. More...
 
 Action (Action action)
 Constructor, with another action object. More...
 
PDFDictionary GetDict ()
 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...
 
Action.Type GetType ()
 Get action type. More...
 
void InsertSubAction (int index, Action sub_action)
 Insert a new sub-action to the location specified by index. More...
 
bool IsEmpty ()
 Check whether current object is empty or not. 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, Action sub_action)
 Set a sub-action by index. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from foxit.pdf.actions.Action
static Action Create (PDFDoc document, Action.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 foxit.pdf.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 ( Action  action)
inline

Constructor, with parent class object.

Parameters
[in]actionParent class object.

Member Function Documentation

◆ GetOCGState()

SetOCGStateAction.OCGState foxit.pdf.actions.SetOCGStateAction.GetOCGState ( int  index)
inline

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()

PDFDictionaryArray foxit.pdf.actions.SetOCGStateAction.GetOCGStateArray ( int  index)
inline

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 ( )
inline

Get the count of OCG states.

Returns
The count of OCG states.

◆ InsertOCGStates()

int foxit.pdf.actions.SetOCGStateAction.InsertOCGStates ( PDFDoc  document,
int  index,
SetOCGStateAction.OCGState  state,
PDFDictionaryArray  ocg_dict_array 
)
inline

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 ( )
inline

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)
inline

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 ( PDFDoc  document,
int  index,
PDFDictionaryArray  ocg_dict_array 
)
inline

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)
inline

Set the radio-button preserved state.

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