![]() |
#include <Context.h>
Public Types | |
enum | OCDrawMode { e_VisibleOC, e_AllOC, e_NoOC } |
OCDrawMode controls drawing or enumerating the page with respect to optional content. More... | |
Public Member Functions | |
Context (const Context &context) | |
Copy constructor. | |
Context & | operator= (const Context &g) |
Context (const class Config &config) | |
Create a context object that represents an optional-content state of the document from a given configuration. | |
~Context () | |
Destructor. | |
bool | IsValid () const |
bool | GetState (const class Group &group) const |
void | SetState (const class Group &group, bool state) |
Sets the ON-OFF states for the given optional-content group (OCG) in this context. | |
void | ResetStates (bool all_on) |
Sets the sates of all OCGs in the context to ON or OFF. | |
void | SetNonOCDrawing (bool draw_non_OC) |
bool | GetNonOCDrawing () const |
void | SetOCDrawMode (OCDrawMode oc_draw_mode) |
Sets the drawing and enumeration type for this context. | |
OCDrawMode | GetOCMode () const |
Each PDFView has a default context (PDF::GetOCGContext()) that it uses for on-screen drawing and that determines the default state for any drawing. The context has flags that control whether to draw content that is marked as optional, and whether to draw content that is not marked as optional.
When enumerating page content, OCG::Context can be passed as a parameter in ElementReader.Begin() method. When using PDFDraw, PDFRasterizer, or PDFView class to render PDF pages use ( PDFDraw::SetOCGContext() method to select an OC context.
There can be more than one Context object, representing different combinations of OCG states. You can change the states of OCGs within any context. You can build contexts with your own combination of OCG states, and issue drawing or enumeration commands using that context. For example, you can pass an optional-content context to ElementReader.Begin(). You can save the resulting state information as part of the configuration (e.g. using Config::SetInit methods), but the context itself has no corresponding PDF representation, and is not saved.
OCDrawMode controls drawing or enumerating the page with respect to optional content.
Together with the value of SetNonOCDrawing this mode controls drawing or enumerating content on a page with optional content:
pdftron::PDF::OCG::Context::Context | ( | const Context & | context | ) |
pdftron::PDF::OCG::Context::Context | ( | const class Config & | config | ) |
Create a context object that represents an optional-content state of the document from a given configuration.
config | A configuration from which to take initial OCG states. |
pdftron::PDF::OCG::Context::~Context | ( | ) |
Destructor.
bool pdftron::PDF::OCG::Context::IsValid | ( | ) | const [inline] |
bool pdftron::PDF::OCG::Context::GetState | ( | const class Group & | group | ) | const |
void pdftron::PDF::OCG::Context::SetState | ( | const class Group & | group, | |
bool | state | |||
) |
void pdftron::PDF::OCG::Context::ResetStates | ( | bool | all_on | ) |
Sets the sates of all OCGs in the context to ON or OFF.
all_on | A flag used to specify whether the OCG states should be set to ON (if true), or OFF (if false). |
void pdftron::PDF::OCG::Context::SetNonOCDrawing | ( | bool | draw_non_OC | ) |
bool pdftron::PDF::OCG::Context::GetNonOCDrawing | ( | ) | const |
void pdftron::PDF::OCG::Context::SetOCDrawMode | ( | OCDrawMode | oc_draw_mode | ) |
OCDrawMode pdftron::PDF::OCG::Context::GetOCMode | ( | ) | const |