Foxit PDF SDK

Public Types | Public Member Functions | List of all members
foxit::pdf::LayerContext Class Reference
Inheritance diagram for foxit::pdf::LayerContext:

## Public Types
enum | UsageType { e_UsageView = 0x0000, e_UsageDesign = 0x0001, e_UsagePrint = 0x0002, e_UsageExport = 0x0003, e_UsageZoom = 0x0004 }
| Enumeration for PDF layer usage type. More...

## Public Member Functions
| LayerContext (const LayerContext &other)
| Constructor, with another layer context object. More...
| LayerContext (const PDFDoc &document, UsageType usage_type)
| Constructor, based on a PDF document and specified layer usage type. More...
| ~LayerContext ()
| Destructor.
bool | CopyStates (const LayerContext &source_context)
| Copy states from another layer context. More...
PDFDoc | GetDocument ()
| Get the related PDF document. More...
UsageType | GetUsageType ()
| Get the layer usage type for rendering. More...
bool | IsEmpty () const
| Check whether current object is empty or not. More...
bool | IsVisible (const LayerNode &layer)
| Check if a specified layer node is visible in current layer context. More...
bool | MergeStates (const LayerContext &source_context)
| Merge states from another layer context. More...
bool | operator!= (const LayerContext &other) const
| Not equal operator. More...
LayerContext & | operator= (const LayerContext &other)
| Assign operator. More...
bool | operator== (const LayerContext &other) const
| Equal operator. More...
bool | Reset ()
| Reset current layer context, back to the initialized state. More...
bool | SetVisible (const LayerNode &layer, bool is_visible)
| Set the visibility of a specified layer node in current layer context. More...
Public Member Functions inherited from foxit::Base
FS_HANDLE | Handle () const
| Get the handle of current object. More...

## Detailed Description

This class represents a layer context for rendering. If user wants to render layers, please construct a layer context object first and then set it to a common::Renderer object by function common::Renderer::SetLayerContext.

See also
  common::Renderer

## Member Enumeration Documentation

## ◆ UsageType

enum foxit::pdf::LayerContext::UsageType

Enumeration for PDF layer usage type.

Values of this enumeration should be used alone.

Enumerator
e_UsageView | Use for a viewer.
e_UsageDesign | Use for representing a document designer's structural organization of artwork.
e_UsagePrint | Use for printing.
e_UsageExport | Use for exporting.
e_UsageZoom | Use for zooming.

## Constructor & Destructor Documentation

## ◆ LayerContext() [1/2]

foxit::pdf::LayerContext::LayerContext | ( | const PDFDoc & | document,
|  | UsageType | usage_type
| ) |  |
| explicit

Constructor, based on a PDF document and specified layer usage type.

Parameters

  [in] | document | A valid PDF document object.
  [in] | usage_type | Layer usage type. Please refer to values starting from LayerContext::e_UsageView and this should be one of these values except LayerContext::e_UsageZoom.

## ◆ LayerContext() [2/2]

foxit::pdf::LayerContext::LayerContext | ( | const LayerContext & | other | ) |

Constructor, with another layer context object.

Parameters

  [in] | other | Another layer context object.

## Member Function Documentation

## ◆ CopyStates()

bool foxit::pdf::LayerContext::CopyStates | ( | const LayerContext & | source_context | ) |

Copy states from another layer context.

Parameters

  [in] | source_context | The source layer context, whose state will be copied to current layer context.

Returns
  true means success, while false means failure.

## ◆ GetDocument()

PDFDoc foxit::pdf::LayerContext::GetDocument | ( |  | ) |

Get the related PDF document.

Returns
  The related PDF document object.

## ◆ GetUsageType()

UsageType foxit::pdf::LayerContext::GetUsageType | ( |  | ) |

Get the layer usage type for rendering.

Returns
  Layer usage type. Please refer to values starting from LayerContext::e_UsageView and this would be one of these values except LayerContext::e_UsageZoom.

## ◆ IsEmpty()

bool foxit::pdf::LayerContext::IsEmpty | ( |  | ) | const

Check whether current object is empty or not.

When the current object is empty, that means current object is useless.

Returns
  true means current object is empty, while false means not.

## ◆ IsVisible()

bool foxit::pdf::LayerContext::IsVisible | ( | const LayerNode & | layer | ) |

Check if a specified layer node is visible in current layer context.

Parameters

  [in] | layer | A layer node. It should belong to the same PDF document which is related to current layer context.

Returns
  true means the layer node is visible, while false means the layer node is invisible.

## ◆ MergeStates()

bool foxit::pdf::LayerContext::MergeStates | ( | const LayerContext & | source_context | ) |

Merge states from another layer context.

Parameters

  [in] | source_context | The source layer context, whose state will be merged to current layer context.

Returns
  true means success, while false means failure.

## ◆ operator!=()

bool foxit::pdf::LayerContext::operator!= | ( | const LayerContext & | other | ) | const

Not equal operator.

Parameters

  [in] | other | Another layer context object. This function will check if current object is not equal to this one.

Returns
  true means not equal, while false means equal.

## ◆ operator=()

LayerContext& foxit::pdf::LayerContext::operator= | ( | const LayerContext & | other | ) |

Assign operator.

Parameters

  [in] | other | Another layer context object, whose value would be assigned to current object.

Returns
  Reference to current object itself.

## ◆ operator==()

bool foxit::pdf::LayerContext::operator== | ( | const LayerContext & | other | ) | const

Equal operator.

Parameters

  [in] | other | Another layer context object. This function will check if current object is equal to this one.

Returns
  true means equal, while false means not equal.

## ◆ Reset()

bool foxit::pdf::LayerContext::Reset | ( |  | ) |

Reset current layer context, back to the initialized state.

Returns
  true means success, while false means failure.

## ◆ SetVisible()

bool foxit::pdf::LayerContext::SetVisible | ( | const LayerNode & | layer,
|  | bool | is_visible
| ) |  |

Set the visibility of a specified layer node in current layer context.

Parameters

  [in] | layer | A layer node. It should belong to the same PDF document which is related to current layer context.
  [in] | is_visible | true means visible, and false means invisible.

Returns
  true means the layer node is visible, while false means the layer node is invisible.