![]() | InDesign SDK 20.5 |

Public Member Functions | |
| CHLSpelling (IPMUnknown *boss) | |
| ~CHLSpelling () | |
| virtual bool16 | Set (const PMString &rCoreFileName, const PMString &rLexFileName, const PMString &rPhonFileName, const PMString &rBaseLangLexFileName) |
| virtual SpellResult | IsCorrect (const WideString &rWord, bool16 *bEndsWithPeriod) |
| virtual bool16 | FindAlternatives (const WideString &rWord, WideStringList *pAlternatives) |
| virtual SpellResult | Spell (const WideString &rWord, WideStringList *pAlternatives, bool16 *bEndsWithPeriod) |
| virtual SpellResult | IsCorrectGrammar (const WideString &rParagraph, int32 *pWordStart, int32 *pWordLength, int32 StartAt) |
| virtual bool16 | SupportsCaseSensitive () |
| virtual ISpellingService::SpellResult | FindError (const WideString &rParagraph, int32 startAt, int32 *pErrorStart, int32 *pErrorLength, WideStringList *pAlternatives, bool dir=kFalse) |
| virtual void | FindAllErrors (const WideString &rParagraph, int32 startAt, std::vector< SpellingError > *pSpellingErrors) |
Public Member Functions inherited from CPMUnknown< ISpellingService > | |
| IPMUnknown * | QueryInterface (PMIID interfaceID) const |
| void | AddRef () const |
| void | Release () const |
| void | PreDirty (ImplementationID prop=kInvalidImpl, bool16 allowModification=kTrue) |
| void | PreDirtyNoMessage (ImplementationID prop=kInvalidImpl, bool16 allowModification=kTrue) |
| CPMUnknown (const CPMUnknown &)=delete | |
| CPMUnknown & | operator= (const CPMUnknown &)=delete |
Additional Inherited Members | |
Public Types inherited from ISpellingService | |
| enum | SpellResult { kCorrect = 0, kSpellError, kIncorrectWord, kUncapitalizedWord, kGrammarError, kRepeatedWord, kUncapitalizedStartOfSentence, kNoteAnchor, kDeletedText } |
Protected Member Functions inherited from CPMUnknown< ISpellingService > | |
| CPMUnknown (IPMUnknown *boss) | |
Protected Attributes inherited from CPMUnknown< ISpellingService > | |
| HelperInterface | fHelperInterface |
This sample spelling service was extracted from the Proximity plug-in's implementation. Vendors should replace this implementation with their own.
This simple implementation checks words against a text file dictionary containing one word per line. The word being checked is looked up via a sequential search of the text file.
User dictionaries and the provision of a list of alternative words is not implemented but placeholders are indicated in the code where these facilities would typically be added.
kCHLSpellingImpl implements the spelling service for a single language. The Set method is used to pass paths to supporting data files (dictionaries etc.). IsCorrect(), FindAlternatives(), Spell(), IsCorrectGrammar() methods are called to spell check words when your spelling service has been selected as the active one to check the language.
/ Mitsutoshi Kikuta
| Binds the C implementation class onto its ImplementationID making the C code callable by the application * CHLSpelling::CHLSpelling | ( | IPMUnknown * | boss | ) |
Constructor.
| boss | interface ptr from boss object on which this interface is aggregated. |
| CHLSpelling::~CHLSpelling | ( | ) |
Destructor.
| virtual |
FindAllErrors() assumes that rParagraph is a paragraph that has to start with a capital.
| rParagraph | IN the paragraph to check. |
| startAt | IN the starting position for where to start reporting errors in the paragraph. |
| pSpellingErrors | OUT errors. vector is empty if no errors. |
Implements ISpellingService.
| virtual |
Look for an alternative word.
| rWord | IN to be checked word for alternative word. |
| pAlternatives | OUT the list of alternative words for this word. |
Implements ISpellingService.
| virtual |
FindError() assumes that rParagraph is a paragraph that has to start with a capital.
| rParagraph | IN the paragraph to check. |
| pErrorStart | OUT the position where the error starts. |
| pErrorLength | OUT the length of the error. |
| StartAt | IN the starting position for the paragraph. |
Implements ISpellingService.
| virtual |
Confirms whether the word is a correct spelling.
| rWord | IN to be checked word for spelling. |
| bEndsWithPeriod | OUT if the word ends with period. |
Implements ISpellingService.
| virtual |
IsCorrectGrammar() assumes that rParagraph is a paragraph that has to start with a capital. Notice that IsCorrectGrammar() does not check the word at the position, use IsCorrect() and Spell() instead.
| rParagraph | IN the paragraph to check its grammar. |
| pWordStart | OUT the position where the word start. |
| pWordLength | OUT the length of the word. |
| StartAt | IN the starting position for the paragraph . |
Implements ISpellingService.
| virtual |
Setting the spelling service.
| rCoreFileName | IN the core file name. |
| rLexFileName | IN the lex file name, not used in this sample. |
| rPhonFileName | IN the phon file name, not used in this sample. |
| rBaseLangLexFileName | IN the base language lex file name, not used in this sample. |
Implements ISpellingService.
| virtual |
Spell checking the word.
| rWord | IN to be checked word for spelling. |
| pAlternatives | OUT the list of alternative words for this word. |
| bEndsWithPeriod | OUT if the word ends with period. |
Implements ISpellingService.
| inlinevirtual |
Spelling service supports case sensitive.
Implements ISpellingService.