InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SnpManipulateTrapStyles Class Reference

Classes

struct  TrapStyleData
 

Public Member Functions

ErrorCode InspectTrapStyle (const UIDRef &trapStyle, IDocument *document=nil)
 
ErrorCode AddTrapStyle (ITrapStyleListMgr *trapStyleListMgr, const PMString &newTrapStyleName, UIDRef &newTrapStyle, const bool16 nameLocked=kFalse, const bool16 editLocked=kFalse, const bool16 deleteLocked=kFalse)
 
ErrorCode ModifyTrapStyle (ITrapStyleListMgr *trapStyleListMgr, const int32 trapStyleIndex, ITrapStyle *newTrapData, const bool16 updateLockInfo=kFalse, const bool16 nameLocked=kFalse, const bool16 editLocked=kFalse, const bool16 deleteLocked=kFalse)
 
ErrorCode DeleteTrapStyle (ITrapStyleListMgr *trapStyleListMgr, const int32 trapStyleIndex)
 
ErrorCode AssignTrapStyleToPages (const UIDRef &trapStyle, const UIDList &pageUIDList)
 
K2Vector< PMStringGetTrapStyleNames (ITrapStyleListMgr *trapStyleListMgr)
 
TrapStyleData GetTrapStyleData (const UIDRef &trapStyle)
 
ITrapStyleCreateNewTrapStyleBasedOn (const UIDRef &trapStyle)
 
void CopyTrapStyleData (const TrapStyleData &trapStyleData, ITrapStyle *trapStyle)
 
UIDList GetAllPagesInDocument (IDocument *document)
 

Detailed Description

  • A code snippet that shows how to manipulate trap styles in a document.

,

Author
Ken Sadahiro

Member Function Documentation

ErrorCode SnpManipulateTrapStyles::AddTrapStyle (ITrapStyleListMgrtrapStyleListMgr,
const PMStringnewTrapStyleName,
UIDRefnewTrapStyle,
const bool16 nameLocked = kFalse,
const bool16 editLocked = kFalse,
const bool16 deleteLocked = kFalse 
)

Add a new trap style with the given name.

Parameters
trapStyleListMgrIN The ITrapStyleListMgr to which you want to add the trap style.
newTrapStyleNameIN The name of the trap style to add.
newTrapStyleOUT The UIDRef of the new trap style.
nameLockedIN If kTrue, the name of the new trap style cannot be modified.
editLockedIN If kTrue, the new trap style cannot be modified.
deleteLockedIN If kTrue, the new trap style cannot be deleted.
Returns
Status code. kSuccess if success.
See Also
ITrapStyleListMgr::AddStyle
ErrorCode SnpManipulateTrapStyles::AssignTrapStyleToPages (const UIDReftrapStyle,
const UIDListpageUIDList 
)

Assigns the trap style to a list of pages.

Parameters
trapStyleIN The trap style to apply.
pageUIDListIN The list of pages to which the trap styles are applied.
Returns
Status code. kSuccess if success.
See Also
ITrapStyleUtils::AssignStyleToPageList
void SnpManipulateTrapStyles::CopyTrapStyleData (const TrapStyleDatatrapStyleData,
ITrapStyletrapStyle 
)

Utility method: Copies trap style data from a TrapStyleData struct and puts it into a non-persistent trap style boss.

Parameters
trapStyleDataIN The trap style data to set.
trapStyleIN/OUT The trap style to set. This should be non-persistent, as this method will call its Set methods. The data in the boss will also be modified by this routine.
See Also
ITrapStyle
ITrapStyle * SnpManipulateTrapStyles::CreateNewTrapStyleBasedOn (const UIDReftrapStyle)

Utility method: Creates a temporary, non-persistent trap style boss based on an existing trap style, and sets some data so it can be used by ModifyTrapStyle.

Parameters
trapStyleIN The trap style to base the temporary trap style on.
Returns
Non-persistent instance of kTrapStyleBoss. This interface is AddRef'ed, so make sure you release it when no longer needed.
See Also
kTrapStyleBoss
ITrapStyle
ErrorCode SnpManipulateTrapStyles::DeleteTrapStyle (ITrapStyleListMgrtrapStyleListMgr,
const int32 trapStyleIndex 
)

Delete an existing trap style.

Parameters
trapStyleListMgrIN The ITrapStyleListMgr from which you want to delete the trap style.
trapStyleIndexIN The index of the trap style to delete.
Returns
Status code. kSuccess if success.
See Also
ITrapStyleListMgr::DeleteNthStyle
UIDList SnpManipulateTrapStyles::GetAllPagesInDocument (IDocumentdocument)

Utility method: Gets a list of all pages in a document.

Parameters
documentIN The document to get pages from.
Returns
UIDList of all pages in the document.
SnpManipulateTrapStyles::TrapStyleData SnpManipulateTrapStyles::GetTrapStyleData (const UIDReftrapStyle)

Utility method: Gets trap style data and puts it into a TrapStyleData struct.

Parameters
trapStyleIN The trap style to read.
Returns
TrapStyleData struct.
See Also
ITrapStyle
K2Vector< PMString > SnpManipulateTrapStyles::GetTrapStyleNames (ITrapStyleListMgrtrapStyleListMgr)

Utility method: Gets trap style names.

Parameters
trapStyleListMgrIN The trap style list manager to get trap style names from
Returns
A vector of trap style names.
See Also
ITrapStyleListMgr
ErrorCode SnpManipulateTrapStyles::InspectTrapStyle (const UIDReftrapStyle,
IDocumentdocument = nil 
)

Inspects a trap style, and displays some of the settings to SNIPLOG.

Parameters
trapStyleIN The trap style (kTrapStyleBoss) to examine.
documentIN The document to examine pages for assigned trap styles. If nil, trapstyles on pages will not be reported.
See Also
kTrapStyleBoss
ITrapStyle
IGenStyleLockInfo
IPageList
kPageBoss
IPersistUIDData (IID_ITRAPSTYLEUIDDATA, defined in PrintID.h)
Returns
kSuccess on success, other ErrorCode otherwise.
ErrorCode SnpManipulateTrapStyles::ModifyTrapStyle (ITrapStyleListMgrtrapStyleListMgr,
const int32 trapStyleIndex,
ITrapStylenewTrapData,
const bool16 updateLockInfo = kFalse,
const bool16 nameLocked = kFalse,
const bool16 editLocked = kFalse,
const bool16 deleteLocked = kFalse 
)

Modify an existing trap style.

NOTE: ITrapStyleListMgr doesn't inherit from IGenEdtStlListMgr like IPrStStyleListMgr does, so the EditNthStyle method behaves a bit differently between the two interfaces. For instance, the parameters and the return type are all different between ITrapStyleListMgr::EditNthStyle and IPrStStyleListMgr::EditNthStyle. And while the IPrStStyleListMgr::EditNthStyle implementation does open a dialog box, ITrapStyleListMgr::EditNthStyle does not.

Parameters
trapStyleListMgrIN The ITrapStyleListMgr that contains the trap style to modify.
trapStyleIndexIN The index of the trap style to modify.
newTrapDataIN The trap data to modify with.
updateLockInfoIN If kTrue, the nameLocked, editLocked, and deleteLocked parameters will be updated in the trap style. Otherwise, the nameLocked, editLocked, and deleteLocked parameters will be ignored.
nameLockedIN If kTrue, the name of the new trap style cannot be modified.
editLockedIN If kTrue, the new trap style cannot be modified.
deleteLockedIN If kTrue, the new trap style cannot be deleted.
Returns
Status code. kSuccess if success.
See Also
ITrapStyleListMgr::EditNthStyle