InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CHLUserDictService Class Reference
Inheritance diagram for CHLUserDictService:
CPMUnknown< IUserDictService >IUserDictServiceIPMUnknown

Public Member Functions

 CHLUserDictService (IPMUnknown *boss)
 
virtual bool16 IsReadOnly (IUserDict *userDict)
 
virtual bool16 CloseNotClamFile ()
 
virtual bool16 Flush ()
 
virtual bool16 IsWordInMainDict (const WideString &rWord, const HyphenPoints *pPoints)
 
virtual bool16 AddToUserDict (IUserDict *userDict, const UserDictWordList &constWordList, bool16 caseSensitive, bool16 addToNotList)
 
virtual bool16 AddToUserDict (IUserDict *userDict, const WideString &rWord, const HyphenPoints *pPoints, bool16 caseSensitive)
 
virtual bool16 RemoveFromUserDict (IUserDict *userDict, const WideString &rWord)
 
virtual bool16 ClearUserDict (IUserDict *userDict)
 
virtual bool16 RemoveFromMainDict (const WideString &rWord)
 
virtual bool16 UndoRemoveFromMainDict (const WideString &rWord)
 
virtual bool16 ClearRemovedFromMainDict (IUserDict *userDict)
 
virtual bool16 Bind (IUserDict *userDict, const WideString &rWord, const WideString &rReplace)
 
virtual bool16 Unbind (IUserDict *userDict, const WideString &rWord, const WideString &rReplace)
 
virtual UserDictType GetCorrectedWord (IUserDict *userDict, const WideString &rWord, WideString *pCorrectedWord)
 
virtual bool16 GetHyphenatedWord (IUserDict *userDict, const WideString &rWord, WideString *pHyphenatedWord)
 
virtual bool16 AddUserDictToSearchPath (IUserDict *userDict, int32 index, bool16 addToVendorList, bool16 initializing)
 
virtual bool16 MoveUserDictInSearchPath (int32 oldIndex, int32 newIndex)
 
virtual bool16 RemoveUserDictFromSearchPath (IUserDict *userDict)
 
virtual bool16 ReplaceUserDictInSearchPath (IUserDict *originalUserDict, IUserDict *newUserDict)
 
virtual int32 QueryAllUserDictsInSearchPath (K2Vector< IUserDict * > &userDictList, bool16 bOpenFiles)
 
virtual int32 RemoveAllUserDictsFromSearchPath (void)
 
virtual IUserDictQueryNotUserDict (void)
 
virtual IUserDictQueryMainUserDict (void)
 
virtual bool16 SetMainUserDict (IUserDict *userDict)
 
virtual IUserDictCreateNewUserDict (const PMString &filePathName, int16 createFlags)
 
virtual bool16 MigrateUserDict (const IDFile &existingDictFile, const IDFile &newDictFile)
 
virtual bool16 InitializePaths (void)
 
virtual void FlushUserDicts (void)
 
virtual const PMStringGetDefaultFilePathName (void) const
 
virtual const PMStringGetNotFilePathName (void) const
 
- Public Member Functions inherited from CPMUnknown< IUserDictService >
IPMUnknownQueryInterface (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
 
CPMUnknownoperator= (const CPMUnknown &)=delete
 

Additional Inherited Members

- Public Types inherited from IUserDictService
enum  { kDefaultIID = IID_IUSERDICTSERVICE }
 
enum  WordType { kIsAWord, kNotAWord }
 
enum  UserDictType { kNone, kIsDict, kNotDict }
 
enum  CreateType { kDoNotCreate, kCreateIfNotFound, kAlwaysCreate, kCreateMemoryOnly }
 
- Protected Member Functions inherited from CPMUnknown< IUserDictService >
 CPMUnknown (IPMUnknown *boss)
 
- Protected Attributes inherited from CPMUnknown< IUserDictService >
HelperInterface fHelperInterface
 

Detailed Description

Implements a user dictionary service.

Member Function Documentation

bool16 CHLUserDictService::AddToUserDict (IUserDictuserDict,
const UserDictWordListconstWordList,
bool16 caseSensitive,
bool16 addToNotList 
)
virtual

Adds words to user dictionary.

If words are in NotUserDict(see QueryNotUserDict) then the add also removes word from NotUserDict. If userDict is the same as QueryNotUserDict then words are added to NotUserDict and removed from main user dict.

Parameters
userDictuser dictionary to add to
constWordListwords to add
caseSensitiveif kFalse words to add are lower case which service providers should interperate as "case insensitive"
addToNotListif kTrue add words to not list. Only works for the Main and memory user dictionaries.
Returns
bool16 kTrue if words were added.

Implements IUserDictService.

bool16 CHLUserDictService::AddToUserDict (IUserDictuserDict,
const WideStringrWord,
const HyphenPointspPoints,
bool16 caseSensitive 
)
virtual

Adds word to user dictionary.

If word was in NotUserDict(see QueryNotUserDict) then the add also removes word from NotUserDict. If userDict is the same as QueryNotUserDict then word is added to NotUserDict and removed from main user dict.

Parameters
userDictuser dictionary to add to
rWordword to add
pPointshyphen points to give word
caseSensitiveif kFalse word is added as lower case which service providers should interperate as "case insensitive"
Returns
bool16 kTrue if word was added.

Implements IUserDictService.

bool16 CHLUserDictService::AddUserDictToSearchPath (IUserDictuserDict,
int32 index,
bool16 addToVendorList,
bool16 initializing 
)
virtual

Adds user dictionary to dictionaries list.

Parameters
userDictuser dictionary to be added.
indexindex in the dictionaries list where user dictionary will be inserted. -1 if add to the end of the list
addToVendorListkTrue if the user dictionary should be added to IVendorList. kFalse ONLY FOR USE INSIDE IUserDictService implementation. Calling code should always use kTrue.
initializingkTrue if in initializing code. kTrue ONLY FOR USE INSIDE IUserDictService implementation. Calling code should always use kFalse.
Returns
bool16 kTrue if the user dictionary was added successfully.

Implements IUserDictService.

bool16 CHLUserDictService::Bind (IUserDictuserDict,
const WideStringrChangeFrom,
const WideStringrChangeTo 
)
virtual

UNSUPPORTED

Implements IUserDictService.

bool16 CHLUserDictService::ClearRemovedFromMainDict (IUserDictuserDict)
virtual

Clears removed words from main dictionary.

This really clear the words in NotUserDict (see QueryNotUserDict).

Returns
bool16 kTrue if words were removed.

Implements IUserDictService.

bool16 CHLUserDictService::ClearUserDict (IUserDictuserDict)
virtual

Clears word from user dictionary.

Parameters
userDictuser dictionary to clear from
Returns
bool16 kTrue if words were removed.

Implements IUserDictService.

bool16 CHLUserDictService::CloseNotClamFile ()
virtual

UNSUPPORTED

Implements IUserDictService.

IUserDict * CHLUserDictService::CreateNewUserDict (const PMStringfilePathName,
int16 createFlags 
)
virtual

Creates a new user dictionary. Caller is responsible for IUserDict.

Parameters
filePathNameFile path of the user dictionary. Parameter is ignored if kCreateMemoryOnly.
createFlags0 = do not create, 1 = create if not found, 2 = always create 3 = create memory only dictionary. See CreateType.
Returns
IUserDict* pointer to the new user dictionary.

Implements IUserDictService.

bool16 CHLUserDictService::Flush ()
virtual

Flushes data files.

Returns
bool16 kTrue if succeeded.

Implements IUserDictService.

void CHLUserDictService::FlushUserDicts (void )
virtual

Flushes user dictionary list.

Implements IUserDictService.

IUserDictService::UserDictType CHLUserDictService::GetCorrectedWord (IUserDictuserDict,
const WideStringrWord,
WideStringpCorrectedWord 
)
virtual

Checks user dictionary for word.

Parameters
userDictuser dictionary to check. nil checks main user dictionary
rWordword to look for
pCorrectedWord[OUT] same as rWord unless word was added with a correction. This string is empty when kNotDict is returned.
Returns
UserDictType if and how found. kNone if not in user dictionary. kIsDict if in user dictionary as a word. kNotDict if in user dictionary as not a word.

Implements IUserDictService.

const PMString & CHLUserDictService::GetDefaultFilePathName (void ) const
virtual

Returns default data file path name.

Returns
PMString& default data file path string.

Implements IUserDictService.

bool16 CHLUserDictService::GetHyphenatedWord (IUserDictuserDict,
const WideStringrWord,
WideStringpHyphenatedWord 
)
virtual

UNSUPPORTED

Implements IUserDictService.

const PMString & CHLUserDictService::GetNotFilePathName (void ) const
virtual

UNSUPPORTED

Implements IUserDictService.

bool16 CHLUserDictService::InitializePaths (void )
virtual

Creates a user dict object for each path saved in the vendor data.

Returns
bool16 kTrue if successfully created user dict object for each path.

Implements IUserDictService.

bool16 CHLUserDictService::IsReadOnly (IUserDictuserDict)
virtual

Checks if the user dictionary is read only.

Parameters
userDictuser dictionary to check for.
Returns
bool16 kTrue if the user dictionary is read only, kFalse otherwise.

Implements IUserDictService.

bool16 CHLUserDictService::IsWordInMainDict (const WideStringrWord,
const HyphenPointspPoints 
)
virtual

UNSUPPORTED

Implements IUserDictService.

virtual bool16 CHLUserDictService::MigrateUserDict (const IDFileexistingDictFile,
const IDFilenewDictFile 
)
inlinevirtual

Migrates a user dictionary in an old format.

Parameters
existingDictFileFile to convert to new format
newDictFileFile to create in new format. Can be an existing file or the same as existingDictFile in the case of an existing file _temp is added to the name as a temp file and the temp file is deleted after if _temp cannot be created MigrateUserDict fails.
Returns
bool16 true if file was migrated

Implements IUserDictService.

bool16 CHLUserDictService::MoveUserDictInSearchPath (int32 oldIndex,
int32 newIndex 
)
virtual

Move user dictionary in dictionaries list.

Parameters
oldIndexindex of user dictionary to be moved.
newIndexnew location of user dictionary. -1 if move to the end of the list
Returns
bool16 kTrue if the user dictionary was moved successfully.

Implements IUserDictService.

int32 CHLUserDictService::QueryAllUserDictsInSearchPath (K2Vector< IUserDict * > & userDictList,
bool16 bOpenFiles 
)
virtual

Queries all user dictionaries in dictionaries list.

This is not really a Query. It should be named Get. It does not add ref the IUserDicts in the list so you should not call release.

Parameters
userDictList[OUT] list of all user dictionaries.
bOpenFileskTrue if need to open data files.
Returns
int32 count of user dictionaries in the returned list.

Implements IUserDictService.

IUserDict * CHLUserDictService::QueryMainUserDict (void )
virtual

Return main user dictionary.

Returns
IUserDict* main user dictionary

Implements IUserDictService.

IUserDict * CHLUserDictService::QueryNotUserDict (void )
virtual

returns the pointer to NotUserDict.

Returns
IUserDict* pointer to NotUserDict.

Implements IUserDictService.

int32 CHLUserDictService::RemoveAllUserDictsFromSearchPath (void )
virtual

Removes all user dictionaries in dictionaries list.

Returns
int32 count of user dictionaries removed.

Implements IUserDictService.

bool16 CHLUserDictService::RemoveFromMainDict (const WideStringrWord)
virtual

Removes word from main dictionary.

This really adds the word to the NotUserDict (see QueryNotUserDict). It also removes the word from the main user dictionary if it was in there.

Parameters
rWordword to remove
Returns
bool16 kTrue if word was removed.

Implements IUserDictService.

bool16 CHLUserDictService::RemoveFromUserDict (IUserDictuserDict,
const WideStringrWord 
)
virtual

Removes word from user dictionary.

Parameters
userDictuser dictionary to remvoe from
rWordword to remove
Returns
bool16 kTrue if word was removed.

Implements IUserDictService.

bool16 CHLUserDictService::RemoveUserDictFromSearchPath (IUserDictuserDict)
virtual

Removes user dictionary from dictionaries list.

Parameters
userDictuser dictionary to be removed.
Returns
bool16 kTrue if the user dictionary was removed successfully.

Implements IUserDictService.

bool16 CHLUserDictService::ReplaceUserDictInSearchPath (IUserDictoriginalUserDict,
IUserDictnewUserDict 
)
virtual

Replaces the specified user dictionary in dictionaries list with supplied new user dictionary.

Parameters
originalUserDictuser dictionary to be replaced.
newUserDictnew user dictionary to be added.
Returns
bool16 kTrue if the original user dictionary was replaced by new one successfully.

Implements IUserDictService.

bool16 CHLUserDictService::SetMainUserDict (IUserDictuserDict)
virtual

UNSUPPORTED

Implements IUserDictService.

bool16 CHLUserDictService::Unbind (IUserDictuserDict,
const WideStringrChangeFrom,
const WideStringrChangeTo 
)
virtual

UNSUPPORTED

Implements IUserDictService.

bool16 CHLUserDictService::UndoRemoveFromMainDict (const WideStringrWord)
virtual

Undo remove word from main dictionary.

This really removes the word from the NotUserDict (see QueryNotUserDict).

Parameters
rWordword to undo remove
Returns
bool16 kTrue if word was removed.

Implements IUserDictService.