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

Go to the source code of this file.

Enumerations

enum  LOShareLayerAction { LOShareLayerAction_Clear, LOShareLayerAction_KeepOnePage, LOShareLayerAction_MergeAllPages, LONumShareLayerActions }
 Defines the different ways to manage entities when sharing a layer. More...
 
enum  LOUnshareLayerAction { LOUnshareLayerAction_Clear, LOUnshareLayerAction_CopyToOnePage, LOUnshareLayerAction_CopyToAllPages, LONumUnshareLayerActions }
 Defines the different ways to manage entities when making a layer non-shared. More...
 

Functions

LO_RESULT LOLayerGetName (LOLayerRef layer_definition, SUStringRef *name)
 Gets the name of a layer. More...
 
LO_RESULT LOLayerSetName (LOLayerRef layer_definition, const char *name)
 Sets the name of a layer. More...
 
LO_RESULT LOLayerGetLocked (LOLayerRef layer_definition, bool *is_locked)
 Gets whether or not a layer is locked. More...
 
LO_RESULT LOLayerSetLocked (LOLayerRef layer_definition, bool is_locked)
 Sets whether or not a layer is locked. When setting a layer to locked, there must be at least one other unlocked and visible layer on every page. If this is not the case, then the next layer will be automatically unlocked and made visible on all pages as necessary to proceed with the operation. More...
 
LO_RESULT LOLayerGetShared (LOLayerRef layer_definition, bool *is_shared)
 Gets whether or not a layer is a shared layer. More...
 
LO_RESULT LOLayerSetShared (LOLayerRef layer_definition, LOPageRef page, LOShareLayerAction action)
 Shares a layer. If action is LOShareLayerAction_Clear or LOShareLayerAction_MergeAllPages, then page may be an invalid object. More...
 
LO_RESULT LOLayerSetNonShared (LOLayerRef layer_definition, LOPageRef page, LOUnshareLayerAction action)
 Unshares a layer. If action is LOUnshareLayerAction_Clear or LOUnshareLayerAction_CopyToAllPages, then page may be an invalid object. More...
 
LO_RESULT LOLayerGetLayerInstance (LOLayerRef layer_definition, LOPageRef page, LOLayerInstanceRef *layer_instance)
 Gets the layer instance for the given layer definition on a given page. If layer_definition specifies a shared layer, page may be an invalid object. More...
 
LO_RESULT LOLayerGetLayerIndex (LOLayerRef layer_definition, size_t *index)
 Returns the index of this layer in the document. More...
 
LO_RESULT LOLayerGetDocument (LOLayerRef layer_definition, LODocumentRef *document)
 Returns the document that this layer belongs to. More...
 

Enumeration Type Documentation

Defines the different ways to manage entities when sharing a layer.

Enumerator
LOShareLayerAction_Clear 

Delete all entities on the layer.

LOShareLayerAction_KeepOnePage 

Keep the entities on the specified page.

LOShareLayerAction_MergeAllPages 

Merge the entities from all pages.

LONumShareLayerActions 

Defines the different ways to manage entities when making a layer non-shared.

Enumerator
LOUnshareLayerAction_Clear 

Delete all entities on the layer.

LOUnshareLayerAction_CopyToOnePage 

Copy entities to the specified page.

LOUnshareLayerAction_CopyToAllPages 

Copy entities to all pages.

LONumUnshareLayerActions 

Function Documentation

LO_RESULT LOLayerGetDocument ( LOLayerRef  layer_definition,
LODocumentRef document 
)

Returns the document that this layer belongs to.

Since
LayOut 2018, API 3.0
Parameters
[in]layer_definitionThe layer definition object.
[out]documentThe document object.
Returns
LO_RESULT LOLayerGetLayerIndex ( LOLayerRef  layer_definition,
size_t *  index 
)

Returns the index of this layer in the document.

Parameters
[in]layer_definitionThe layer definition object.
[out]indexThe index of the layer in the document.
Returns
LO_RESULT LOLayerGetLayerInstance ( LOLayerRef  layer_definition,
LOPageRef  page,
LOLayerInstanceRef layer_instance 
)

Gets the layer instance for the given layer definition on a given page. If layer_definition specifies a shared layer, page may be an invalid object.

Parameters
[in]layer_definitionThe layer definition object.
[in]pageThe page object.
[out]layer_instanceThe layer instance object.
Returns
LO_RESULT LOLayerGetLocked ( LOLayerRef  layer_definition,
bool *  is_locked 
)

Gets whether or not a layer is locked.

Parameters
[in]layer_definitionThe layer definition object.
[out]is_lockedWhether the layer is locked or not.
Returns
LO_RESULT LOLayerGetName ( LOLayerRef  layer_definition,
SUStringRef name 
)

Gets the name of a layer.

Parameters
[in]layer_definitionThe layer definition object.
[out]nameThe name of the layer.
Returns
LO_RESULT LOLayerGetShared ( LOLayerRef  layer_definition,
bool *  is_shared 
)

Gets whether or not a layer is a shared layer.

Parameters
[in]layer_definitionThe layer definition object.
[in]is_sharedWhether the layer is shared or not.
Returns
LO_RESULT LOLayerSetLocked ( LOLayerRef  layer_definition,
bool  is_locked 
)

Sets whether or not a layer is locked. When setting a layer to locked, there must be at least one other unlocked and visible layer on every page. If this is not the case, then the next layer will be automatically unlocked and made visible on all pages as necessary to proceed with the operation.

Parameters
[in]layer_definitionThe layer definition object.
[in]is_lockedWhether the layer should be locked or not.
Returns
LO_RESULT LOLayerSetName ( LOLayerRef  layer_definition,
const char *  name 
)

Sets the name of a layer.

Parameters
[in]layer_definitionThe layer definition object.
[in]nameThe new name for the layer.
Returns
LO_RESULT LOLayerSetNonShared ( LOLayerRef  layer_definition,
LOPageRef  page,
LOUnshareLayerAction  action 
)

Unshares a layer. If action is LOUnshareLayerAction_Clear or LOUnshareLayerAction_CopyToAllPages, then page may be an invalid object.

Parameters
[in]layer_definitionThe layer definition object.
[in]pageThe the page to use when action is LOUnshareLayerAction_CopyToOnePage.
[in]actionThe action to apply to existing entities on the layer that is being unshared.
Returns
LO_RESULT LOLayerSetShared ( LOLayerRef  layer_definition,
LOPageRef  page,
LOShareLayerAction  action 
)

Shares a layer. If action is LOShareLayerAction_Clear or LOShareLayerAction_MergeAllPages, then page may be an invalid object.

Parameters
[in]layer_definitionThe layer definition object.
[in]pageThe the page to use when action is LOShareLayerAction_KeepOnePage.
[in]actionThe action to apply to existing entities on the layer that is being shared.
Returns