Public Member Functions | |
GraphicsObjects (const GraphicsObjects &other) | |
Constructor, with another GraphicsObjects object. More... | |
virtual | ~GraphicsObjects () |
Destructor. | |
bool | GenerateContent () |
Generate contents of current graphics objects. More... | |
POSITION | GetFirstGraphicsObjectPosition (graphics::GraphicsObject::Type filter=graphics::GraphicsObject::e_TypeAll) const |
Get the position of first graphics object in graphics object list, based on type filter. More... | |
graphics::GraphicsObject * | GetGraphicsObject (POSITION position) const |
Get the graphics object by position in graphics object list. More... | |
POSITION | GetLastGraphicsObjectPosition (graphics::GraphicsObject::Type filter=graphics::GraphicsObject::e_TypeAll) const |
Get the position of last graphics object in graphics object list, based on type filter. More... | |
POSITION | GetNextGraphicsObjectPosition (POSITION position, graphics::GraphicsObject::Type filter=graphics::GraphicsObject::e_TypeAll) const |
Get the position of next graphics object in graphics object list, based on type filter and specified current position. More... | |
POSITION | GetPrevGraphicsObjectPosition (POSITION position, graphics::GraphicsObject::Type filter=graphics::GraphicsObject::e_TypeAll) const |
Get the position of previous graphics object in graphics object list, based on type filter and specified current position. More... | |
POSITION | InsertGraphicsObject (POSITION position_insert_after, graphics::GraphicsObject *graphics_object) |
Insert a graphics object after the specified position. More... | |
bool | IsEmpty () const |
Check whether current object is empty or not. More... | |
bool | operator!= (const GraphicsObjects &other) const |
Not equal operator. More... | |
GraphicsObjects & | operator= (const GraphicsObjects &other) |
Assign operator. More... | |
bool | operator== (const GraphicsObjects &other) const |
Equal operator. More... | |
bool | RemoveGraphicsObject (graphics::GraphicsObject *graphics_object) |
Remove a graphics object. More... | |
bool | RemoveGraphicsObjectByPosition (POSITION position) |
Remove a graphics object by position. More... | |
![]() | |
FS_HANDLE | Handle () const |
Get the handle of current object. More... | |
This class is used as a manager for graphics objects. It stores all its graphics objects in a graphics list, and use POSITION object to enumerate them. A valid POSITION object can be used to get one graphics object, insert new graphics object and even remove one.
If any graphics object is changed, or graphics object is inserted/removed, function GraphicsObjects::GenerateContent should be called to ensure that all these changes would be stored to PDF document. Please refer to function GraphicsObjects::GenerateContent for more details.
A PDF page's content usually consists of a sequence of graphics objects, that means PDF page is used like a manager for graphics objects as well. So class pdf::PDFPage is derived from class GraphicsObjects in order that class pdf::PDFPage can retrieve its graphics object.
A form XObject, a kind of graphics object, is a self-contained description of any sequence of graphics objects, so function graphics::FormXObject::GetGraphicsObjects can be used to retrieve a GraphicsObjects object from a form XObject in order to manage graphics objects which are contained in a form XObject.
foxit::pdf::GraphicsObjects::GraphicsObjects | ( | const GraphicsObjects & | other | ) |
Constructor, with another GraphicsObjects object.
[in] | other | Another GraphicsObjects object. |
bool foxit::pdf::GraphicsObjects::GenerateContent | ( | ) |
Generate contents of current graphics objects.
If any graphics object is changed, or graphics object is inserted/removed, this function should be called before saving related PDF document to ensure that all these changes would be stored to PDF document. Since it may takes a long time to generate content, user is not recommended to call this function frequently, but only call this function when necessary, for example, just before the related PDF document is to be saved.
When this function succeeds, and current graphics objects represents a PDF page, user is recommended to re-parse the PDF page function pdf::PDFPage::StartParse with parameter is_reparse true before rendering the page again; otherwise, otherwise, the page content may not be rendered as expected. Please refer to function pdf::PDFPage::StartParse for more details about re-parsing a PDF page.
POSITION foxit::pdf::GraphicsObjects::GetFirstGraphicsObjectPosition | ( | graphics::GraphicsObject::Type | filter = graphics::GraphicsObject::e_TypeAll | ) | const |
Get the position of first graphics object in graphics object list, based on type filter.
After getting a position in the graphics object list, then user can call function GraphicsObjects::GetGraphicsObject to get the graphics object with this position.
[in] | filter | Type filter that specifies which kind of graphics object is to be gotten. Please refer to values starting from graphics::GraphicsObject::e_TypeAll and this should be one of these values. graphics::GraphicsObject::e_TypeAll means for all kinds of graphics objects. Default value: graphics::GraphicsObject::e_TypeAll. |
graphics::GraphicsObject* foxit::pdf::GraphicsObjects::GetGraphicsObject | ( | POSITION | position | ) | const |
Get the graphics object by position in graphics object list.
[in] | position | A POSITION object that indicates the position in the graphics object list. It should not be NULL or 0. |
POSITION foxit::pdf::GraphicsObjects::GetLastGraphicsObjectPosition | ( | graphics::GraphicsObject::Type | filter = graphics::GraphicsObject::e_TypeAll | ) | const |
Get the position of last graphics object in graphics object list, based on type filter.
After getting a position in the graphics object list, then user can call function GraphicsObjects::GetGraphicsObject to get the graphics object with this position.
[in] | filter | Type filter that specifies which kind of graphics object is to be gotten. Please refer to values starting from graphics::GraphicsObject::e_TypeAll and this should be one of these values. graphics::GraphicsObject::e_TypeAll means for all kinds of graphics objects. Default value: graphics::GraphicsObject::e_TypeAll. |
POSITION foxit::pdf::GraphicsObjects::GetNextGraphicsObjectPosition | ( | POSITION | position, |
graphics::GraphicsObject::Type | filter = graphics::GraphicsObject::e_TypeAll |
||
) | const |
Get the position of next graphics object in graphics object list, based on type filter and specified current position.
After getting a position in the graphics object list, then user can call function GraphicsObjects::GetGraphicsObject to get the graphics object with this position.
[in] | position | A POSITION object that indicates a position in the graphics object list, whose next position is to be gotten. It should not be NULL or 0. |
[in] | filter | Type filter that specifies which kind of graphics object is to be gotten. Please refer to values starting from graphics::GraphicsObject::e_TypeAll and this should be one of these values. graphics::GraphicsObject::e_TypeAll means for all kinds of graphics objects. Default value: graphics::GraphicsObject::e_TypeAll. |
POSITION foxit::pdf::GraphicsObjects::GetPrevGraphicsObjectPosition | ( | POSITION | position, |
graphics::GraphicsObject::Type | filter = graphics::GraphicsObject::e_TypeAll |
||
) | const |
Get the position of previous graphics object in graphics object list, based on type filter and specified current position.
After getting a position in the graphics object list, then user can call function GraphicsObjects::GetGraphicsObject to get the graphics object with this position.
[in] | position | A POSITION object that indicates a position in the graphics object list, whose previous position is to be gotten. It should not be NULL or 0. |
[in] | filter | Type filter that specifies which kind of graphics object is to be gotten. Please refer to values starting from graphics::GraphicsObject::e_TypeAll and this should be one of these values. graphics::GraphicsObject::e_TypeAll means for all kinds of graphics objects. Default value: graphics::GraphicsObject::e_TypeAll. |
POSITION foxit::pdf::GraphicsObjects::InsertGraphicsObject | ( | POSITION | position_insert_after, |
graphics::GraphicsObject * | graphics_object | ||
) |
Insert a graphics object after the specified position.
[in] | position_insert_after | Used to specify the position, in order to insert parameter graphics_object after this position. NULL means that parameter graphics_object will be inserted before all objects. |
[in] | graphics_object | A graphics object to be inserted. User should ensure that parameter graphics_object belongs to the same PDF document as current graphics objects. |
bool foxit::pdf::GraphicsObjects::IsEmpty | ( | ) | const |
Check whether current object is empty or not.
When the current object is empty, that means current object is useless.
bool foxit::pdf::GraphicsObjects::operator!= | ( | const GraphicsObjects & | other | ) | const |
Not equal operator.
[in] | other | Another GraphicsObjects object. This function will check if current object is not equal to this one. |
GraphicsObjects& foxit::pdf::GraphicsObjects::operator= | ( | const GraphicsObjects & | other | ) |
Assign operator.
[in] | other | Another GraphicsObjects object, whose value would be assigned to current object. |
bool foxit::pdf::GraphicsObjects::operator== | ( | const GraphicsObjects & | other | ) | const |
Equal operator.
[in] | other | Another GraphicsObjects object. This function will check if current object is equal to this one. |
bool foxit::pdf::GraphicsObjects::RemoveGraphicsObject | ( | graphics::GraphicsObject * | graphics_object | ) |
Remove a graphics object.
To remove a graphics object by position (function GraphicsObjects::RemoveGraphicsObjectByPosition) is more direct and effective than to remove a graphics object directly (function GraphicsObjects::RemoveGraphicsObject).
[in] | graphics_object | A graphics object to be removed. Please ensure this graphics object belongs to current graphics objects. |
bool foxit::pdf::GraphicsObjects::RemoveGraphicsObjectByPosition | ( | POSITION | position | ) |
Remove a graphics object by position.
To remove a graphics object by position (function GraphicsObjects::RemoveGraphicsObjectByPosition) is more direct and effective than to remove a graphics object directly (function GraphicsObjects::RemoveGraphicsObject).
[in] | position | Used to specify the position of a graphics object, to be removed. It should not be NULL or 0. |