OptionalContentContext Class Documentation
classOptionalContentContextNamespace:datalogics_interface
Detailed Description
An Optional Content Context is a status object that defines the context for optional content within a document.
The context tracks the On/Off status for Optional Content Groups (layers) within a document. It contains flags that control whether to display content that is marked as optional.
Referenced by
Constructor & Destructor Documentation
OptionalContentContext
OptionalContentContext(const Document &document)Parameters
document: const Document &The document for which to create a context.
Creates a context object that represents an optional-content state of the document, using the current state as the initial state for each group (OCG), as determined by the document's optional-content configuration.
OptionalContentContext
OptionalContentContext(OptionalContentContext &&)Parameters
~OptionalContentContext
~OptionalContentContext()Member Function Documentation
clone
Returns:
A copy of the original optional content context.Makes a copy of the optional content context.
get_draw_optional_content
OCDrawingPolicyget_draw_optional_content()Returns:
The drawing policy for optional content in this optional content context.Gets the drawing policy for the optional content in this optional content context.
get_ocg_states
std::vector< bool >get_ocg_states(const std::vector< OptionalContentGroup > &ocgs)Parameters
ocgs: const std::vector< OptionalContentGroup > &A list of optional-content groups whose states are obtained.
Returns:
An array of OCG states corresponding to the array of OCGs, true for ON and false for OFF.Gets the ON-OFF states for the given optional-content groups (OCGs) in the given optional-content context.
get_state_of_ocg
boolget_state_of_ocg(OptionalContentGroup &ocg)Parameters
ocg: OptionalContentGroup &The optional content group whose state will be retrieved.
Returns:
true if the OCG is ON, false if it is OFF.Gets the ON-OFF state for the given optional content group (OCG) in this optional content context.
operator=
Parameters
Returns:
OptionalContentContext &operator==
booloperator==(const OptionalContentContext &other)Parameters
other: const OptionalContentContext &The OptionalContentContext to compare with.
Returns:
true if the two objects refer to the same context, false otherwise.Two OptionalContentContexts are considered equal if they refer to the same underlying optional content context object.
set_draw_optional_content
voidset_draw_optional_content(OCDrawingPolicypolicy)Parameters
policy: OCDrawingPolicyThe new drawing policy for optional content in this optional content context.
Returns:
voidSets the drawing policy for the optional content in this optional content context.
set_ocg_states
voidset_ocg_states(const std::vector< OptionalContentGroup > &ocgs, const std::vector< bool > &new_states)Parameters
ocgs: const std::vector< OptionalContentGroup > &A list of optional-content groups.
new_states: const std::vector< bool > &A list of new OCG states corresponding to the list of OCGs, true for ON and false for OFF. The list must contain as many states as there are non-NULL OCGs in the pdocgs list.
Returns:
voidSets the ON-OFF states for the given optional-content groups (OCGs) in the given optional-content context. The newStates vector must be large enough to hold as many Boolean values as there are OCGs.
set_state_of_ocg
voidset_state_of_ocg(OptionalContentGroup &ocg, boolnew_value)Parameters
ocg: OptionalContentGroup &The optional content group whose state will be set.
new_value: boolThe new ON-OFF state for the optional content group.
Returns:
voidSets the ON-OFF state for the given optional content group (OCG) in this optional content context.
to_string
std::stringto_string()Returns:
A string describing the state of all optional content groups in this context.The string lists all optional content groups in the document along with their ON/OFF states in this context.