#include <ILayerList.h>
|
| enum | { kDefaultIID = IID_ILAYERLIST } |
| |
| enum | { kAtTheEnd = -1 } |
| |
An interface off the document (kDocBoss), manages the list of document-wide layers (kDocumentLayerBoss).
- See Also
- kDocBoss
- kDocumentLayerBoss
| virtual void ILayerList::Add | ( | IDocumentLayer * | docLayer, | | | int32 | pos = kAtTheEnd | | ) | | |
| pure virtual |
Add a new layer to the document at the (optionally) specified location. Generally this will only be used by the kNewLayerCmdBoss.
- Parameters
| docLayer | [IN] The layer to add to the document layer list. The list holds the reference. |
| kAtTheEnd | [IN] Position of the layer. |
| virtual UID ILayerList::FindByName | ( | const PMString & | name | ) | const |
| pure virtual |
Return the UID of the document layer with the specified name.
- Parameters
| name | [IN] The name of the layer you are finding. |
- Returns
- UID The UID of the layer found, kInvalidUID if not found.
| virtual void ILayerList::GenerateNewLayerName | ( | PMString * | pName, | | | bool16 | duplicate = kFalse | | ) | | |
| pure virtual |
Generates a unique layer name, of the form "Layer 1", "Layer 2", .... If the duplicate flag is set, and the suggested name is used, a 'copy n' will be appended
- Parameters
| pName | [IN] The base name of the layer. |
| duplicate | [IN] Return 'copy n' appended to the name if kTrue, otherwise don't. |
| virtual int32 ILayerList::GetCount | ( | | ) | const |
| pure virtual |
Return the number of layers in this document.
- Parameters
- Returns
- int32 The number of layers in this document.
| virtual int32 ILayerList::GetLayerIndex | ( | const IDocumentLayer * | docLayer | ) | const |
| pure virtual |
Return the index of the specified layer in this document.
- Parameters
| docLayer | [IN] The document layer you are requesting the index for. |
- Returns
- int32 index (0-based) of the layer, -1 if not found.
| virtual int32 ILayerList::GetLayerIndex | ( | UID | layerUID | ) | const |
| pure virtual |
return the index of the specified layer in this document
- Parameters
| layerUID | [IN] The UID of the layer you are want the index for. |
- Returns
- int32 The index of the layer (0-based), or -1 if not found.
| virtual UIDRef ILayerList::GetLayerUIDRef | ( | int32 | n | ) | const |
| pure virtual |
Return the n'th layer in this document by UIDRef.
- Parameters
| n | [IN] index of layer to return. |
- Returns
- UIDRef The returned document layer, invalid if index out of range.
| virtual UID ILayerList::GetLeastUsedLayerColor | ( | | ) | |
| pure virtual |
Returns the least used layer color. Generally the next UI color in the list.
- Parameters
- Returns
- UID UID of the least used layer color.
Returns the next candidate for an active layer. It looks for the first visible, unlocked layer in front of the given one, then in back, then the next visible, but perhaps locked, then the next layer period. Returns nil, if there are no other layers.
- Parameters
| docLayer | [IN] The layer for where to start looking for next candidate. |
- Returns
- IDocumentLayer The "future" active layer, may be nil.
| virtual UIDRef ILayerList::GetNextActiveLayer | ( | int32 | layerIndex | ) | const |
| pure virtual |
Returns the next candidate for an active layer. It looks for the first visible, unlocked layer in front of the given one, then in back, then the next visible, but perhaps locked, then the next layer period. Returns nil, if there are no other layers. This version is useful if the old layer has already been removed and you have its index.
- Parameters
| layerIndex | [IN] The layer index for where to start looking for next candidate. |
- Returns
- IDocumentLayer* The "future" active layer, may be nil.
| virtual void ILayerList::Move | ( | int32 | from, | | | int32 | to | | ) | | |
| pure virtual |
Move the layer at location 'from' to a new location 'to' (i.e. change the stacking order of the layers. Generally only used by the kMoveLayerCmdBoss.
- Parameters
| from | [IN] The index of the layer to move. |
| to | [IN] The index to insert the layer in the list. May be kAtTheEnd. |
Return the n'th layer in this document. Caller is responsible for calling Release().
- Parameters
| n | [IN] index of layer to return. |
- Returns
- IDocumentLayer* The returned document layer, nil if index out of range.
Remove the specified layer from the document. Generally only used by the kDeleteLayerCmdBoss.
- Parameters
| docLayer | [IN] The layer to remove from the list. |