Foxit PDF SDK

Instance Methods | List of all members
FSSetOCGStateAction Class Reference
Inheritance diagram for FSSetOCGStateAction:

## Instance Methods
(FSSetOCGStateActionOCGState) | - getOCGState:
| Get the state of OCG. More...
(PDFDictionaryArray *) | - getOCGStateArray:
| Get the OCG dictionary array. More...
(int) | - getOCGStateCount
| Get the count of OCG states. More...
(id) | - initWithAction:
| Constructor, with parent class object. More...
(int) | - insertOCGStates:index:state:ocg_dict_array:
| Insert the OCG states to action. More...
(BOOL) | - isRadioButtonStatePreserved
| Get the radio-button preserved state. More...
(void) | - removeOCGStates:
| Remove the OCG state. More...
(BOOL) | - replaceOCGStates:index:ocg_dict_array:
| Replace the OCG states array. More...
(void) | - setRadioButtonStatePreserved:
| Set the radio-button preserved state. More...
Instance Methods inherited from FSAction
(FSPDFDictionary *) | - getDict
| Get PDF dictionary of current object. More...
(FSPDFDoc *) | - getDocument
| Get the PDF document, to which current action belongs. More...
(FSAction *) | - getSubAction:
| Get a sub-action by index. More...
(int) | - getSubActionCount
| Get the count of sub-actions. More...
(FSActionType) | - getType
| Get action type. More...
(id) | - initWithDocument:action_dict:
| Constructor, with parameters. More...
(void) | - insertSubAction: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:
| Remove a sub-action, specified by index. More...
(void) | - setSubAction:sub_action:
| Set a sub-action by index. More...

## Additional Inherited Members
Class Methods inherited from FSAction
(FSAction *) | + create: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 FSSetOCGStateAction is derived from FSAction and offers functions to get/set set- OCG-state action data.

See also
  FSAction

## Method Documentation

## ◆ getOCGState:()

- (FSSetOCGStateActionOCGState) getOCGState: |  | (int) | index |

Get the state of OCG.

Parameters

  [in] | index | The index of OCG state. Valid range: from 0 to (count-1). count is returned by function FSSetOCGStateAction::getOCGStateCount.

Returns
  The state of OCG.

## ◆ getOCGStateArray:()

- (PDFDictionaryArray *) getOCGStateArray: |  | (int) | index |

Get the OCG dictionary array.

Parameters

  [in] | index | The index of OCG state. Valid range: from 0 to (count-1). count is returned by function FSSetOCGStateAction::getOCGStateCount.

Returns
  The OCG dictionary array.

## ◆ getOCGStateCount()

- (int) getOCGStateCount |  |  |

Get the count of OCG states.

Returns
  The count of OCG states.

## ◆ initWithAction:()

- (id) initWithAction: |  | (FSAction*) | action |

Constructor, with parent class object.

Parameters

  [in] | action | Parent class object.

Reimplemented from FSAction.

## ◆ insertOCGStates:index:state:ocg_dict_array:()

- (int) insertOCGStates: |  | (FSPDFDoc*) | document
index: |  | (int) | index
state: |  | (FSSetOCGStateActionOCGState) | state
ocg_dict_array: |  | (PDFDictionaryArray*) | ocg_dict_array

Insert the OCG states to action.

Parameters

  [in] | document | A valid PDF document object.
  [in] | index | The 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 FSSetOCGStateAction::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] | state | The OCG state to insert.
  [in] | ocg_dict_array | The OCG dictionary array to insert.

Returns
  The index of the inserted OCG states.

## ◆ isRadioButtonStatePreserved()

- (BOOL) isRadioButtonStatePreserved |  |  |

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) removeOCGStates: |  | (int) | index |

Remove the OCG state.

Parameters

  [in] | index | The index of OCG to remove. Valid range: from 0 to (count-1). count is returned by function FSSetOCGStateAction::getOCGStateCount.

Returns
  None.

## ◆ replaceOCGStates:index:ocg_dict_array:()

- (BOOL) replaceOCGStates: |  | (FSPDFDoc*) | document
index: |  | (int) | index
ocg_dict_array: |  | (PDFDictionaryArray*) | ocg_dict_array

Replace the OCG states array.

Parameters

  [in] | document | A valid PDF document object.
  [in] | index | The index of OCG want to replace. Valid range: from 0 to (count-1). count is returned by function FSSetOCGStateAction::getOCGStateCount.
  [in] | ocg_dict_array | The OCG dictionary array to insert.

Returns
  YES means is success, while NO means not.

## ◆ setRadioButtonStatePreserved:()

- (void) setRadioButtonStatePreserved: |  | (BOOL) | is_preserved |

Set the radio-button preserved state.

Parameters

  [in] | is_preserved | The preserved state value.

Returns
  None.