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

#include <IMasterSpreadUtils.h>

Inheritance diagram for IMasterSpreadUtils:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IMASTERSPREADUTILS }
 

Public Member Functions

virtual bool16 _IsFrontViewAMaster ()=0
 
virtual void BuildMasterSpreadList (IStringListControlData *stringData, UIDList *masterUIDs, bool16 bIncludeNone, UID excludeUID)=0
 
virtual bool16 IsAnAncestorOf (IMasterSpreadList *masterList, UID masterA, UID masterB)=0
 
virtual void GetAncestorsOf (IMasterSpreadList *masterSpreadList, UID masterUID, UIDList *ancestors)=0
 
virtual void TopoSortMasterSpread (IMasterSpreadList *masterSpreadList, UIDList *sortedList)=0
 
virtual bool16 IsMasterAppliedToPage (UID masterUID, IPMUnknown *page) const =0
 
virtual UIDList GetUnusedMasterUIDs (IDocument *doc)=0
 
virtual int32 CountPagesWithMaster (UIDList *masterUIDs, int32 *mastersWithMaster=nil, UIDList *pageUIDs=nil)=0
 
virtual bool16 OverrideMasterPageItem (const UIDRef masterItem, const UIDRef pageToOverrideOn, ICommand::Undoability undoability=ICommand::kAutoUndo, UIDRef *overriddenItem=nil)=0
 
virtual bool16 IsMasterItemOverriddenOnPage (const UIDRef masterItem, const UIDRef startPageUIDRef)=0
 
virtual ICommandCreateOverrideMasterPageItemsCmd (const UIDList &spreadsOrPages, ICallback *masterItemCollector=nil, int32 drwMgrFlags=IShape::kSkipChildren+IShape::kSkipHiddenAndLockedLayers) const =0
 
virtual void AppendMasterPageItems (IDataBase *db, UID theSpread, const UIDList &onThesePages, const PMRectCollection &pageBounds, UIDList &masterItems, UIDList &pages, PMMatrixCollection &offsets, ICallback *masterItemCollector=nil, int32 drwMgrFlags=IShape::kSkipChildren+IShape::kSkipHiddenAndLockedLayers) const =0
 
virtual PMMatrix CalculateMasterSpreadToDrawingSpreadMatrix (const IMasterPage *drawingPage, UIDRef masterPage=kInvalidUIDRef) const =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

Utility interface to manipulate master spreads; please use the IMasterSpreadUtils via kUtilsBoss (see Utils.h).

Utils<MasterSpreadUtils>()->IsFrontViewAMaster( ... ) ;
See Also
kUtilsBoss
kMasterPagesBoss

Member Function Documentation

virtual bool16 IMasterSpreadUtils::_IsFrontViewAMaster ()
pure virtual
Returns
kFalse - obsolete, do not use
virtual void IMasterSpreadUtils::AppendMasterPageItems (IDataBasedb,
UID theSpread,
const UIDListonThesePages,
const PMRectCollectionpageBounds,
UIDListmasterItems,
UIDListpages,
PMMatrixCollectionoffsets,
ICallbackmasterItemCollector = nil,
int32 drwMgrFlags = IShape::kSkipChildren+IShape::kSkipHiddenAndLockedLayers 
) const
pure virtual

Creates a list of master page items, pages, and offsets for the master items that are drawn on the given spread and page bounds.

Parameters
dbthe database for the document to operate on
theSpreadthe UID of the spread to collect the items from
onThesePagesthe UIDs of the pages within this spread
pageBoundsthe bounds of the pages (in spread coordinates). May be enlarged by bleed, slug, etc.
masterItemsOUT the returned list of items drawn on the spread
pagesOUT the page UID for the master page item (parallel list with masterItems)
offsetsOUT the offset of each master page item (parallel list with masterItems)
masterItemCollectorOPTIONAL. Call back object being used for collecting master page items.
drwMgrFlagsOPTIONAL. Draw flags to use for collecting master page items.
See Also
ILayoutUtils::EnlargePagesRectBySlug
virtual void IMasterSpreadUtils::BuildMasterSpreadList (IStringListControlDatastringData,
UIDListmasterUIDs,
bool16 bIncludeNone,
UID excludeUID 
)
pure virtual

build a string list of master spread names.

Parameters
stringDataIN an empty IStringListControlData OUT a list of master names
masterUIDsIN an empty UIDList created with a valid database OUT a list of UIDs, parallel to stringData (i.e. the n'th UID corresponds to the n'th master name)
bIncludeNoneIN kTrue means include the string 'None'
excludeUIDIN if valid, skip this UID
virtual int32 IMasterSpreadUtils::CountPagesWithMaster (UIDListmasterUIDs,
int32 * mastersWithMaster = nil,
UIDListpageUIDs = nil 
)
pure virtual

count the number of pages in the document that have one of the specified masters applied to it. optionally look at the masters also.

Parameters
masterUIDsIN list of masters being queried about
mastersWithMasterOUT if not NIL, returns the count of master spreads with the specified masters applied
pageUIDsOUT if not NIL, returns an array of page UIDs with the specified masters applied
virtual ICommand* IMasterSpreadUtils::CreateOverrideMasterPageItemsCmd (const UIDListspreadsOrPages,
ICallbackmasterItemCollector = nil,
int32 drwMgrFlags = IShape::kSkipChildren+IShape::kSkipHiddenAndLockedLayers 
) const
pure virtual

Creates a OverrideMasterPageItemsCmd and feeds it with items based on the UIDList that is being passed in.

Parameters
spreadsOrPages.UIDList of spreads or pages.
masterItemCollectorOPTIONAL. Call back object being used for collecting master page items..
drwMgrFlagsOPTIONAL. Draw flags being used for collecting master page items..
Returns
an executable command (kOverrideMasterPageItemCmdBoss).
virtual void IMasterSpreadUtils::GetAncestorsOf (IMasterSpreadListmasterSpreadList,
UID masterUID,
UIDListancestors 
)
pure virtual

build a list of all masters applied to a given master or its ancestors

Parameters
masterSpreadListIN list of masters for a given document
masterUIDIN master spread whose ancestors are being requested
ancestorsOUT list of all masters applied to the specified master, or to those masters
virtual UIDList IMasterSpreadUtils::GetUnusedMasterUIDs (IDocumentdoc)
pure virtual

build a UID list of master spreads that are not applied to pages.

Parameters
docIN The database to search.
Returns
a UIDList of unused master spread UIDs
virtual bool16 IMasterSpreadUtils::IsAnAncestorOf (IMasterSpreadListmasterList,
UID masterA,
UID masterB 
)
pure virtual

Return kTrue if masterA is an ancestor of masterB (i.e. if one of the pages of B has masterA applied to it, or if one of master B's masters has masterA applied to it, and so on recursively)

Parameters
masterListIN list of masters (containing masterA and masterB
masterAIN potential ancestor master spread masterB IN master being queried about
Returns
kTrue if masterA is an ancestor of masterB; kFalse otherwise
virtual bool16 IMasterSpreadUtils::IsMasterAppliedToPage (UID masterUID,
IPMUnknownpage 
) const
pure virtual

Returns kTrue if the specified master is applied to the specified page, or to one of its ancestors

Parameters
masterUIDIN master being queried about
pageIN page being queried about
Returns
kTrue if page has masterUID applied to it (recursively)
virtual bool16 IMasterSpreadUtils::IsMasterItemOverriddenOnPage (const UIDRef masterItem,
const UIDRef startPageUIDRef 
)
pure virtual

determine if the given master page item is already overridden on the given page (may be a crossover and therefore overridden on a page other than the specified one)

Parameters
masterItemIN master page page item being queried about
startPageUIDRefIN page being queried about
Returns
kTrue if the given master page page item is overridden on the given page
virtual bool16 IMasterSpreadUtils::OverrideMasterPageItem (const UIDRef masterItem,
const UIDRef pageToOverrideOn,
ICommand::Undoability undoability = ICommand::kAutoUndo,
UIDRefoverriddenItem = nil 
)
pure virtual

Given a master item and a layout page which has that master item drawing on it, override the master item and return the item corresponding to the passed in item. This may be different than the item which was overridden - in the case of a sub-item of a group, the returned item is the item corresponding to the passed in item, not the group (which was overridden). The undoability argument is for uses where the returned item is immediately modified, so the 'Override master item' doesn't need to show up in the Undo stack.

Return value is kTrue if everything is OK, kFalse if the item wasn't overridden (which can happen if the specified master item wasn't drawing on the specified page, or if the item was already overridden)

Parameters
masterItemIN master item to override
pageToOverrideOnIN page to override the item on
undoabilityIN how should the override command be undone? default : ICommand::kAutoUndo
overriddenItemOUT new page item corresponding to masterItem
Returns
kTrue if success, kFalse otherwise
virtual void IMasterSpreadUtils::TopoSortMasterSpread (IMasterSpreadListmasterSpreadList,
UIDListsortedList 
)
pure virtual

sort the specified IMasterSpreadList such that masters with other masters applied to them are later in the list than the masters they derive from (e.g. if 'B-Master' has 'C-Master' applied, and 'A-Master' and 'C-Master' have 'None' applied, the sorted order would be 'A-Master', 'C-Master', 'B-Master'.). Useful for duplicating a master spread list to a new document.

Warning: I think the above comment is wrong. It seems that TopoSortMasterSpread sorts all the masters so that a given master in the list depends only on masters appearing later in the list. That is the root masters are sorted to the end of the list and the most dependent masters are sorted to the beginning.

Parameters
masterSpreadListIN list of master spreads for a given document
sortedListOUT sorted list of masters, base masters first, derived masters later.