InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ILayerList Class Referenceabstract

#include <ILayerList.h>

Inheritance diagram for ILayerList:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_ILAYERLIST }
 
enum  { kAtTheEnd = -1 }
 

Public Member Functions

virtual int32 GetCount () const =0
 
virtual UID FindByName (const PMString &name) const =0
 
virtual IDocumentLayerQueryLayer (int32 n) const =0
 
virtual UIDRef GetLayerUIDRef (int32 n) const =0
 
virtual int32 GetLayerIndex (const IDocumentLayer *docLayer) const =0
 
virtual int32 GetLayerIndex (UID layerUID) const =0
 
virtual void Add (IDocumentLayer *docLayer, int32 pos=kAtTheEnd)=0
 
virtual void Remove (IDocumentLayer *docLayer)=0
 
virtual void Move (int32 from, int32 to)=0
 
virtual UIDRef GetNextActiveLayer (const IDocumentLayer *docLayer) const =0
 
virtual UIDRef GetNextActiveLayer (int32 layerIndex) const =0
 
virtual void GenerateNewLayerName (PMString *pName, bool16 duplicate=kFalse)=0
 
virtual UID GetLeastUsedLayerColor ()=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

An interface off the document (kDocBoss), manages the list of document-wide layers (kDocumentLayerBoss).

See Also
kDocBoss
kDocumentLayerBoss

Member Function Documentation

virtual void ILayerList::Add (IDocumentLayerdocLayer,
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 PMStringname) 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 (PMStringpName,
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
none
Returns
int32 The number of layers in this document.
virtual int32 ILayerList::GetLayerIndex (const IDocumentLayerdocLayer) 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
none
Returns
UID UID of the least used layer color.
virtual UIDRef ILayerList::GetNextActiveLayer (const IDocumentLayerdocLayer) 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.

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.
virtual IDocumentLayer* ILayerList::QueryLayer (int32 n) const
pure virtual

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.
virtual void ILayerList::Remove (IDocumentLayerdocLayer)
pure virtual

Remove the specified layer from the document. Generally only used by the kDeleteLayerCmdBoss.

Parameters
docLayer[IN] The layer to remove from the list.