InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IPathStrokerUtils Class Referenceabstract
Inheritance diagram for IPathStrokerUtils:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IPATHSTROKERUTILS }
 
enum  StrokeStyleImportError { kErrorSuccess, kErrorFileDamaged, kFailedToCopyStroke, kErrorUnknown }
 

Public Member Functions

virtual uint32 GetPathStrokerCount (IDocument const *document) const =0
 
virtual IPathStrokerQueryNthPathStroker (IDocument const *document, uint32 index) const =0
 
virtual IPathStrokerListQueryPathStrokerList (IDataBase *db) const =0
 
virtual IPathStrokerListQueryPathStrokerList (IDocument const *document) const =0
 
virtual IPathStrokerList_QueryActivePathStrokerList () const =0
 
virtual bool16 FindNamedPathStroker (IPathStrokerList const *strokerList, PMString const &name, uint32 &index, bool16 useTranslatedNames=kTrue) const =0
 
virtual bool16 FindPathStroker (IPathStrokerList const *strokerList, ClassID const &classId, UID const &uid, uint32 &index) const =0
 
virtual IPathStrokerQueryPathStroker (IPathStrokerList const *strokerList, ClassID const &classId, UID const &uid) const =0
 
virtual IPathStrokerQueryPathStrokerFromGSDesc (IPathStrokerList const *strokerList, IGraphicStyleDescriptor *gsDesc) const =0
 
virtual bool16 IsCustomStroker (IPathStroker const *stroker) const =0
 
virtual bool16 IsCustomStroker (ClassID const &classId, UID const &uid) const =0
 
virtual PMString GetPathStrokerName (IPathStroker const *stroker, bool16 translateName=kTrue) const =0
 
virtual PMString GetUniqueStrokerName (IPathStrokerList const *list, PMString const &basename) const =0
 
virtual IPathStrokerMetadataQueryPathStrokerMetadata (IPathStroker const *stroker) const =0
 
virtual IPathStrokerMetadataQueryPathStrokerMetadata (IPathStrokerList const *strokerList, ClassID const &classId, UID const &uid) const =0
 
virtual uint32 GetMetadataCount () const =0
 
virtual IPathStrokerMetadataQueryNthMetadata (uint32 index) const =0
 
virtual IPathStrokerMetadataQueryPathStrokerMetadataByClass (ClassID const &metadataClass) const =0
 
virtual IPathStrokerMetadataQueryPathStrokerMetadataByName (PMString const &name) const =0
 
virtual bool16 CanStrokerBeDuplicated (IPathStrokerList const *strokerList, ClassID const &classId, UID const &uid) const =0
 
virtual IPathStrokerDuplicatePathStroker (IPathStrokerList const *strokerList, ClassID const &classId, UID const &uid, IDataBase *db, bool16 addToList) const =0
 
virtual IPathStrokerDuplicatePathStroker (IPathStroker const *source, IDataBase *db, bool16 addToList) const =0
 
virtual IPathStrokerNewPathStroker (IPathStrokerMetadata const *metadata, IDataBase *db, bool16 addToList) const =0
 
virtual ErrorCode GetLineStyleUID (UID &uid, IGraphicStyleDescriptor *styleDesc) const =0
 
virtual IGraphicAttrClassIDCreateLineStyleAttribute (UID const &styleUID) const =0
 
virtual ErrorCode AddLineStyleAttribute (UID const &styleUID, IGraphicStyleAttributeBossList *attributeList) const =0
 
virtual ICommandCreateLineStyleCommand (UID const &styleUID, const UIDList *targetItemList, bool16 doPrePost, bool16 enableDoNotify) const =0
 
virtual ErrorCode ReplacePathStrokers (UIDList const &strokerList, ClassID const &replaceClass, UID const &replaceUID) const =0
 
virtual void GetReferencedPathStrokers (IPathStrokerList const *strokerList, SortedUIDList &refdStrokers) const =0
 
virtual ErrorCode SetPathStrokerName (IPathStroker *pathStroker, PMString const &name) const =0
 
virtual ErrorCode DeleteAndReplacePathStroker (UIDList const &deleteList, ClassID const &replaceClass, UID const &replaceUID) const =0
 
virtual
IPathStrokerUtils::StrokeStyleImportError 
ImportStyles (IDFile const &file, IDataBase *destination) const =0
 
virtual
IPathStrokerUtils::StrokeStyleImportError 
ExportStyles (IDFile const &file, IDataBase *source, UIDList const &styles, SysOSType const &creator, SysOSType const &fileType) const =0
 
virtual IScriptCreateStrokeStyleScriptObject (const ScriptInfo::RequestContext &context, IScript *parent, const ClassID &clsID) const =0
 
virtual ErrorCode GetStrokeStyleForGetProperty (IScriptRequestData *data, IScript *script, const ScriptID &propID, IDataBase *db, const ClassID &classID, const UID &uid, bool16 returnName=kFalse) const =0
 
virtual ErrorCode GetStrokeStyleForSetProperty (const IScriptRequestData *data, const ScriptID &propID, IDataBase *&db, ClassID &classID, UID &uid, bool16 allowNone=kFalse) const =0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Member Function Documentation

virtual IPathStrokerList* IPathStrokerUtils::_QueryActivePathStrokerList () const
pure virtual

Queries active IPathStrokerList

Returns
AddRef'd pointer to path stroker list interface, or nil
virtual ErrorCode IPathStrokerUtils::AddLineStyleAttribute (UID const & styleUID,
IGraphicStyleAttributeBossListattributeList 
) const
pure virtual

Adds style attribute to attribute list. Attribute is implicitly given a ClassID of kCustomPathStrokerBoss

Parameters
styleUIDThe UID for the style
attributeListThe list
Returns
kSuccess if successful, else error code
virtual bool16 IPathStrokerUtils::CanStrokerBeDuplicated (IPathStrokerList const * strokerList,
ClassID const & classId,
UID const & uid 
) const
pure virtual

Determines if specified path stroker can be duplicated

Parameters
strokerListThe list
classIdThe class id for the stroker
uidThe UID for the stroker
Returns
kTrue if the stroker can be duplicated, else kFalse
virtual IGraphicAttrClassID* IPathStrokerUtils::CreateLineStyleAttribute (UID const & styleUID) const
pure virtual

Creates new line style attribute. Attribute is implicitly given a ClassID of kCustomPathStrokerBoss.

Parameters
uidThe UID for the style
Returns
AddRef'd pointer to the attribute
virtual ICommand* IPathStrokerUtils::CreateLineStyleCommand (UID const & styleUID,
const UIDListtargetItemList,
bool16 doPrePost,
bool16 enableDoNotify 
) const
pure virtual

Creates command to install line style. Attribute is implicitly given a ClassID of kCustomPathStrokerBoss

Parameters
styleUIDThe UID for the style
targetItemListThe target
doPrePostkTrue if command should use pre/post actions
enableDoNotifykTrue if command should notify
Returns
AddRef'd pointer to command interface, or nil
virtual IScript* IPathStrokerUtils::CreateStrokeStyleScriptObject (const ScriptInfo::RequestContextcontext,
IScriptparent,
const ClassIDclsID 
) const
pure virtual

Built-in strokers aren't persistent, so need to create a proxy object for scripts

Parameters
contextis the request context
parentis the parent script object
clsIDis the stroker class
Returns
IScript* is the proxy script object
virtual ErrorCode IPathStrokerUtils::DeleteAndReplacePathStroker (UIDList const & deleteList,
ClassID const & replaceClass,
UID const & replaceUID 
) const
pure virtual

Deletes and replaces path stroker

Parameters
deleteListList of strokers to delete
replaceClassClass ID for replacement
replaceUIDUID for replacement
virtual IPathStroker* IPathStrokerUtils::DuplicatePathStroker (IPathStrokerList const * strokerList,
ClassID const & classId,
UID const & uid,
IDataBasedb,
bool16 addToList 
) const
pure virtual

Duplicates the given path stroker in the specified database. Does not set stroker's name, nor does it add the stroker to the database's stroker list.

Parameters
classIdThe class id for the stroker
uidThe UID for the stroker
dbThe database in which the stroker is duplicated
addToListIf kTrue, new stroker is added to database's list (its name is made unique)
Returns
The cloned path stroker
virtual IPathStroker* IPathStrokerUtils::DuplicatePathStroker (IPathStroker const * source,
IDataBasedb,
bool16 addToList 
) const
pure virtual

Duplicates the given path stroker in the specified database. Does not set stroker's name, nor does it add the stroker to the database's stroker list.

Parameters
sourceThe path stroker to duplicate
dbThe database in which the stroker is duplicated
addToListIf kTrue, new stroker is added to database's list (its name is made unique)
Returns
The cloned path stroker
virtual IPathStrokerUtils::StrokeStyleImportError IPathStrokerUtils::ExportStyles (IDFile const & file,
IDataBasesource,
UIDList const & styles,
SysOSType const & creator,
SysOSType const & fileType 
) const
pure virtual

Exports line styles to a file

Parameters
fileFile to export styles to
destinationDocument to export styles from
stylesList of styles to export
creatorOutput file creator
fileTypeOutput file type
virtual bool16 IPathStrokerUtils::FindNamedPathStroker (IPathStrokerList const * strokerList,
PMString const & name,
uint32 & index,
bool16 useTranslatedNames = kTrue 
) const
pure virtual

Finds named path stroker in list, returning its index if found

Parameters
strokerListThe list to be searched
nameName of stroker to find
indexOUT param: index of found item if successful
useTranslatedNamesWhether to translate stroker names before compare (default is kTrue)
Returns
kTrue if specified stroker was found, else kFalse
virtual bool16 IPathStrokerUtils::FindPathStroker (IPathStrokerList const * strokerList,
ClassID const & classId,
UID const & uid,
uint32 & index 
) const
pure virtual

Retrieves index of path stroker with given class ID and UID in the given list

Parameters
strokerListThe list to be searched
classIdClass id of stroker
uidUID of stroker
indexOUT param: index of found item if successful
Returns
kTrue if specified stroker was found, else kFalse
virtual ErrorCode IPathStrokerUtils::GetLineStyleUID (UIDuid,
IGraphicStyleDescriptorstyleDesc 
) const
pure virtual

Gets the line style UID from graphic style descriptor

Parameters
uidOUT param: The UID in the descriptor, if successful
styleDescThe style descriptor
Returns
kSuccess if successful, else error code
virtual uint32 IPathStrokerUtils::GetMetadataCount () const
pure virtual

Returns the number of path stroker metadata class known to the application. This number is determined by counting available metadata services and is consequently static

Returns
the number of available path stroker metadata classes
virtual uint32 IPathStrokerUtils::GetPathStrokerCount (IDocument const * document) const
pure virtual

Get number of path strokers for the specified document

Parameters
documentThe document to be checked
Returns
The number of path strokers in the document
virtual PMString IPathStrokerUtils::GetPathStrokerName (IPathStroker const * stroker,
bool16 translateName = kTrue 
) const
pure virtual

Returns name for the stroker. If path stroker is custom, returns the name for the stroker instance; otherwise, returns the name for the stroker class

Parameters
strokerThe name of the path stroker
translateNameWhether to translate the name returned (default is kTrue)
Returns
its name
virtual void IPathStrokerUtils::GetReferencedPathStrokers (IPathStrokerList const * strokerList,
SortedUIDList & refdStrokers 
) const
pure virtual

Retrieves list of referenced path strokers in the specified list

Parameters
strokerListThe path stroker list to search
refdStrokersThe list of referenced strokers
virtual ErrorCode IPathStrokerUtils::GetStrokeStyleForGetProperty (IScriptRequestDatadata,
IScriptscript,
const ScriptIDpropID,
IDataBasedb,
const ClassIDclassID,
const UIDuid,
bool16 returnName = kFalse 
) const
pure virtual

Set the stroke style for a script object into the return data for a get property request

Parameters
datais the script event data [in/out]
dbis the database of the script object [in]
classIDis the ClassID of the line type [in] (see )
uidis the UID of custom line type [in]
returnNameif true, will return the name of the stroke style instead of the object
virtual ErrorCode IPathStrokerUtils::GetStrokeStyleForSetProperty (const IScriptRequestDatadata,
const ScriptIDpropID,
IDataBase *& db,
ClassIDclassID,
UIDuid,
bool16 allowNone = kFalse 
) const
pure virtual

Get the stroke style specified by parameter data for a set property request

Parameters
datais the script event data [in]
propIDis the property id [in]
dbis the database of the script object (reset to the database of the stroke style object) [in/out]
classIDis the ClassID of the line type [out] (see )
uidis the UID of custom line type [out]
allowNoneif true, will return kNonePathStrokerBoss if parameter is empty, nil, or Nothing
virtual PMString IPathStrokerUtils::GetUniqueStrokerName (IPathStrokerList const * list,
PMString const & basename 
) const
pure virtual

Returns a unique name based on given base. Uses same heuristic as is used in the swatch panel (appends 'copy', then 'copy 2', 'copy 3', etc., as necessary)

Parameters
strokerListThe list
basenameName used as the base for the calculated name
Returns
New name guaranteed to be unique in the specified list
virtual IPathStrokerUtils::StrokeStyleImportError IPathStrokerUtils::ImportStyles (IDFile const & file,
IDataBasedestination 
) const
pure virtual

Imports line styles from a file

Parameters
fileFile to import styles from
destinationDocument to import styles into
virtual bool16 IPathStrokerUtils::IsCustomStroker (IPathStroker const * stroker) const
pure virtual

Returns kTrue if stroker is custom

Parameters
strokerThe stroker
Returns
kTrue if stroker is custom, else kFalse if it's built-in
virtual bool16 IPathStrokerUtils::IsCustomStroker (ClassID const & classId,
UID const & uid 
) const
pure virtual

Returns kTrue if stroker is custom

Parameters
classIdClass id of stroker
uidUID of stroker
Returns
kTrue if stroker is custom, else kFalse if it's built-in
virtual IPathStroker* IPathStrokerUtils::NewPathStroker (IPathStrokerMetadata const * metadata,
IDataBasedb,
bool16 addToList 
) const
pure virtual

Creates new instance of path stroker based on metadata

Parameters
metadataThe path stroker metadata to use to create the new instance
dbThe database in which the stroker is duplicated
addToListIf kTrue, new stroker is added to database's list (its name is made unique)
Returns
The new path stroker
virtual IPathStrokerMetadata* IPathStrokerUtils::QueryNthMetadata (uint32 index) const
pure virtual

Queries for path stroker metadata interface by index

Parameters
indexThe index
Returns
AddRef'd pointer to path metadata interface, or nil
virtual IPathStroker* IPathStrokerUtils::QueryNthPathStroker (IDocument const * document,
uint32 index 
) const
pure virtual

Instantiates nth path stroker for the specified document

Parameters
documentThe document
indexIndex of the path stroker to instantiate
Returns
AddRef'd pointer to nth stroker, or nil if failure
virtual IPathStroker* IPathStrokerUtils::QueryPathStroker (IPathStrokerList const * strokerList,
ClassID const & classId,
UID const & uid 
) const
pure virtual

Queries for a path stroker given its ClassID and UID

Parameters
strokerListThe list
classIdClass id of stroker
uidUID of stroker
Returns
AddRef'd pointer to stroker, or nil
virtual IPathStroker* IPathStrokerUtils::QueryPathStrokerFromGSDesc (IPathStrokerList const * strokerList,
IGraphicStyleDescriptorgsDesc 
) const
pure virtual

Queries for a path stroker based on a graphic style descriptor

Parameters
strokerListPath stroker list
gsDescThe style descriptor
Returns
AddRef'd pointer to stroker, or nil
virtual IPathStrokerList* IPathStrokerUtils::QueryPathStrokerList (IDataBasedb) const
pure virtual

Queries for IPathStrokerList interface on given database

Parameters
dbThe database
Returns
AddRef'd pointer to path stroker list interface, or nil
virtual IPathStrokerList* IPathStrokerUtils::QueryPathStrokerList (IDocument const * document) const
pure virtual

Queries for IPathStrokerList interface on given document

Parameters
documentThe database
Returns
AddRef'd pointer to path stroker list interface, or nil
virtual IPathStrokerMetadata* IPathStrokerUtils::QueryPathStrokerMetadata (IPathStroker const * stroker) const
pure virtual

Queries for path stroker's metadata, if it has one. Returns nil if not a custom stroker

Parameters
strokerThe path stroker
Returns
AddRef'd pointer to path stroker metadata interface, or nil
virtual IPathStrokerMetadata* IPathStrokerUtils::QueryPathStrokerMetadata (IPathStrokerList const * strokerList,
ClassID const & classId,
UID const & uid 
) const
pure virtual

Queries for path stroker's metadata, if it has one. Returns nil if not a custom stroker

Parameters
strokerListThe list
classIdClass id of stroker
uidUID of stroker
Returns
AddRef'd pointer to path stroker metadata interface, or nil
virtual IPathStrokerMetadata* IPathStrokerUtils::QueryPathStrokerMetadataByClass (ClassID const & metadataClass) const
pure virtual

Queries for path stroker metadata by class id

Parameters
metadataClassThe class id for the metadata
Returns
AddRef'd pointer to path metadata interface, or nil
virtual IPathStrokerMetadata* IPathStrokerUtils::QueryPathStrokerMetadataByName (PMString const & name) const
pure virtual

Queries for path stroker metadata by name

Parameters
nameThe name of the metadata
Returns
AddRef'd pointer to path metadata interface, or nil
virtual ErrorCode IPathStrokerUtils::ReplacePathStrokers (UIDList const & strokerList,
ClassID const & replaceClass,
UID const & replaceUID 
) const
pure virtual

Replaces instances of path strokers with new instance

Parameters
strokerListUIDList of path strokers to replace
replaceClassClassID of path stroker to replace with
replaceUIDUID of path stroker to replace with
Returns
ErrorCode describing success/failure of function
virtual ErrorCode IPathStrokerUtils::SetPathStrokerName (IPathStrokerpathStroker,
PMString const & name 
) const
pure virtual

Sets the name of a path stroker

Parameters
pathStrokerThe path stroker
nameNew name
Returns
kSuccess, or ErrorCode