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

#include <ITextWrapFacade.h>

Inheritance diagram for Facade::ITextWrapFacade:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_ITEXTWRAPFACADE }
 
enum  { kUnchanged = 0xFFFF }
 
enum  IgnoreEnum { kDoNotIgnore = 0, kIgnore = 1, kLeaveUnchanged }
 

Public Member Functions

virtual IStandOff::mode GetMode (const UIDRef &pageItem) const =0
 
virtual bool32 GetUserModified (const UIDRef &pageItem) const =0
 
virtual ErrorCode SetMode (const UIDList &pageItems, IStandOff::mode mode, bool16 setUserModified=kFalse, bool16 doAutoSelect=kFalse) const =0
 
virtual ErrorCode SetContourWrapSettings (const UIDList &imageItems, IStandOffContourWrapSettings::ContourWrapType contourType, int16 pathIndex, int16 alphaIndex, PMReal tolerance, uint8 threshhold, bool8 allowHoles) const =0
 
virtual ErrorCode GetContourWrapSettings (const UIDRef &imageItem, IStandOffContourWrapSettings::ContourWrapType *contourTypePtr, int16 *pathIndexPtr=nil, int16 *alphaIndexPtr=nil, PMReal *tolerancePtr=nil, uint8 *threshholdPtr=nil, bool8 *allowHolesPtr=nil) const =0
 
virtual ErrorCode SetInvert (const UIDList &textWrapItems, bool8 bInvert) const =0
 
virtual ErrorCode GetInvert (const UIDRef &textWrapItem, bool8 &bInvert) const =0
 
virtual ErrorCode SetMargins (const UIDList &textWrapItems, const PMReal &topMargin, const PMReal &leftMargin, const PMReal &bottomMargin, const PMReal &rightMargin) const =0
 
virtual ErrorCode GetMargins (const UIDRef &textWrapItem, PMReal &topMargin, PMReal &leftMargin, PMReal &bottomMargin, PMReal &rightMargin, bool8 &singleDistance) const =0
 
virtual ErrorCode SetActiveFromMaster (const UIDList &textWrapItems, bool16 bActive) const =0
 
virtual ErrorCode GetActiveFromMaster (const UIDRef &textWrapItem, bool16 &bActive) const =0
 
virtual ErrorCode SetSide (const UIDList &textWrapItems, IStandOff::side Side) const =0
 
virtual ErrorCode GetSide (const UIDRef &textWrapItem, IStandOff::side &Side) const =0
 
virtual ErrorCode SetIgnoreWrap (const UIDList &ignoreWrapItems, bool8 bIgnore) const =0
 
virtual ErrorCode GetIgnoreWrap (const UIDRef &ignoreWrapItem, bool8 &ignore) const =0
 
virtual ErrorCode GetSkipByLeadingHeight (const UIDRef &workspace, bool16 &skipByLeading) const =0
 
virtual ErrorCode SetSkipByLeadingHeight (const UIDRef &workspace, bool16 skipByLeading) const =0
 
virtual ErrorCode GetZOrderBasedTextWrap (const UIDRef &workspace, bool16 &zOrder) const =0
 
virtual ErrorCode SetZOrderBasedTextWrap (const UIDRef &workspace, bool16 useZOrder) const =0
 
virtual void CopyTextWrap (const UIDRef &srcPageItem, const UIDRef &dstPageItem) const =0
 
virtual ErrorCode GetModifyIndentsAroundTextWrap (const UIDRef &workspace, bool16 &modifyIndent) const =0
 
virtual ErrorCode SetModifyIndentsAroundTextWrap (const UIDRef &workspace, bool16 modifyIndent) 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

A high level API for dealing with text wrap. To use this Facade, include this header file and the use the following example syntax: theMode = Utils<Facade::ITextWrapFacade>()->GetMode( pageItem );

Author
David Stephens

Member Function Documentation

virtual void Facade::ITextWrapFacade::CopyTextWrap (const UIDRefsrcPageItem,
const UIDRefdstPageItem 
) const
pure virtual

Description: When replacing a page item with wrap, either via the Place dialog, relinking an image or pasting another page item into the parent frame, we sometimes want to preserve the text wrap of the page item that is being replaced. This method is used to copy the text wrap settings from one page item to another. It also will copy the actual text wrap path if the path was modified by the user.

Parameters
srcPageItemIN: Notice that this parameter is a const.
dstPageItemIN: On return, this page item will have the same text wrap settings (if possible) as the source. Sometimes it is not possible to copy the settings. For example, the text wrap on the source may be using an embedded clipping path which does not exist in the destination. In such cases, this routine will get as close as possible. For the said example, it will choose "Same As Clipping" instead.
virtual ErrorCode Facade::ITextWrapFacade::GetActiveFromMaster (const UIDReftextWrapItem,
bool16 & bActive 
) const
pure virtual

Description: Is a MasterPage based text wrap active on Spreads that it appears on?

Parameters
textWrapItemIN: The text wrap item from which we will get the bActive setting. Alternatively, you can pass in the UIDRef of the document or session workspace.
Returns
kTrue if the text wrap is user modified, kFalse otherwise.
virtual ErrorCode Facade::ITextWrapFacade::GetContourWrapSettings (const UIDRefimageItem,
IStandOffContourWrapSettings::ContourWrapType * contourTypePtr,
int16 * pathIndexPtr = nil,
int16 * alphaIndexPtr = nil,
PMRealtolerancePtr = nil,
uint8 * threshholdPtr = nil,
bool8 * allowHolesPtr = nil 
) const
pure virtual

Description: Get the current ContourWrapSettings for a given image, document workspace, or the session workspace.

Parameters
imageItemIN: The image whose ContourWrapSettings we are interested in obtaining. Note that imageItem is not the text wrap item (i.e. not the standoff). Alternatively a UIDRef of the document or session workspace may be used.
contourTypePtrOUT: If non-nil, then the current contour type will be returned.
pathIndexPtrOUT: If non-nil and the contourType is kEmbeddPath, then the zero-based index of the path will be returned in this parameter.
alphaIndexPtrOUT: If non-nil and the contourType or kAlpha, then the zero-based index of the alpha channel will be returned in this parameter.
tolerancePtrOUT: If non-nil, then the current tolerance value will be returned.
threshholdPtrOUT: If non-nil, then the current threshhold value between 0 and 255 will be returned.
allowHolesPtrOUT: If non-nil, then the current allowHoles setting will be returned.
Returns
Any errors or kSuccess if successful.
virtual ErrorCode Facade::ITextWrapFacade::GetIgnoreWrap (const UIDRefignoreWrapItem,
bool8 & ignore 
) const
pure virtual

Description: Is the text wrap path currently ignored?

Parameters
ignoreWrapItemIN: The MultiColumnTextFrame or parent item from which we will get the ignore setting. Alternatively, you can pass in the UIDRef of the document or session workspace.
Returns
kTrue if text wrap is currently ignored, kFalse otherwise.
See Also
ITextOptions.h for document and session preferences settings.
virtual ErrorCode Facade::ITextWrapFacade::GetInvert (const UIDReftextWrapItem,
bool8 & bInvert 
) const
pure virtual

Description: Is the text wrap path inverted?

Parameters
textWrapItemIN: The text wrap item from which we will get the bInvert setting. Alternatively, you can pass in the UIDRef of the document or session workspace.
Returns
kTrue if the text wrap is user modified, kFalse otherwise.
virtual ErrorCode Facade::ITextWrapFacade::GetMargins (const UIDReftextWrapItem,
PMRealtopMargin,
PMRealleftMargin,
PMRealbottomMargin,
PMRealrightMargin,
bool8 & singleDistance 
) const
pure virtual

Description: Get the current margins (outsets) for a given text wrap. Use kUnchanged to leave a value unchanged. If a text wrap is non-rectangular, then the topMargin is applied as an outset to the entire path.

Parameters
textWrapItemIN: The text wrap item from which we will obtain the margin settings. Alternatively, you can pass in the UIDRef of the document or session workspace.
topMarginOUT: The top margin.
leftMarginOUT: The left margin.
bottomMarginOUT: The bottom margin.
rightMarginOUT: The right margin.
singleDistanceOUT: Whether the item only supports one value for all sides (i.e. topMargin is the only valid margin)
Returns
Any errors or kSuccess if successful.
virtual IStandOff::mode Facade::ITextWrapFacade::GetMode (const UIDRefpageItem) const
pure virtual

Description: Get the text wrap mode for the given page item, Document workspace, or the session workspace.

Parameters
pageItemIN: The UIDRef of the page item we are interested in. Alternatively, you can pass in the UIDRef of the document or session workspace.
Returns
The text wrap mode for the given pageItem.
virtual ErrorCode Facade::ITextWrapFacade::GetModifyIndentsAroundTextWrap (const UIDRefworkspace,
bool16 & modifyIndent 
) const
pure virtual

Description: GetModifyIndentsAroundTextWrap() returns kTrue if Text Indents would be honoured along with Indents of Text Wrap. This modifies the Text Flow for Bullets and Numbering. kFalse if Text Indents and Text wrap indents are to be considered separately.

Parameters
workspaceIN - the UIDRef of the target workspace. This UIDRef can be either a document workspace or the session workspace.
modifyIndentOUT - kTrue if Text Indents would be honoured along with Indents of Text Wrap.
Returns
ErrorCode - kSuccess if successful, an error otherwise
virtual ErrorCode Facade::ITextWrapFacade::GetSide (const UIDReftextWrapItem,
IStandOff::sideSide 
) const
pure virtual

Description: Get the text wrap side for the given page item, Document workspace, or the session workspace.

Parameters
pageItemIN: The UIDRef of the page item we are interested in. Alternatively, you can pass in the UIDRef of the document or session workspace.
Returns
The text wrap side for the given pageItem.
virtual ErrorCode Facade::ITextWrapFacade::GetSkipByLeadingHeight (const UIDRefworkspace,
bool16 & skipByLeading 
) const
pure virtual

Description: GetSkipByLeadingHeight() returns kTrue if the text tiler will skip down by the leading height when an obstruction is encountered. kFalse will be returned if the tiler will skip down 1 point.

Parameters
workspaceIN - the UIDRef of the target workspace. This UIDRef can be either a document workspace or the session workspace.
skipByLeadingOUT - kTrue if the tiler will skip by leading height.
Returns
ErrorCode - kSuccess if successful, an error otherwise
virtual bool32 Facade::ITextWrapFacade::GetUserModified (const UIDRefpageItem) const
pure virtual

Description: Get whether given page item has a user modified/edited text wrap.

Parameters
pageItemIN: The UIDRef of the page item we are interested in.
Returns
ChangedType - whether or not the given page item has a user-modified path
virtual ErrorCode Facade::ITextWrapFacade::GetZOrderBasedTextWrap (const UIDRefworkspace,
bool16 & zOrder 
) const
pure virtual

Description: GetZOrderBasedTextWrap() returns kTrue if text wrap only affects items above it in the z-order. kFalse is returned if text wrap affects all text regardless of the z-order.

Parameters
workspaceIN - the UIDRef of the target workspace. This UIDRef can be either a document workspace or the session workspace.
zOrderOUT - kTrue indicates z-order based text wrap will be used.
Returns
ErrorCode - kSuccess if successful, an error otherwise
virtual ErrorCode Facade::ITextWrapFacade::SetActiveFromMaster (const UIDListtextWrapItems,
bool16 bActive 
) const
pure virtual

Description: Should a MasterPage based text wrap be active on Spreads that is appears on?

Parameters
textWrapItemsIN: The list of text wrap items to which we will apply the bActive setting. Alternatively a list with the UIDRef of the document or session workspace may be used. Alternatively, you can pass in the UIDRef of the document or session workspace.
bActiveIN: kTrue to have MasterPage based wrap be active on Spreads in which it appears
Returns
Any errors or kSuccess if successful.
virtual ErrorCode Facade::ITextWrapFacade::SetContourWrapSettings (const UIDListimageItems,
IStandOffContourWrapSettings::ContourWrapType contourType,
int16 pathIndex,
int16 alphaIndex,
PMReal tolerance,
uint8 threshhold,
bool8 allowHoles 
) const
pure virtual

Description: Images with a text wrap mode of IStandOff::kManualContour have additional options available including using an embedded Photoshop clipping path, performing edge detection on the image or on a given alpha channel, wrapping around the image bounds, wrapping around the graphic frame which contains the image, or wrapping around whatever is currently clipping the image (either a clipping path or the frame itself).

Parameters
imageItemsIN: The list of images to which we will apply the settings (not a list of text wrap items)
contourTypeIN: The text wrap contour type to apply.
pathIndexIN: If the countourType is kEmbeddedPath then pathIndex represents the zero based index of the embedded path to use.
alphaIndexIN: If the countourType is kAlpha, then alphaIndex represents the zero based index of the alpha channel to use.
toleranceIN: Edge detection based on the image or an alpha channel occurs in two steps. The first step generates a polygonal path which perfectly matches what InDesign believes is the edge. Because the polygonal path may contain thousands of points, it is smoothed into a bezier path during the second step if tolerance is non-zero. During this smoothing step, the tolerance indicates how closely the resulting path must match A value between 0 and 100 which indicates how closely the resulting path must match the polygonal path from step 1.
threshholdIN: During edge detection of an image or alpha channel, the source pixels are converted to grayscale and then to a 1-bit bitmap. The threshhold is a value between 0 and 255. Any gray value greater than or equal to the threshold will be mapped to white. All other pixels will be mapped to black.
allowHolesIN: If kFalse, then all subpaths representing holes will be removed.
Returns
Any errors or kSuccess if successful.
virtual ErrorCode Facade::ITextWrapFacade::SetIgnoreWrap (const UIDListignoreWrapItems,
bool8 bIgnore 
) const
pure virtual

Description: Should the text wrap be ignored?

Parameters
ignoreWrapItemsIN: The list of MultiColumnTextFrame or parent items to which we will apply the ignore setting. Alternatively, you can pass in the UIDRef of the document or session workspace.
bIgnoreIN: kTrue to ignore text wrap.
Returns
kTrue if the text wrap is user modified, kFalse otherwise.
See Also
ITextOptions.h for document and session preferences settings.
virtual ErrorCode Facade::ITextWrapFacade::SetInvert (const UIDListtextWrapItems,
bool8 bInvert 
) const
pure virtual

Description: Should the text wrap path be inverted?

Parameters
textWrapItemsIN: The list of text wrap items to which we will apply the bInvert setting. Alternatively a list with the UIDRef of the document or session workspace may be used. Alternatively, you can pass in the UIDRef of the document or session workspace.
bInvertIN: kTrue to invert the text wrap.
Returns
Any errors or kSuccess if successful.
virtual ErrorCode Facade::ITextWrapFacade::SetMargins (const UIDListtextWrapItems,
const PMRealtopMargin,
const PMRealleftMargin,
const PMRealbottomMargin,
const PMRealrightMargin 
) const
pure virtual

Description: Set the margins (outsets) for text wrap. Use kUnchanged to leave a value unchanged. If a text wrap is non-rectangular, then the topMargin will be applied as an outset to the entire path.

Parameters
textWrapItemsIN: The list of text wrap items to which we will apply the margin settings. Alternatively, you can pass in the UIDRef of the document or session workspace.
topMarginIN: The top margin. Use kUnchanged to leave current setting unchanged.
leftMarginIN: The left margin. Use kUnchanged to leave current setting unchanged.
bottomMarginIN: The bottom margin. Use kUnchanged to leave current setting unchanged.
rightMarginIN: The right margin. Use kUnchanged to leave current setting unchanged.
Returns
Any errors or kSuccess if successful.
virtual ErrorCode Facade::ITextWrapFacade::SetMode (const UIDListpageItems,
IStandOff::mode mode,
bool16 setUserModified = kFalse,
bool16 doAutoSelect = kFalse 
) const
pure virtual

Description: Allows the client to specify a text wrap mode for several page items at once, or for the document- or session-workspace.

Parameters
pageItemsIN: The list of page items to which we will apply the text wrap. Alternatively, you can pass in the UIDRef of the document or session workspace.
ModeIN: The text wrap mode to apply.
setUserModifiedIN: User modified paths become locked such that if the geometry (shape) of a page item changes, the text wrap does NOT update to match the new geometry. However, it will continue to move when the page item moves.
doAutoSelectIN: Enable Auto Selecting of most relevant Text Wrap Contour option in case Manual Contour is chosen and no previous chosen state exists.
Returns
Any errors or kSuccess if successful.
virtual ErrorCode Facade::ITextWrapFacade::SetModifyIndentsAroundTextWrap (const UIDRefworkspace,
bool16 modifyIndent 
) const
pure virtual

Description: SetModifyIndentsAroundTextWrap() is used to set Indentation behaviour where in Text Indents would be honoured along with Indents of Text Wrap. This modifies the Text Flow for Bullets and Numbering.

Parameters
workspaceIN - the UIDRef of the target workspace. This UIDRef can be either a document workspace or the session workspace. Changing the session workspace setting will cause all new documents to take on the new setting. Changing the document workspace setting changes the setting in only that document.
modifyIndentIN - pass kTrue to make Text Indents honour Text Wrap Indents and modify Text Flow for Bullets and Numbering. Pass kFalse to keep the old behaviour. Due to this the Bullets and Numbering layout around the Text Wrap behaves same as that in normal paragraph
Returns
ErrorCode - kSuccess if successful, an error otherwise
virtual ErrorCode Facade::ITextWrapFacade::SetSide (const UIDListtextWrapItems,
IStandOff::side Side 
) const
pure virtual

Description: Allows the client to specify a text wrap side for several page items at once, or for the document- or session-workspace.

Parameters
textWrapItemsIN: The list of text wrap items to which we will apply the Side setting. Alternatively a list with the UIDRef of the document or session workspace may be used. Alternatively, you can pass in the UIDRef of the document or session workspace.
SideIN: The text wrap side to apply.
Returns
Any errors or kSuccess if successful.
virtual ErrorCode Facade::ITextWrapFacade::SetSkipByLeadingHeight (const UIDRefworkspace,
bool16 skipByLeading 
) const
pure virtual

Description: SetSkipByLeadingHeight() is used to set the tiler behavior when a text wrap obstruction is encountered and the tiler needs to move down to find a tile.

Parameters
workspaceIN - the UIDRef of the target workspace. This UIDRef can be either a document workspace or the session workspace. Changing the session workspace setting will cause all new documents to take on the new setting. Changing the document workspace setting changes the setting in only that document.
skipByLeadingIN - pass kTrue to make the tiler skip down by the leading height when an obstruction is encountered. Pass kFalse to make the tiler skip down 1 point. If moving down by the leading height, then the next line of text may or may not abut the bottom of the obstruction but it will be faster to compose and the lines of text in a multi-column text frame are more likely to align.
Returns
ErrorCode - kSuccess if successful, an error otherwise
virtual ErrorCode Facade::ITextWrapFacade::SetZOrderBasedTextWrap (const UIDRefworkspace,
bool16 useZOrder 
) const
pure virtual

Description: SetZOrderBasedTextWrap() is used to set whether or not text wrap is z-order based.

Parameters
workspaceIN - the UIDRef of the target workspace. This UIDRef can be either a document workspace or the session workspace. Changing the session workspace setting will cause all new documents to take on the new setting. Changing the document workspace setting changes the setting in only that document.
useZOrderIN - pass kTrue to force text wrap items to only affect text which is above the text wrap in the z-order. Pass kFalse to have text wrap affect all text regardless of the z-order.
Returns
ErrorCode - kSuccess if successful, an error otherwise