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

#include <HypHyphenatedWord.h>

Inheritance diagram for HypHyphenatedWord:
IHyphenatedWordgrRefCountedObj

Public Member Functions

 HypHyphenatedWord (const TextCharBuffer &originalWord, const uint16 nMinTail, const uint16 nMinHead, const Hyp::HyphenationPoints &hyphenationPoints)
 
virtual ~HypHyphenatedWord ()
 
virtual int32 GetPointCount () const
 
virtual int32 GetIndexOfPoint (int32 nNthPoint) const
 
virtual int32 GetQualityOfPoint (int32 nNthPoint) const
 
virtual WideString GetWord () const
 
virtual void GetPartsOfPoint (int32 nNthPoint, WideString *pFirstPart, WideString *pLastPart) const
 
virtual void GetFirstPartOfPoint (int32 nNthPoint, WideString *pPart) const
 
virtual void GetLastPartOfPoint (int32 nNthPoint, WideString *pPart) const
 
virtual void Merge (const IHyphenatedWord *pToMergeWith)
 
virtual void ValidatePointRanges ()
 

Additional Inherited Members

- Public Types inherited from IHyphenatedWord
enum  {
  kNoHyphenPoint = 0, kVeryUnpreferredHyphenPoint = 10, kUnpreferredHyphenPoint = 25, kRegularHyphenPoint = 50,
  kPreferredHyphenPoint = 75, kDiscretionaryHyphenPoint = 80, kHardHyphenPoint = 90, kBestHyphenPoint = 100,
  kWorstHyphenPoint = 0, kForcedHyphenPoint = kBestHyphenPoint, kRefusedHyphenPoint = kWorstHyphenPoint, kInvalidHyphenPoint = -1
}
 
- Protected Attributes inherited from grRefCountedObj
int32 fRefCount
 

Detailed Description

The word with its hyphenation points used by the application to find the index and the quality of each hyphen and the text that surrounds it.

Constructor & Destructor Documentation

HypHyphenatedWord::HypHyphenatedWord (const TextCharBufferoriginalWord,
const uint16 nMinTail,
const uint16 nMinHead,
const Hyp::HyphenationPointshyphenationPoints 
)

Constructor. Hyphenation points that are outside the range given by nMinHead..wordLength-nMinTail are discarded. Duplicate hyphenation points are discarded.

Parameters
originalWordpassed when IHyphenationService::Hyphenate was called.
nMinTailthe minimum number of characters at the end of a word after a hyphen break.
nMinHeadthe minimum number of characters at the start of a word before a hyphen break.
hyphenationPointsgiving index and quality of each hyphenation point.
HypHyphenatedWord::~HypHyphenatedWord ()
virtual

Destructor.

Member Function Documentation

void HypHyphenatedWord::GetFirstPartOfPoint (int32 nNthPoint,
WideStringpPart 
) const
virtual

Get string with text before the Nth hyphen point.

Parameters
nNthPoint
pPartof the word before the Nth hyphen e.g. ser for ser-vice.

Implements IHyphenatedWord.

int32 HypHyphenatedWord::GetIndexOfPoint (int32 nNthPoint) const
virtual
Parameters
nNthPointThe Nth hyphenation point.
Returns
the index in the word of the Nth hyphenation point. The index is the position before the hyphen: i.e. ser-vice returns 2.

Implements IHyphenatedWord.

void HypHyphenatedWord::GetLastPartOfPoint (int32 nNthPoint,
WideStringpPart 
) const
virtual

Get string with text after the Nth hyphen point.

Parameters
nNthPoint
pPartof the word before the Nth hyphen e.g. vice for ser-vice.

Implements IHyphenatedWord.

void HypHyphenatedWord::GetPartsOfPoint (int32 nNthPoint,
WideStringpFirstPart,
WideStringpLastPart 
) const
virtual

Get strings with text before/after the Nth hyphen point.

Parameters
nNthPoint
pFirstPartof the word before the Nth hyphen e.g. ser for ser-vice.
pLastPartof the word after the Nth hyphen e.g. vice for ser-vice.

Implements IHyphenatedWord.

int32 HypHyphenatedWord::GetPointCount () const
virtual
Returns
the total number of hyphenation points.

Implements IHyphenatedWord.

int32 HypHyphenatedWord::GetQualityOfPoint (int32 nNthPoint) const
virtual
Parameters
nNthPointThe Nth hyphenation point.
Returns
the quality value of the Nth hyphenation point e.g. kRegularHyphenPoint.

Implements IHyphenatedWord.

WideString HypHyphenatedWord::GetWord () const
virtual
Returns
the characters of the word.

Implements IHyphenatedWord.

void HypHyphenatedWord::Merge (const IHyphenatedWordpToMergeWith)
virtual

Add the hyphenation points in pToMergeWith to this word.

Parameters
pToMergeWithThe hyphenated word to merge with.

Implements IHyphenatedWord.

void HypHyphenatedWord::ValidatePointRanges (void )
virtual

Empty implementation. All hyphenation points are checked to be in a valid range before being accepted. See nMinTail and nMinHead description in HypAdapter.

Implements IHyphenatedWord.