![]() |
#include <OCMD.h>
Public Types | |
enum | VisibilityPolicyType { e_AllOn, e_AnyOn, e_AnyOff, e_AllOff } |
Visibility Policy Type. More... | |
Public Member Functions | |
OCMD (SDF::Obj ocmd) | |
Creates a new optional-content group membership dictionary (OCMD) object from an existing SDF/Cos object. | |
bool | IsValid () const |
SDF::Obj | GetOCGs () const |
Returns the optional-content groups listed under 'OCGs' entry in the object dictionary. | |
VisibilityPolicyType | GetVisibilityPolicy () const |
Returns the optional-content membership dictionary's visibility policy, which determines the visibility of content with respect to the ON-OFF state of OCGs listed in the dictionary. | |
void | SetVisibilityPolicy (VisibilityPolicyType vis_policy) |
Sets the optional-content membership dictionary's visibility policy, which determines the visibility of content with respect to the ON-OFF state of OCGs listed in the dictionary. | |
SDF::Obj | GetVisibilityExpression () const |
bool | IsCurrentlyVisible (const class Context &context) const |
SDF::Obj | GetSDFObj () const |
OCMD (const OCMD &g) | |
Copy constructor. | |
OCMD & | operator= (const OCMD &g) |
Static Public Member Functions | |
static OCMD | Create (PDFDoc &doc, SDF::Obj ocgs, VisibilityPolicyType vis_policy) |
Creates a new optional-content membership dictionary (OCMD) object in the given document for the given groups and visibility policy. |
The object directly corresponds to the OCMD dictionary (Section 4.10.1 'Optional Content Groups' in PDF Reference).
An OCMD collects a set of OCGs. It sets a visibility policy, so that content in the member groups is visible only when all groups are ON or OFF, or when any of the groups is ON or OFF. This makes it possible to set up complex dependencies among groups. For example, an object can be visible only if some other conditions are met (such as if another layer is visible).
Visibility Policy Type.
A Visibility Policy is used to determine whether an PDF::Element is visible in a given OCG::Context, depending on whether all groups in OCGs array are "ON" or "OFF", or when any of the groups is "ON" or "OFF".
pdftron::PDF::OCG::OCMD::OCMD | ( | SDF::Obj | ocmd | ) |
Creates a new optional-content group membership dictionary (OCMD) object from an existing SDF/Cos object.
pdftron::PDF::OCG::OCMD::OCMD | ( | const OCMD & | g | ) |
Copy constructor.
static OCMD pdftron::PDF::OCG::OCMD::Create | ( | PDFDoc & | doc, | |
SDF::Obj | ocgs, | |||
VisibilityPolicyType | vis_policy | |||
) | [static] |
Creates a new optional-content membership dictionary (OCMD) object in the given document for the given groups and visibility policy.
doc | The document in which the new OCMD will be created. | |
ocgs | An array of optional-content groups (OCGs) to be members of the dictionary. | |
policy | The visibility policy that determines the visibility of content with respect to the ON-OFF state of OCGs listed in the dictionary. |
bool pdftron::PDF::OCG::OCMD::IsValid | ( | ) | const |
SDF::Obj pdftron::PDF::OCG::OCMD::GetOCGs | ( | ) | const |
Returns the optional-content groups listed under 'OCGs' entry in the object dictionary.
VisibilityPolicyType pdftron::PDF::OCG::OCMD::GetVisibilityPolicy | ( | ) | const |
Returns the optional-content membership dictionary's visibility policy, which determines the visibility of content with respect to the ON-OFF state of OCGs listed in the dictionary.
void pdftron::PDF::OCG::OCMD::SetVisibilityPolicy | ( | VisibilityPolicyType | vis_policy | ) |
Sets the optional-content membership dictionary's visibility policy, which determines the visibility of content with respect to the ON-OFF state of OCGs listed in the dictionary.
vis_policy | New visibility policy. |
SDF::Obj pdftron::PDF::OCG::OCMD::GetVisibilityExpression | ( | ) | const |
bool pdftron::PDF::OCG::OCMD::IsCurrentlyVisible | ( | const class Context & | context | ) | const |
context | The context in which the visibility of content is tested. |
SDF::Obj pdftron::PDF::OCG::OCMD::GetSDFObj | ( | ) | const |