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

#include <ISpread.h>

Inheritance diagram for ISpread:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_ISPREAD }
 
enum  BindingLocation { kDefaultBinding = -1, kBindingAtBeginning = 0, kBindingAtEnd = -2 }
 
enum  BindingSide { kDefaultBindingSide = -1, kLeftSideOfBinding = 0, kRightSideOfBinding = -2 }
 
enum  PageColorLabel { kFollowMasterColorUID = 1 }
 
enum  { kAtTheEnd = -1 }
 

Public Member Functions

virtual ISpreadLayerQueryLayer (const IDocumentLayer *docLayer, int32 *pPos=nil, bool16 wantGuideLayer=kFalse) const =0
 
virtual IHierarchyQueryPagesLayer () const =0
 
virtual void GetItemsOnPage (int32 pgPos, UIDList *items, bool16 bIncludePage=kTrue, bool16 bIncludePasteboard=kFalse, bool16 bIncludeBleedAndSlug=kTrue) const =0
 
virtual void PartitionPageItems (UIDList *partition[], bool16 bIncludePage, int32 pasteboardIndex, bool16 bIncludeBleedAndSlug) const =0
 
virtual void PartitionPageItems (const K2Vector< PMRect > &rects, const K2Vector< PMMatrix > &rect2SpreadTransforms, UIDList *partition_[], int32 pasteboardIndex) const =0
 
virtual int32 GetNumPages () const =0
 
virtual IGeometryQueryNthPage (int32 n) const =0
 
virtual UID GetNthPageUID (int32 n) const =0
 
virtual IGeometryQueryNearestPage (const PBPMPoint &pt, int32 *pageIndex) const =0
 
virtual int32 GetPageIndex (UID pageID) const =0
 
virtual bool16 ForEachItem (ItemManipulator *manipulator, LayerMask *layerMask=nil) const =0
 
virtual PMRect GetPagesBounds (const Transform::CoordinateSpace &coordinateSpace) const =0
 
virtual PMRect GetPagesAndItemsBounds (const Transform::CoordinateSpace &coordinateSpace, bool16 includeGuides=kFalse) const =0
 
virtual PMPoint GetSpreadZeroPoint () const =0
 
virtual IColumnsQueryNearestColumnBounds (const PBPMPoint &pt, bool16 bIsVertical, PMRect *pColumnBounds=nil, int32 *pPageIndex=nil, int32 *pColumnIndex=nil) 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

Abstract interface that represents a spread, a container for pages (kPageBoss) and page items. The list of spreads (kSpreadBoss) is kept in the ISpreadList off the document (kDocBoss). A spread (kSpreadBoss) is the root of all drawable page item's IHierarchies (except for inlines) - pages are just elements in one layer of the spread's hierarchy, pages are not parents of other page items.

See Also
kSpreadBoss
ISpreadList
kDocBoss
kPageBoss

Member Function Documentation

virtual bool16 ISpread::ForEachItem (ItemManipulatormanipulator,
LayerMasklayerMask = nil 
) const
pure virtual

ForEachItem - Iterates over all items in the spread. The "manipulator" is called for each item. Groups are not traversed into. All layers are transversed (including hidden, non-printing, etc.), unless a LayerMask is provided.

Parameters
INmanipulator - the object called back with each item on the spread
INlayerMask - a filter call back (see LayerMask)
Returns
bool16 - Returns kFalse, if iteration was terminated due to the manipulator returning kFalse. Returns kTrue if all items on all layers satisfying the LayerMask were traversed.
virtual void ISpread::GetItemsOnPage (int32 pgPos,
UIDListitems,
bool16 bIncludePage = kTrue,
bool16 bIncludePasteboard = kFalse,
bool16 bIncludeBleedAndSlug = kTrue 
) const
pure virtual

GetItemsOnPage - return a list of all items in this spread's hierarchy that are "owned" by the given page. An item that overlaps more than one page is "owned" by the one its spread aligned bounding box intersects the most with by area (or the one with the smallest page index in case of a tie). This is used to decide what page items should be moved when a page is moved to another sppread. Note this does not include master items (because they aren't in the same hierarchy), and it may contain the page shape itself, if bIncludePage is kTrue.

Parameters
INpgPos - zero based index, which page in the spread
OUTitems - UIDList of items owned by the given page
INbIncludePage - kTrue == include the page shape itself; kFalse == don't
INbIncludePasteboard - kTrue == include items that are owned by the pasteboard in the returned list also
INbIncludeBleedAndSlug - kTrue == include items that are within the bleed/slug area for this page.
virtual UID ISpread::GetNthPageUID (int32 n) const
pure virtual

GetNthPageUID - return the UID of the indexed page (kInvalidUID if out of range)

Parameters
n- zero based page index
Returns
UID - the UID of the indexed page (kInvalidUID if out of range)
virtual int32 ISpread::GetNumPages () const
pure virtual

GetNumPages - return the number of pages in this spread

Returns
int32 - the number of pages in this spread
virtual int32 ISpread::GetPageIndex (UID pageID) const
pure virtual

GetPageIndex - return the index of the page corresponding to the passed UID (or -1 if not in this spread) this is the inverse of GetNthPageUID

Parameters
pageID- UID of page
Returns
int32 - index of page with UID pageUID
virtual PMRect ISpread::GetPagesAndItemsBounds (const Transform::CoordinateSpacecoordinateSpace,
bool16 includeGuides = kFalse 
) const
pure virtual

GetPagesAndItemsBounds - Returns a bounding box that tightly encloses (in the given coordinate system) all the pages on the spread plus any page items sitting on the pasteboard.

Parameters
INcoordinateSpace - either Transform::PasteboardCoordinates() or Transform::SpreadCoordinates()
includeGuides- kTrue == include enough space vertically to include horizontal guides and enough space horizontally to include vertical guides; kFalse = ignore guides
Returns
PMRect
virtual PMRect ISpread::GetPagesBounds (const Transform::CoordinateSpacecoordinateSpace) const
pure virtual

GetPagesBounds - Returns the bounding box that tightly encloses all the pages on the spread in the given coordinate system.

Parameters
INcoordinateSpace - either Transform::PasteboardCoordinates() or Transform::SpreadCoordinates()
Returns
PMRect - bounding box that tightly encloses all the pages on the spread.
virtual PMPoint ISpread::GetSpreadZeroPoint () const
pure virtual

GetSpreadZeroPoint - Returns the zero point for this spread by getting zero point pref for the pub and calculating where that spread-relative point falls on this spread.

Returns
PMPoint
virtual void ISpread::PartitionPageItems (UIDListpartition[],
bool16 bIncludePage,
int32 pasteboardIndex,
bool16 bIncludeBleedAndSlug 
) const
pure virtual

PartitionPageItems - returns lists of all the items on this spread's layers that are "owned" by each page. An item that overlaps more than one page is "owned" by the one that its item-aligned bounding box intersects the most with by area (or the one with the smallest page index in case of a tie). This is used to decide what page items should be moved when a page is moved to another sppread. Note this does not include master items (because they aren't in the same hierarchy), and it may contain the page shape itself, if bIncludePage is kTrue. The partition parameter is a C array of (numPages + 1) pointers to UIDLists that the caller must allocate. The last UIDList is for returning items that are not owned by any page but are completely in the pasteboard margins. Individual pointers themselves may be nil if you are not interested in items on certain pages. Or individual pointers may be equal if you want to pile together items on more than one page into a single list maintaining their z-order. For example, you may make every UIDList* before a page index (say i) point to one UIDList, the UIDList* at index i paoint to a second UIDList, and every UIDList* after i point to a third UIDList. If pasteboardIndex >= 0 or less than numPages, the pasteboard items will be added to that page's UIDList in addition to adding them to partition[numPages]. (Note passing numPages for pasteboardIndex does not mean add pasteboard items to the last UIDList twice, it means don't add pasteboard items to any other UIDList other than the last.) Note that every item on every layer is logically added to exactly one of the UIDLists in partition[]. If some UIDList* pointers are nil, or if pasteboardIndex >= 0 and < numPages, or if bIncludePage is false, this won't be strictly true in the obvious ways.

Note that PartitionPageItems is a generalization of GetItemsOnPage and is more efficient, more convenient, and more informative than calling GetItemsOnPage several times. PartitionPageItems is no less efficient than GetItemsOnPage even if you require only a one UIDList answer.

Parameters
OUTpartition - an array of numPages + 1 pointers to UIDLists that the caller must allocate
INbIncludePage - kTrue == include the page shape itself; kFalse == don't
INpasteboardIndex - 0-based index into partition for which UIDList to add pasteboard items to in addition to adding them to *partion[numPages]
INbIncludeBleedAndSlug - kTrue == include items that are within the bleed/slug area of each page.
virtual ISpreadLayer* ISpread::QueryLayer (const IDocumentLayerdocLayer,
int32 * pPos = nil,
bool16 wantGuideLayer = kFalse 
) const
pure virtual

QueryLayer - Return the spread layer associated with the given document layer; adds a ref count to the interface

Parameters
INdocLayer - document layer whose corresponding SpreadLayer you want
OUTpPos - returned position of the spread layer within the spread (may be nil)
INwantGuideLayer - kTrue == return the corresponding spread guide layer; kFalse == return the normal spread layer (default = kFalse)
Returns
ISpreadLayer* - spread layer corresponding to the supplied document layer
virtual IColumns* ISpread::QueryNearestColumnBounds (const PBPMPointpt,
bool16 bIsVertical,
PMRectpColumnBounds = nil,
int32 * pPageIndex = nil,
int32 * pColumnIndex = nil 
) const
pure virtual

QueryNearestColumnBounds - Used to locate the column nearest a point. In calculating the ColumnBounds we take into account whether we are interested in a horizontal or vertical perspective For example, a vertical text frame in a horizontal column layout will be interested in aligning the right edge if pColumnBounds to pt.X(), while a horizontal text frame will want to align top with pt.Y().

Parameters
INpt - point in question
bIsVertical
OUTpColumnBounds - rectangle in spread coordinates for the size of the column
OUTpPageIndex - the index of the page containing the columns
OUTpColumnIndex - the column index
Returns
IColumns* - the column interface for the columns; adds a reference to this interface
virtual IGeometry* ISpread::QueryNearestPage (const PBPMPointpt,
int32 * pageIndex 
) const
pure virtual

QueryNearestPage - return the IGeometry of the nearest page to the given point in Pasteboard coordinates. Adds a reference to the returned interface.

Parameters
pt- [IN] - pt in Pasteboard coordinates
pageIndex- [OUT] - page index of nearest page
Returns
IGeometry* - n'th page's IGeometry
virtual IGeometry* ISpread::QueryNthPage (int32 n) const
pure virtual

QueryNthPage - return the IGeometry of the n'th page. Adds a reference to the returned interface.

Parameters
n- zero based page index
Returns
IGeometry* - n'th page's IGeometry
virtual IHierarchy* ISpread::QueryPagesLayer () const
pure virtual

QueryPagesLayer - return the special "Pages" layer - the non-editable, non-UI layer containing the page shapes

Returns
IHierarchy* of the pages layer