LayOut C API
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Enumerations | Functions
page.h File Reference
#include <LayOutAPI/common.h>
#include <LayOutAPI/model/defs.h>

Go to the source code of this file.

Enumerations

enum  LOPageEntityIteratorFlags { LOPageEntityIteratorFlags_None = 0x0, LOPageEntityIteratorFlags_SkipHidden = 0x1, LOPageEntityIteratorFlags_SkipLocked = 0x2, LOPageEntityIteratorFlags_SkipHiddenOrLocked = 0x3 }
 Defines the options that are available when creating a LOEntityIteratorRef for iterating the entities on a page. More...
 

Functions

LO_RESULT LOPageGetName (LOPageRef page, SUStringRef *name)
 Gets the name of a page. More...
 
LO_RESULT LOPageSetName (LOPageRef page, const char *name)
 Sets the name of a page. More...
 
LO_RESULT LOPageGetInPresentation (LOPageRef page, bool *in_presentation)
 Gets whether or not a page is included in presentations. More...
 
LO_RESULT LOPageSetInPresentation (LOPageRef page, bool in_presentation)
 Sets whether or not a page is included in presentations. More...
 
LO_RESULT LOPageGetLayerVisible (LOPageRef page, LOLayerRef layer_definition, bool *visible)
 Gets whether or not a layer is visible on a page. Layers in LayOut exist on every page in a document. Each page specifies the visibility of each layer for that page. More...
 
LO_RESULT LOPageSetLayerVisible (LOPageRef page, LOLayerRef layer_definition, bool visible)
 Sets whether or not a layer is visible on a page. Layers in LayOut exist on every page in a document. Each page specifies the visibility of each layer for that page. More...
 
LO_RESULT LOPageGetLayerInstances (LOPageRef page, size_t array_size, LOLayerInstanceRef layer_instances[], size_t *number_copied)
 Gets references to all the layer instances for a page. The layer instances are in the same order that the layer definitions exist in the document. Use LODocumentGetNumberOfLayers to determine how many layer instances will be returned by this function. More...
 
LO_RESULT LOPageGetLayerInstanceAtIndex (LOPageRef page, size_t index, LOLayerInstanceRef *layer_instance)
 Gets a reference to the layer instance at the given index for this page. The layer instances are in the same order that the layer definitions exist in the document. Use LODocumentGetNumberOfLayers to determine how many layer definitions exist in the document. More...
 
LO_RESULT LOPageGetPageIndex (LOPageRef page, size_t *index)
 Gets the index of this page in the document. More...
 
LO_RESULT LOPageGetNumberOfNonSharedEntities (LOPageRef page, size_t *num_nonshared_entities)
 Gets the number of entities at the top of the group hierarchy, on non-shared layers for the given page. This count will include LOGroupRef entities so the group hierarchy can be traversed. More...
 
LO_RESULT LOPageGetNonSharedEntityAtIndex (LOPageRef page, size_t index, LOEntityRef *entity)
 Gets the non-shared entity at the top of the group hierarchy at the specified index for the given page. More...
 
LO_RESULT LOPageGetNonSharedEntities (LOPageRef page, LOEntityListRef entity_list)
 Populates a LOEntityListRef with the entities at the top of the group hierarchy, on non-shared layers for the given page. This will include LOGroupRef entities so the group hierarchy can be traversed. More...
 
LO_RESULT LOPageCreateEntityIterator (LOPageRef page, LOPageEntityIteratorFlags flags, LOEntityIteratorRef *entity_iterator)
 Creates a new entity iterator for the given page. See LOPageEntityIteratorFlags for valid options for flags. This iterator will visit all entities on the page in exactly the same order they are drawn, including entities on shared layers. Entity group hierarchy is ignored with this iterator, so groups are skipped. This is the recommended method for entity iteration when drawing or exporting. More...
 
LO_RESULT LOPageCreateReverseEntityIterator (LOPageRef page, LOPageEntityIteratorFlags flags, LOEntityIteratorRef *entity_iterator)
 Creates a new reverse entity iterator for the given page. See LOPageEntityIteratorFlags for valid options for flags. This iterator will visit all entities on the page in the reverse order they are drawn, including entities on shared layers. Entity group hierarchy is ignored with this iterator, so groups are skipped. This is the recommended method for entity iteration when picking. More...
 
LO_RESULT LOPageGetDocument (LOPageRef page, LODocumentRef *document)
 Returns the document that this page belongs to. More...
 

Enumeration Type Documentation

Defines the options that are available when creating a LOEntityIteratorRef for iterating the entities on a page.

Enumerator
LOPageEntityIteratorFlags_None 

Default iterator behavior. Does not skip any entities.

LOPageEntityIteratorFlags_SkipHidden 

Skip entities on hidden layers.

LOPageEntityIteratorFlags_SkipLocked 

Skip entities on locked layers.

LOPageEntityIteratorFlags_SkipHiddenOrLocked 

Skip entities on hidden or locked layers.

Function Documentation

LO_RESULT LOPageCreateEntityIterator ( LOPageRef  page,
LOPageEntityIteratorFlags  flags,
LOEntityIteratorRef entity_iterator 
)

Creates a new entity iterator for the given page. See LOPageEntityIteratorFlags for valid options for flags. This iterator will visit all entities on the page in exactly the same order they are drawn, including entities on shared layers. Entity group hierarchy is ignored with this iterator, so groups are skipped. This is the recommended method for entity iteration when drawing or exporting.

Parameters
[in]pageThe page object.
[in]flagsFlags indicating what entities to include.
[out]entity_iteratorThe entity iterator object.
Returns
LO_RESULT LOPageCreateReverseEntityIterator ( LOPageRef  page,
LOPageEntityIteratorFlags  flags,
LOEntityIteratorRef entity_iterator 
)

Creates a new reverse entity iterator for the given page. See LOPageEntityIteratorFlags for valid options for flags. This iterator will visit all entities on the page in the reverse order they are drawn, including entities on shared layers. Entity group hierarchy is ignored with this iterator, so groups are skipped. This is the recommended method for entity iteration when picking.

Parameters
[in]pageThe page object.
[in]flagsFlags indicating what entities to include.
[out]entity_iteratorThe entity iterator object.
Returns
LO_RESULT LOPageGetDocument ( LOPageRef  page,
LODocumentRef document 
)

Returns the document that this page belongs to.

Since
LayOut 2018, API 3.0
Parameters
[in]pageThe page object.
[out]documentThe document object.
Returns
LO_RESULT LOPageGetInPresentation ( LOPageRef  page,
bool *  in_presentation 
)

Gets whether or not a page is included in presentations.

Parameters
[in]pageThe page object.
[out]in_presentationWhether the page will be in a presentation.
Returns
LO_RESULT LOPageGetLayerInstanceAtIndex ( LOPageRef  page,
size_t  index,
LOLayerInstanceRef layer_instance 
)

Gets a reference to the layer instance at the given index for this page. The layer instances are in the same order that the layer definitions exist in the document. Use LODocumentGetNumberOfLayers to determine how many layer definitions exist in the document.

Parameters
[in]pageThe page object.
[in]indexThe index of the layer instance to get.
[out]layer_instanceThe layer instance object.
Returns
LO_RESULT LOPageGetLayerInstances ( LOPageRef  page,
size_t  array_size,
LOLayerInstanceRef  layer_instances[],
size_t *  number_copied 
)

Gets references to all the layer instances for a page. The layer instances are in the same order that the layer definitions exist in the document. Use LODocumentGetNumberOfLayers to determine how many layer instances will be returned by this function.

Parameters
[in]pageThe page object.
[in]array_sizeThe size of the array to copy into.
[out]layer_instancesThe layer instances.
[out]number_copiedThe number of layer instances copied.
Returns
LO_RESULT LOPageGetLayerVisible ( LOPageRef  page,
LOLayerRef  layer_definition,
bool *  visible 
)

Gets whether or not a layer is visible on a page. Layers in LayOut exist on every page in a document. Each page specifies the visibility of each layer for that page.

Parameters
[in]pageThe page object.
[in]layer_definitionThe layer definition object.
[out]visibleWhether or not the layer is visible.
Returns
LO_RESULT LOPageGetName ( LOPageRef  page,
SUStringRef name 
)

Gets the name of a page.

Parameters
[in]pageThe page object.
[out]nameThe name of the page.
Returns
LO_RESULT LOPageGetNonSharedEntities ( LOPageRef  page,
LOEntityListRef  entity_list 
)

Populates a LOEntityListRef with the entities at the top of the group hierarchy, on non-shared layers for the given page. This will include LOGroupRef entities so the group hierarchy can be traversed.

Parameters
[in]pageThe page object.
[out]entity_listThe entity list to populate.
Returns
LO_RESULT LOPageGetNonSharedEntityAtIndex ( LOPageRef  page,
size_t  index,
LOEntityRef entity 
)

Gets the non-shared entity at the top of the group hierarchy at the specified index for the given page.

Parameters
[in]pageThe page object.
[in]indexThe 0-based entity index for the desired non-shared entity.
[out]entityThe entity object.
Returns
LO_RESULT LOPageGetNumberOfNonSharedEntities ( LOPageRef  page,
size_t *  num_nonshared_entities 
)

Gets the number of entities at the top of the group hierarchy, on non-shared layers for the given page. This count will include LOGroupRef entities so the group hierarchy can be traversed.

Parameters
[in]pageThe page object.
[out]num_nonshared_entitiesThe number of non-shared entities.
Returns
LO_RESULT LOPageGetPageIndex ( LOPageRef  page,
size_t *  index 
)

Gets the index of this page in the document.

Parameters
[in]pageThe page object.
[out]indexThe index of the page in the document.
Returns
LO_RESULT LOPageSetInPresentation ( LOPageRef  page,
bool  in_presentation 
)

Sets whether or not a page is included in presentations.

Parameters
[in]pageThe page object.
[in]in_presentationWhether the page should be in a presentation.
Returns
LO_RESULT LOPageSetLayerVisible ( LOPageRef  page,
LOLayerRef  layer_definition,
bool  visible 
)

Sets whether or not a layer is visible on a page. Layers in LayOut exist on every page in a document. Each page specifies the visibility of each layer for that page.

Parameters
[in]pageThe page object.
[in]layer_definitionThe layer definition object.
[in]visibleWhether or not the layer should be visible.
Returns
LO_RESULT LOPageSetName ( LOPageRef  page,
const char *  name 
)

Sets the name of a page.

Parameters
[in]pageThe page object.
[in]nameThe new name of the page.
Returns