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

#include <XRefBuildingBlock.h>

Public Types

enum  XRefBuildingBlockType {
  kInvalidXRefBBType = -1, kXRefBBCustomString = 0, kXRefBBFileName, kXRefBBChapterNumber,
  kXRefBBPageNumber, kXRefBBFullParagraph, kXRefBBParagraphNumber, kXRefBBParagraphText,
  kXRefBBBookmarkName, kMaxXRefBBType
}
 
typedef object_type data_type
 

Public Member Functions

 XRefBuildingBlock (XRefBuildingBlockType type)
 
 XRefBuildingBlock (XRefBuildingBlockType type, UID charStyle)
 
 XRefBuildingBlock (const XRefBuildingBlock &block)
 
XRefBuildingBlockoperator= (const XRefBuildingBlock &copy)
 
bool16 operator== (const XRefBuildingBlock &other) const
 
bool16 operator!= (const XRefBuildingBlock &other) const
 
XRefBuildingBlockType GetType () const
 
void SetType (XRefBuildingBlockType type)
 
UID GetCharacterStyle () const
 
void SetCharacterStyle (UID charStyle)
 
void SetCustomText (const PMString &customText)
 
PMString GetCustomText () const
 
void SetDelimiter (const UTF32TextChar &delim, bool16 includeDelim)
 
void SetDelimiter (const UTF32TextChar &delim)
 
void SetIncludeDelim (bool16 includeDelim)
 
UTF32TextChar GetDelimiter () const
 
bool16 IncludeDelimiter () const
 
PMString GenerateElementString () const
 
PMString GenerateSourceString (const ITextModel *textModel, TextIndex destIndex, bool16 externDest, std::map< TextIndex, WideString > *variableLocations, std::map< TextIndex, TextIndex > *inlineLocations) const
 
void ReadWrite (IPMStream *s)
 

Static Public Member Functions

static bool NeedToStripForParaNum (const UTF32TextChar &c)
 

Detailed Description

This class represents the building block object for cross reference format. Cross reference formats contain one or more building block object(s) which are used to construct the source content of the cross reference source referencing the format.

Member Enumeration Documentation

Building block type enum

Member Function Documentation

PMString XRefBuildingBlock::GenerateElementString () const

Generates the string to be inserted into format string for editing in UI.

Returns
PMString - generated string for UI editing.
PMString XRefBuildingBlock::GenerateSourceString (const ITextModeltextModel,
TextIndex destIndex,
bool16 externDest,
std::map< TextIndex, WideString > * variableLocations,
std::map< TextIndex, TextIndex > * inlineLocations 
) const

Generates the source content string.

Parameters
textModel- destination story of the cross reference.
destIndex- text index of the destination marker.
externDest- kTrue if the destination is in external document. kFalse otherwise.
variableLocations- [OUT] List of text variables and their offset index in the source content.
inlineLocations- [OUT] List of inline object offset index in the source content and the index in the destination story.
Returns
PMString - generated source content.
UID XRefBuildingBlock::GetCharacterStyle () const
inline

Gets the character style applied to the building block.

Returns
UID - UID of character style of the building block.
PMString XRefBuildingBlock::GetCustomText () const
inline

Gets the custom text of the building block.

Returns
PMString - custom text for the building block.
UTF32TextChar XRefBuildingBlock::GetDelimiter () const
inline

Gets the delimiter character of the building block.

Returns
UTF32TextChar - delimiter character of the building block.
XRefBuildingBlockType XRefBuildingBlock::GetType (void ) const
inline

Gets the type of the building block.

Returns
XRefBuildingBlockType - type of the building block.
bool16 XRefBuildingBlock::IncludeDelimiter () const
inline

Gets the flag whether or not delimiter character should be included in the generated source content.

Returns
bool16 - kTrue if delimiter character is included in the source content. kFalse otherwise.
void XRefBuildingBlock::SetCharacterStyle (UID charStyle)

Sets the character style of the building block.

Parameters
charStyle- UID of character style to apply to the building block.
void XRefBuildingBlock::SetCustomText (const PMStringcustomText)

Sets the custom text of the building block. Currently custom text is only applicable for custom string building block. It is ignored for other building blocks.

Parameters
customText- custom text for the building block.
void XRefBuildingBlock::SetDelimiter (const UTF32TextChardelim,
bool16 includeDelim 
)

Sets the delimiter character of the building block.

Parameters
delim- delimiter character on the building block.
includeDelim- kTrue if the delimiter should be included in the generated source text. kFalse otherwise.
void XRefBuildingBlock::SetType (XRefBuildingBlockType type)

Sets the type of the building block.

Parameters
type- type of the building block to be set to.