LayOut C API

- Main Page
- Related Pages
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends 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

enum LOShareLayerAction

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 |

enum LOUnshareLayerAction

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_definition | The layer definition object.
  [out] | document | The document object.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if layer_definition does not refer to a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if document is NULL

LO_RESULT LOLayerGetLayerIndex | ( | LOLayerRef | layer_definition,
|  | size_t * | index
| ) |  |

Returns the index of this layer in the document.

Parameters

  [in] | layer_definition | The layer definition object.
  [out] | index | The index of the layer in the document.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if layer_definition does not refer to a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if index is NULL

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_definition | The layer definition object.
  [in] | page | The page object.
  [out] | layer_instance | The layer instance object.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if layer_definition does not refer to a valid object
  - SU_ERROR_INVALID_INPUT if page does not refer to a valid object and layer_definition is not a shared layer
  - SU_ERROR_NULL_POINTER_OUTPUT if layer_instance is NULL
  - SU_ERROR_OVERWRITE_VALID if *layer_instance already refers to a valid object
  - SU_ERROR_GENERIC if an error occurred attempting to get the layer instance

LO_RESULT LOLayerGetLocked | ( | LOLayerRef | layer_definition,
|  | bool * | is_locked
| ) |  |

Gets whether or not a layer is locked.

Parameters

  [in] | layer_definition | The layer definition object.
  [out] | is_locked | Whether the layer is locked or not.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if layer_definition does not refer to a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if is_locked is NULL

LO_RESULT LOLayerGetName | ( | LOLayerRef | layer_definition,
|  | SUStringRef * | name
| ) |  |

Gets the name of a layer.

Parameters

  [in] | layer_definition | The layer definition object.
  [out] | name | The name of the layer.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if layer_definition does not refer to a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if name is NULL
  - SU_ERROR_INVALID_OUTPUT if name does not refer to a valid object

LO_RESULT LOLayerGetShared | ( | LOLayerRef | layer_definition,
|  | bool * | is_shared
| ) |  |

Gets whether or not a layer is a shared layer.

Parameters

  [in] | layer_definition | The layer definition object.
  [in] | is_shared | Whether the layer is shared or not.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if layer_definition does not refer to a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if is_shared is NULL

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_definition | The layer definition object.
  [in] | is_locked | Whether the layer should be locked or not.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if layer_definition does not refer to a valid object
  - SU_ERROR_GENERIC if the layer could not be locked because it would break the rule that there must be at least one unlocked, visible layer on each page

LO_RESULT LOLayerSetName | ( | LOLayerRef | layer_definition,
|  | const char * | name
| ) |  |

Sets the name of a layer.

Parameters

  [in] | layer_definition | The layer definition object.
  [in] | name | The new name for the layer.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if layer_definition does not refer to a valid object
  - SU_ERROR_NULL_POINTER_INPUT if name is NULL
  - SU_ERROR_UNSUPPORTED if name is an empty string

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_definition | The layer definition object.
  [in] | page | The the page to use when action is LOUnshareLayerAction_CopyToOnePage.
  [in] | action | The action to apply to existing entities on the layer that is being unshared.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if layer_definition does not refer to a valid object
  - SU_ERROR_LAYER_LOCKED if layer_definition is a locked layer
  - SU_ERROR_GENERIC if page does not refer to a valid object and the desired action requires a page
  - SU_ERROR_GENERIC if an error occured attempting to unshare the layer
  - SU_ERROR_OUT_OF_RANGE if action is not a valid value

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_definition | The layer definition object.
  [in] | page | The the page to use when action is LOShareLayerAction_KeepOnePage.
  [in] | action | The action to apply to existing entities on the layer that is being shared.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if layer_definition does not refer to a valid object
  - SU_ERROR_LAYER_LOCKED if layer_definition is a locked layer
  - SU_ERROR_GENERIC if page does not refer to a valid object and the desired action requires a page
  - SU_ERROR_GENERIC if an error occured attempting to share the layer
  - SU_ERROR_OUT_OF_RANGE if action is not a valid value