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

#include <IRunInStylesUtils.h>

Inheritance diagram for IRunInStylesUtils:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IRUNINSTYLESUTILS }
 

Public Member Functions

virtual bool16 ParseParagraphForRunInStyles (const ITextModel *model, TextIndex position, const ICompositionStyle *paragraphStyle, RunInStyleResults &results, int32 *pParagraphLengthLeft=nil, bool16 moveBackwards=kFalse)=0
 
virtual void MapExpressionToPMString (const WideString &expression, PMString *pOutput, int32 *pCount, bool16 *pInclusive)=0
 
virtual void MapPMStringToExpression (const PMString &nicePhrase, int32 count, bool16 inclusive, WideString *pExpression)=0
 
virtual bool16 ToggleExpressionInclusion (const WideString &original, WideString *pToggled)=0
 
virtual int32 CalculateDropCapCount (const TextIterator &beginPosition, int16 baseCharCount, WideString *dcText)=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

Some utility functions to aid in processing run-in styles

Member Function Documentation

virtual int32 IRunInStylesUtils::CalculateDropCapCount (const TextIteratorbeginPosition,
int16 baseCharCount,
WideStringdcText 
)
pure virtual

calculate actual number of char that dropcap need to be applied (adjusted for hidden character at the beginning of paragraph)

Parameters
beginPositionbeginning position for dropcap evaluation (usually beginning position of paragraph)
baseCharCountnumber of dropcap char specified by user
dcTextactual text string used for dropcap
Returns
actual number of char dropcap will be applied starting beginning position
See Also
RunInStyleRule
virtual void IRunInStylesUtils::MapExpressionToPMString (const WideStringexpression,
PMStringpOutput,
int32 * pCount,
bool16 * pInclusive 
)
pure virtual

map the attribute's expression string into a PMString for readibility. The attribute is split into the characters to match and the count.

Parameters
expressionthe attribute's value describing the rule
pOutputthe string that should contain a readable version of the rule
pCountthe number of TIMES that the expression should be found before switching styles
pInclusivewill be return whether the style INCLUDES the final trigger
See Also
RunInStyleRule
virtual void IRunInStylesUtils::MapPMStringToExpression (const PMStringnicePhrase,
int32 count,
bool16 inclusive,
WideStringpExpression 
)
pure virtual

map a user description of a rule PLUS a count into an attribute's expression string

Parameters
nicePhrasea PMString version of the rule
countthe number of time the rule should be satisfied
pExpressionthe attribute's rule string the describes the input.
inclusivedeclares whether the style INCLUDES the final trigger
See Also
RunInStyleRule
virtual bool16 IRunInStylesUtils::ParseParagraphForRunInStyles (const ITextModelmodel,
TextIndex position,
const ICompositionStyleparagraphStyle,
RunInStyleResultsresults,
int32 * pParagraphLengthLeft = nil,
bool16 moveBackwards = kFalse 
)
pure virtual

Calculate the Run-In style transition points for the given paragraph

Parameters
modelthe text model of the story being examined
positionusually the starting index of the paragraph being examined
paragraphStylethe paragraph attributes for the paragraph. If the paragraphStyle is nil, then everything is fine and the position can be arbitrary. If the paragraphStyle is NOT file, then it position should be == to paragraph start.
resultsa list of run-in styles for this paragraph specified as an ordered list of <character style UID, number of characters> pairs
ignoreUnsetLinesspecifies whether to ignore "lines" nested styles or to set that style over the entire remaining paragraph. In already-composed paragraphs, this parameter is ignored, but in uncomposed paragraphs, the choice exists. Generally, they are ignored except by composition itself.
pParagraphLengthLeftshould be SET to the paragraph length if the paragraphStyle was passed in, otherwise, it's for occasional callers who need to know the rest of the paragraph's length too.
moveBackwardsspecifies the direction in which rest of the paragraph's length is to be reported. The value is kTrue for backwards direction and kFalse for forward direction.
Returns
kTrue if the paragraph at the position has runins (results could be empty if position past the affected range)
virtual bool16 IRunInStylesUtils::ToggleExpressionInclusion (const WideStringoriginal,
WideStringpToggled 
)
pure virtual

toggle whether the rule include the character that triggers the switch or not

Parameters
originalthe original expression from the run-in style list
pToggledthe new expression, with the inclusion toggled
Returns
some expressions are not toggle-able and if original == *pToggled this will return kFalse
See Also
RunInStyleRule