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

#include <IGraphicLayerInfo.h>

Inheritance diagram for IGraphicLayerInfo:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IGRAPHICLAYERINFO }
 
enum  UpdateLinkOption { kUnknownLinkOption = 0, kUseApplicationSettings, kKeepOverrides }
 
enum  GraphicLayerFlags {
  kNoFlags = 0, kNeedsValidation = (1L << 1), kValidationFailed = (1L << 2), kValidationNewLayersAdded = (1L << 3),
  kInternalUseOnly = (1L << 28)
}
 
enum  GraphicVisibilityState { kVisibilityHidden, kVisibilityShowing, kVisibilityUnknown }
 
enum  LayerAttributes {
  kNoAttributes = 0, kLayerSeparator = (1L << 0), kLayerAdjustment = (1L << 1), kLayerHasFX = (1L << 2),
  kLayerIsLocked = (1L << 3), kLayerHasViewState = (1L << 4), kLayerViewStateON = (1L << 5), kLayerHasExportState = (1L << 6),
  kLayerExportStateON = (1L << 7), kLayerHasPrintState = (1L << 8), kLayerPrintStateON = (1L << 9), kLayerSectionDivider = (1L << 10),
  kLayerIsTextLayer = (1L << 11)
}
 

Public Member Functions

virtual void SetIsInitialized (bool16 bIsInitialized)=0
 
virtual void SetUpdateLinkOption (const UpdateLinkOption newOption)=0
 
virtual void SetGraphicLayerFlags (const GraphicLayerFlags newFlags)=0
 
virtual bool16 GetIsInitialized () const =0
 
virtual UpdateLinkOption GetUpdateLinkOption () const =0
 
virtual GraphicLayerFlags GetGraphicLayerFlags () const =0
 
virtual void InsertLayer (const PMString &layerName, int32 layerUniqueID, const GraphicVisibilityState origVisState, int32 parentID=-1, const LayerAttributes layerAttributes=kNoAttributes)=0
 
virtual void AppendLayer (const PMString &layerName, int32 layerUniqueID, const GraphicVisibilityState origVisState, int32 parentID=-1, const LayerAttributes layerAttributes=kNoAttributes)=0
 
virtual void RemoveNthLayer (int32 layerIndex)=0
 
virtual void RemoveLayer (int32 layerUniqueID)=0
 
virtual void Clear ()=0
 
virtual void Copy (const IGraphicLayerInfo *srcLayerInfo)=0
 
virtual bool16 CompareAll (const IGraphicLayerInfo *otherLayerInfo) const =0
 
virtual bool16 CompareVisibility (const IGraphicLayerInfo *otherLayerInfo) const =0
 
virtual bool16 ValidateGraphicLayers (const IGraphicLayerInfo *srcLayerInfo)=0
 
virtual bool16 VisibilityChanged () const =0
 
virtual void ResetLayerVisiblity ()=0
 
virtual void Preallocate (int32 preallocSize)=0
 
virtual void SetNthLayerName (int32 layerIndex, const PMString &newName)=0
 
virtual void SetLayerName (int32 layerUniqueID, const PMString &newName)=0
 
virtual void SetNthLayerUniqueID (int32 layerIndex, int32 newID)=0
 
virtual void SetNthLayerOriginalVisibility (int32 layerIndex, const GraphicVisibilityState newState)=0
 
virtual void SetLayerOriginalVisibility (int32 layerUniqueID, const GraphicVisibilityState newState)=0
 
virtual void SetNthLayerCurrentVisibility (int32 layerIndex, const GraphicVisibilityState newState)=0
 
virtual void SetLayerCurrentVisibility (int32 layerUniqueID, const GraphicVisibilityState newState)=0
 
virtual void SetNthLayerParentID (int32 layerIndex, int32 newParentID)=0
 
virtual void SetLayerParentID (int32 layerUniqueID, int32 newParentID)=0
 
virtual void SetNthLayerAttributes (int32 layerIndex, const LayerAttributes newAttributes)=0
 
virtual void SetLayerAttributes (int32 layerUniqueID, const LayerAttributes newAttributes)=0
 
virtual int32 GetNumberLayers () const =0
 
virtual PMString GetNthLayerName (int32 layerIndex) const =0
 
virtual PMString GetLayerName (int32 layerUniqueID) const =0
 
virtual int32 GetNthLayerUniqueID (int32 layerIndex) const =0
 
virtual int32 GetLayerIndex (int32 layerUniqueID) const =0
 
virtual GraphicVisibilityState GetNthLayerOriginalVisibility (int32 layerIndex) const =0
 
virtual GraphicVisibilityState GetLayerOriginalVisibility (int32 layerUniqueID) const =0
 
virtual GraphicVisibilityState GetNthLayerCurrentVisibility (int32 layerIndex) const =0
 
virtual GraphicVisibilityState GetLayerCurrentVisibility (int32 layerUniqueID) const =0
 
virtual int32 GetNthLayerParentID (int32 layerIndex) const =0
 
virtual int32 GetLayerParentID (int32 layerUniqueID) const =0
 
virtual LayerAttributes GetNthLayerAttributes (int32 layerIndex) const =0
 
virtual LayerAttributes GetLayerAttributes (int32 layerUniqueID) const =0
 
virtual bool16 ValidateGraphicLayersByName (const IGraphicLayerInfo *srcLayerInfo)=0
 
virtual void SetLayerVisibilityFromSource (const IGraphicLayerInfo *srcLayerInfo, GraphicVisibilityState newLayersState, bool16 &hasNewLayers)=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 for holding the graphic layer information for placed graphics such as Photoshop (PSD) files. This assumes that all layer names are unique.

Member Enumeration Documentation

This enum is a bitfield for flags controlling the layer information.
Enumerator
kNoFlags 

the default attribute is no flags, or 0

kNeedsValidation 

requires validation

kValidationFailed 

failed validation

kValidationNewLayersAdded 

new layers added with source file's layer visibility

kInternalUseOnly 

for internal use only

This enum represents the visibility state of the layer. Used for both original visibility state and current visibility state.
Enumerator
kVisibilityHidden 

the layer is not showing, or hidden

kVisibilityShowing 

the layer is visible, or showing

kVisibilityUnknown 

the state of the layer is unknown

This enum is a bitfield for the attributes of the layer.
Enumerator
kNoAttributes 

the default attribute is no attribute, or 0

kLayerSeparator 

if this bit is on, the layer is a separator layer. It might only be a placeholder, and may not be visible. Layers of this type will not show the eyeball icon in the list, and the visibility does not affect its children.

kLayerAdjustment 

if this bit is on, the layer is an adjustment layer.

kLayerHasFX 

if this bit is on, the layer has an effect.

kLayerIsLocked 

if this bit is on, the layer visibility is locked.

kLayerHasViewState 

if this bit is on, the layer has a Usage descriptor with ViewState. Use kLayerViewStateON to determine if on or off.

kLayerViewStateON 

if this bit is on, the layer has a Usage descriptor with ViewState turned ON.

kLayerHasExportState 

if this bit is on, the layer has a Usage descriptor with ExportState. Use kLayerExportStateON to determine if on or off.

kLayerExportStateON 

if this bit is on, the layer has a Usage descriptor with ExportState turned ON.

kLayerHasPrintState 

if this bit is on, the layer has a Usage descriptor with PrintState. Use kLayerPrintStateON to determine if on or off.

kLayerPrintStateON 

if this bit is on, the layer has a Usage descriptor with PrintState turned ON.

kLayerSectionDivider 

if this bit is on, the layer is a section divider layer. It is a layer set placeholder in PSD files. Turning the visibility off for a layer section divider will affect any children.

kLayerIsTextLayer 

if this bit is on, the layer is a text layer. Currently we are only detecting this in PSD files.

This enum is a bitfield for the update link options.
Enumerator
kUnknownLinkOption 

Unknown option

kUseApplicationSettings 

if this option is set, the layer visibility is taken from the file being imported, no overrides are applied.

kKeepOverrides 

if this option is set, the layer visibility current overrides are applied to the file being imported.

Member Function Documentation

virtual void IGraphicLayerInfo::AppendLayer (const PMStringlayerName,
int32 layerUniqueID,
const GraphicVisibilityState origVisState,
int32 parentID = -1,
const LayerAttributes layerAttributes = kNoAttributes 
)
pure virtual

Append a layer to the interface. The layer will be appended onto the end of the list. It is assumed that all layers are uniquely IDed.

Parameters
layerNameIN a PMString containing a layer name.
layerUniqueIDIN a unique ID that can represent the layer
origVisStateIN the original visibility state at the time the layer is added. The current visibility state is set to the original visibility state when the layer is added.
parentIDIN the unique ID of the parent layer, if this layer is nested. Default of -1.
layerAttributesIN a enum bitfield of the layer attributes. Default of kNoAttributes, or 0.
virtual void IGraphicLayerInfo::Clear ()
pure virtual

Clear all layers out of the interface.

virtual bool16 IGraphicLayerInfo::CompareAll (const IGraphicLayerInfootherLayerInfo) const
pure virtual

Compare all information from the given interface to this interface.

Parameters
otherLayerInfoIN the other IGraphicLayerInfo to compare to.
Returns
bool16 - kTrue if they are equal, kFalse otherwise.
virtual bool16 IGraphicLayerInfo::CompareVisibility (const IGraphicLayerInfootherLayerInfo) const
pure virtual

Uses the unique ids from the given interface to compare the current visibility in this interface to the current visibility of the other interface.

Parameters
otherLayerInfoIN the other IGraphicLayerInfo to compare to.
Returns
bool16 - kTrue if the current visibilities are equal, kFalse otherwise.
virtual void IGraphicLayerInfo::Copy (const IGraphicLayerInfosrcLayerInfo)
pure virtual

Copy all information from the given interface into this interface. This will perform a Clear() on the existing information prior to the copy.

Parameters
srcLayerInfoIN the source IGraphicLayerInfo to copy from.
virtual GraphicLayerFlags IGraphicLayerInfo::GetGraphicLayerFlags () const
pure virtual

Get the current graphic layer flags.

Returns
GraphicLayerFlags - see the enum GraphicLayerFlags for values.
virtual bool16 IGraphicLayerInfo::GetIsInitialized () const
pure virtual

Get if the interface has been initialized.

Returns
bool16 - kTrue if the layer information has been initialized.
virtual LayerAttributes IGraphicLayerInfo::GetLayerAttributes (int32 layerUniqueID) const
pure virtual

Get the attributes of the layer with the given name.

Parameters
layerUniqueIDIN the unique ID of the layer to retrieve.
Returns
LayerAttributes of the layer's attributes (see LayerAttributes definition above).
virtual GraphicVisibilityState IGraphicLayerInfo::GetLayerCurrentVisibility (int32 layerUniqueID) const
pure virtual

Get the current visibility state of the layer with the given name.

Parameters
layerUniqueIDIN the unique ID of the layer to retrieve.
Returns
GraphicVisibilityState of the layer's current visibility state. See the GraphicVisibilityState enum definition above.
virtual int32 IGraphicLayerInfo::GetLayerIndex (int32 layerUniqueID) const
pure virtual

Get the index of the layer with the given unique ID.

Parameters
layerUniqueIDIN the unique ID of the layer to retrieve.
Returns
int32 of the layer's index.
virtual PMString IGraphicLayerInfo::GetLayerName (int32 layerUniqueID) const
pure virtual

Get the name of the layer with the given unique ID.

Parameters
layerUniqueIDIN the unique ID of the layer to retrieve.
Returns
PMString of the layer's name.
virtual GraphicVisibilityState IGraphicLayerInfo::GetLayerOriginalVisibility (int32 layerUniqueID) const
pure virtual

Get the original visibility state of the layer with the given name.

Parameters
layerUniqueIDIN the unique ID of the layer to retrieve.
Returns
GraphicVisibilityState of the layer's original visibility state. See the GraphicVisibilityState enum definition above.
virtual int32 IGraphicLayerInfo::GetLayerParentID (int32 layerUniqueID) const
pure virtual

Get the parent index of the layer with the given name.

Parameters
layerUniqueIDIN the unique ID of the layer to retrieve.
Returns
int32 of the layer's parent unique ID. Defaults to -1.
virtual LayerAttributes IGraphicLayerInfo::GetNthLayerAttributes (int32 layerIndex) const
pure virtual

Get the attributes bitfield of the layer of the given layer index.

Parameters
layerIndexIN the index of the layer attributes to retrieve.
Returns
LayerAttributes of the layer's attributes (see LayerAttributes definition above).
virtual GraphicVisibilityState IGraphicLayerInfo::GetNthLayerCurrentVisibility (int32 layerIndex) const
pure virtual

Get the current visibility state of the layer of the given layer index.

Parameters
layerIndexIN the index of the layer state to retrieve.
Returns
GraphicVisibilityState of the layer's current visibility state. See the GraphicVisibilityState enum definition above.
virtual PMString IGraphicLayerInfo::GetNthLayerName (int32 layerIndex) const
pure virtual

Get the name of the layer of the given layer index.

Parameters
layerIndexIN the index of the layer name to retrieve.
Returns
PMString of the layer name.
virtual GraphicVisibilityState IGraphicLayerInfo::GetNthLayerOriginalVisibility (int32 layerIndex) const
pure virtual

Get the original visibility state of the layer of the given layer index.

Parameters
layerIndexIN the index of the layer state to retrieve.
Returns
GraphicVisibilityState of the layer's original visibility state. See the GraphicVisibilityState enum definition above.
virtual int32 IGraphicLayerInfo::GetNthLayerParentID (int32 layerIndex) const
pure virtual

Get the parent index of the layer of the given layer index.

Parameters
layerIndexIN the index of the layer parent index to retrieve.
Returns
int32 of the layer's parent unique ID. Defaults to -1.
virtual int32 IGraphicLayerInfo::GetNthLayerUniqueID (int32 layerIndex) const
pure virtual

Get the unique ID of the layer of the given layer index.

Parameters
layerIndexIN the index of the layer ID to retrieve.
Returns
int32 of the layer's internal unique ID (see AddLayer() above).
virtual int32 IGraphicLayerInfo::GetNumberLayers () const
pure virtual

Get the number of layers currently stored in the interface. For use when iterating through the layers, setting or getting specific information.

Returns
int32 of the number of layers.
virtual UpdateLinkOption IGraphicLayerInfo::GetUpdateLinkOption () const
pure virtual

Get the current update link option.

Returns
UpdateLinkOption - see the enum UpdateLinkOption for values.
virtual void IGraphicLayerInfo::InsertLayer (const PMStringlayerName,
int32 layerUniqueID,
const GraphicVisibilityState origVisState,
int32 parentID = -1,
const LayerAttributes layerAttributes = kNoAttributes 
)
pure virtual

Insert a layer into the interface. The layer will be inserted into the front of the list. It is assumed that all layers are uniquely IDed.

Parameters
layerNameIN a PMString containing a layer name.
layerUniqueIDIN a unique ID that can represent the layer
origVisStateIN the original visibility state at the time the layer is added. The current visibility state is set to the original visibility state when the layer is added.
parentIDIN the unique ID of the parent layer, if this layer is nested. Default of -1.
layerAttributesIN a enum bitfield of the layer attributes. Default of kNoAttributes, or 0.
virtual void IGraphicLayerInfo::Preallocate (int32 preallocSize)
pure virtual

Preallocate the layer list to this size. If it is known before hand how many layers will be added to the interface, use this to preallocate the number of entries.

Parameters
preallocSizeIN the number of entries that will be added to the list.
virtual void IGraphicLayerInfo::RemoveLayer (int32 layerUniqueID)
pure virtual

Remove a layer from the interface.

Parameters
layerUniqueIDIN the ID of the layer to remove. Layer IDs are assumed to be unique.
virtual void IGraphicLayerInfo::RemoveNthLayer (int32 layerIndex)
pure virtual

Remove a layer from the interface.

Parameters
layerIndexIN the index of the layer to remove.
virtual void IGraphicLayerInfo::ResetLayerVisiblity ()
pure virtual

Resets the current visibility state to the original visibility state for all layers.

virtual void IGraphicLayerInfo::SetGraphicLayerFlags (const GraphicLayerFlags newFlags)
pure virtual

Set new graphic layer flags. It is the callers responsibility to OR in their new flag with the existing flags, retrieved through GetGraphicLayerFlags().

Parameters
newFlagsIN see the enum GraphicLayerFlags for values.
virtual void IGraphicLayerInfo::SetIsInitialized (bool16 bIsInitialized)
pure virtual

Set if the interface has been initialized.

Parameters
bIsInitializedIN kTrue if the layer information has been initialized.
virtual void IGraphicLayerInfo::SetLayerAttributes (int32 layerUniqueID,
const LayerAttributes newAttributes 
)
pure virtual

Set the layer attributes of a given layer name. The attributes are overwritten, so use GetLayerAttributes(), and turn on/off bits as desired prior to calling this method.

Parameters
layerUniqueIDIN the unique ID of the layer to change.
newAttributesIN the new attributes to be given to the layer.
virtual void IGraphicLayerInfo::SetLayerCurrentVisibility (int32 layerUniqueID,
const GraphicVisibilityState newState 
)
pure virtual

Set the layer current visibility state of a given layer name.

Parameters
layerUniqueIDIN the unique ID of the layer to change.
newStateIN the new current visibility state to be given to the layer.
virtual void IGraphicLayerInfo::SetLayerName (int32 layerUniqueID,
const PMStringnewName 
)
pure virtual

Set the layer name of a layer with the given unique ID.

Parameters
layerUniqueIDIN the unique ID of the layer to change.
newNameIN the new name of the layer.
virtual void IGraphicLayerInfo::SetLayerOriginalVisibility (int32 layerUniqueID,
const GraphicVisibilityState newState 
)
pure virtual

Set the layer original visibility state of a given layer name.

Parameters
layerUniqueIDIN the unique ID of the layer to change.
newStateIN the new original visibility state to be given to the layer.
virtual void IGraphicLayerInfo::SetLayerParentID (int32 layerUniqueID,
int32 newParentID 
)
pure virtual

Set the parent index of a given layer name.

Parameters
layerUniqueIDIN the unique ID of the layer to change.
newParentIDIN the new parent's unique ID to be given to the layer.
virtual void IGraphicLayerInfo::SetLayerVisibilityFromSource (const IGraphicLayerInfosrcLayerInfo,
GraphicVisibilityState newLayersState,
bool16 & hasNewLayers 
)
pure virtual

Set the current visibility of the layers from the source layers. This method matches layers based on layer name and not index.

Parameters
srcLayerInfoIN the layer info to copy visibility state from
newLayerStateIN the visibility state to use for layers not present in source (new layers). Pass in kVisibilityUnknown if you want to retain the new layers original visibility. hasNewLayers OUT kTrue, if the target layers contain additional new layers
Returns
None
virtual void IGraphicLayerInfo::SetNthLayerAttributes (int32 layerIndex,
const LayerAttributes newAttributes 
)
pure virtual

Set the layer attributes of a given layer index. The attributes are overwritten, so use GetLayerAttributes(), and turn on/off bits as desired prior to calling this method.

Parameters
layerIndexIN the index of the layer to change.
newAttributesIN the new attributes to be given to the layer.
virtual void IGraphicLayerInfo::SetNthLayerCurrentVisibility (int32 layerIndex,
const GraphicVisibilityState newState 
)
pure virtual

Set the layer current visibility state of a given layer index.

Parameters
layerIndexIN the index of the layer to change.
newStateIN the new current visibility state to be given to the layer.
virtual void IGraphicLayerInfo::SetNthLayerName (int32 layerIndex,
const PMStringnewName 
)
pure virtual

Set the layer name of a given layer index.

Parameters
layerIndexIN the index of the layer to rename.
newNameIN the new name to be given to the layer
virtual void IGraphicLayerInfo::SetNthLayerOriginalVisibility (int32 layerIndex,
const GraphicVisibilityState newState 
)
pure virtual

Set the layer original visibility state of a given layer index.

Parameters
layerIndexIN the index of the layer to change.
newStateIN the new original visibility state to be given to the layer.
virtual void IGraphicLayerInfo::SetNthLayerParentID (int32 layerIndex,
int32 newParentID 
)
pure virtual

Set the parent index of a given layer index.

Parameters
layerIndexIN the index of the layer to change.
newParentIDIN the new parent's unique ID to be given to the layer.
virtual void IGraphicLayerInfo::SetNthLayerUniqueID (int32 layerIndex,
int32 newID 
)
pure virtual

Set the layer unique ID of a given layer index.

Parameters
layerIndexIN the index of the layer to change.
newIDIN the new ID to be given to the layer. Does not change the index of the layer, only the internal unique ID stored with the layer.
virtual void IGraphicLayerInfo::SetUpdateLinkOption (const UpdateLinkOption newOption)
pure virtual

Set the update link option. See the UpdateLinkOption enum for options.

Parameters
newOptionIN see the enum UpdateLinkOption for values.
virtual bool16 IGraphicLayerInfo::ValidateGraphicLayers (const IGraphicLayerInfosrcLayerInfo)
pure virtual

Validate the graphic layers with another interface. Will compare the layer IDs and layer names based on the IDs, and if they all match it will return kTrue. NOTE: it compares based on the srcLayerInfo number of layers - this interface may have more layers, but it will only compare based on srcLayerInfo.

Parameters
srcLayerInfoIN the source IGraphicLayerInfo to use.
Returns
bool16 - kTrue if the IDs and names exist, kFalse otherwise.
virtual bool16 IGraphicLayerInfo::ValidateGraphicLayersByName (const IGraphicLayerInfosrcLayerInfo)
pure virtual

Validate the graphic layers with another interface. Will compare the layer IDs and layer names based on the IDs, and if they all match it will return kTrue. NOTE: it compares based on the srcLayerInfo number of layers - this interface may have more layers, but it will only compare based on srcLayerInfo. Used for PDF and placed InDesign document graphics items.

Parameters
srcLayerInfoIN the source IGraphicLayerInfo to use.
Returns
bool16 - kTrue if the IDs and names exist, kFalse otherwise.
virtual bool16 IGraphicLayerInfo::VisibilityChanged () const
pure virtual

Compare the original visibility to the current visibility in this interface.

Returns
bool16 - kTrue if they are not equal, kFalse the visibility has not changed.