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

#include <ILayerUtils.h>

Inheritance diagram for ILayerUtils:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_ILAYERUTILS }
 
enum  CountLayersFlags { kFlagOff = ((int32)0), kFlagOn = ((int32)1), kDontCare = ((int32)0xFFFFFFFF) }
 
enum  {
  kLayerNotUsed = 0x0000, kLayerContainsArtwork = 0x0001, kLayerContainsGuides = 0x0002, kLayerHasPlaceGunOwnedItem = 0x0004,
  kLayerContainsBoth = kLayerContainsArtwork | kLayerContainsGuides
}
 

Public Member Functions

virtual LayerFlags IsLayerUsed (IDocumentLayer *docLayer)=0
 
virtual int32 CountLayers (const ILayerList *layerList, int32 isLocked=kDontCare, int32 isVisible=kDontCare, int32 isGuideLocked=kDontCare, int32 isGuideVisible=kDontCare, int32 isUILayer=kDontCare, int32 isExpendable=kDontCare, UID colorUID=(UID) kDontCare)=0
 
virtual bool16 AnyLayersHidden (IDocument *document, int32 *numHidden=nil)=0
 
virtual bool16 AnyLayersLocked (IDocument *document, int32 *numLocked=nil)=0
 
virtual bool16 AreLayersUnlockedAndVisible (const UIDList *pageItems)=0
 
virtual bool16 IsActiveLayerUnlockedAndVisible (const ILayoutControlData *layoutData)=0
 
virtual ICommandMakeUnlockShowLayerCmd (IControlView *controlView, IDocumentLayer *docLayer=nil)=0
 
virtual UID GetLayerUID (const IHierarchy *theItem)=0
 
virtual IDocumentLayerQueryDocumentActiveLayer (const IDocument *document)=0
 
virtual ErrorCode GetDestinationLayers (IScriptRequestData *data, ISpread *spread, K2Vector< InterfacePtr< ISpreadLayer > > &destinationLayerList)=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

Utilities for use for dealing with layers on the model side.

Member Enumeration Documentation

anonymous enum

Enum flags for IsLayerUsed return value.

Flags to pass to CountLayers.

Member Function Documentation

virtual bool16 ILayerUtils::AnyLayersHidden (IDocumentdocument,
int32 * numHidden = nil 
)
pure virtual

Determine if any UI layers in this document are hidden.

Parameters
documentthe document to check.
numHiddenOUT the number of hidden layers, may be nil.
Returns
returns kTrue if one or more UI layers are hidden, kFalse otherwise.
virtual bool16 ILayerUtils::AnyLayersLocked (IDocumentdocument,
int32 * numLocked = nil 
)
pure virtual

Determine if any UI layers in this document are locked.

Parameters
documentthe document to check.
numLockedOUT the number of locked layers, may be nil.
Returns
returns kTrue if one or more UI layers are locked, kFalse otherwise.
virtual bool16 ILayerUtils::AreLayersUnlockedAndVisible (const UIDListpageItems)
pure virtual

Determine if page items are on unlocked and visible layers (therefore are editable). Used to enable/disable clipboard or drag/drop operations.

Parameters
pageItemsUIDList of page items to check.
Returns
return kTrue if all items in list are on unlocked, visible layers, kFalse otherwise.
virtual int32 ILayerUtils::CountLayers (const ILayerListlayerList,
int32 isLocked = kDontCare,
int32 isVisible = kDontCare,
int32 isGuideLocked = kDontCare,
int32 isGuideVisible = kDontCare,
int32 isUILayer = kDontCare,
int32 isExpendable = kDontCare,
UID colorUID = (UID) kDontCare 
)
pure virtual

Count the document layers having the specified attributes (one or more attributes may be used). Most often this will be used via the::defines at top of file.

Parameters
layerListILayerList* to examine.
isLockedkFlagOn if you want to count IDocumentLayer->IsLocked layers, kFlagOff if you want to count unlocked layers, kDontCare otherwise
isVisiblekFlagOn if you want to count IDocumentLayer->IsVisible layers, kFlagOff if you want to count hidden layers, kDontCare otherwise
isGuideLockedkFlagOn if you want to count IDocumentLayer->IsGuideLocked layers, kFlagOff if you want to count unlocked guide layers, kDontCare otherwise
isGuideVisiblekFlagOn if you want to count IDocumentLayer->IsGuideVisible layers, kFlagOff if you want to count hidden guide layers, kDontCare otherwise
isUILayerkFlagOn if you want to count IDocumentLayer->IsUILayer layers, kFlagOff if you want to count non-UI layers, kDontCare otherwise
isExpendablekFlagOn if you want to count IDocumentLayer->IsExpendable layers, kFlagOff if you want to count non-expendable, kDontCare otherwise
colorUIDUID of layers with given IDocumentLayer->GetColorUID, kDontCare otherwise.
Returns
the number of layers meeting the given parameter requirements.
virtual ErrorCode ILayerUtils::GetDestinationLayers (IScriptRequestDatadata,
ISpreadspread,
K2Vector< InterfacePtr< ISpreadLayer > > & destinationLayerList 
)
pure virtual

Handle the optional p_DestinationLayer parameter for scripting events. Returns the current active layer for the given spread if the parameter wasn't supplied for this request.

Parameters
dataIN the IScriptRequestData associated with the script request
spreadIN the spread to return the layer for
destinationLayerListOUT the destination layer(s)
Returns
kSuccess or an error code
virtual UID ILayerUtils::GetLayerUID (const IHierarchytheItem)
pure virtual

Determine the UID of the spread layer containing the specified item by walking up the hierarchy.

Parameters
theIteman IHierarchy* interface for the item to check its layer.
Returns
UID of spread layer containing the specified item.
virtual bool16 ILayerUtils::IsActiveLayerUnlockedAndVisible (const ILayoutControlDatalayoutData)
pure virtual

Determine if active layer is unlocked and visible (and therefore editable). Useful to determine if active layer can be acted upon (e.g. by a tracker).

Parameters
layoutDataILayoutControlData for the layout view to check.
Returns
return kTrue active layer is unlocked and visible, kFalse otherwise.
virtual LayerFlags ILayerUtils::IsLayerUsed (IDocumentLayerdocLayer)
pure virtual

Does this layer have content on it? (Looks on all spreads and master spreads). Can be expensive, use with caution.

Parameters
docLayerIN the document layer to check for content.
Returns
what kind of content is on this layer? See enum above.
virtual ICommand* ILayerUtils::MakeUnlockShowLayerCmd (IControlViewcontrolView,
IDocumentLayerdocLayer = nil 
)
pure virtual

Helper function to create a command to unlock and or show the active layer (by default) or any layer.

Parameters
controlViewIN the control view for the layout view
docLayerIN nil if you want to unlock/show the active layer, or a particular layer
Returns
Command to unlock and/or show the layer. Caller must release.
virtual IDocumentLayer* ILayerUtils::QueryDocumentActiveLayer (const IDocumentdocument)
pure virtual

Get the active document layer for the specified document. Works even when a document window isn't open.

Parameters
documentIN the document to return the active layer for.
Returns
the active document layer.