williamr@2: /* williamr@2: * Copyright (c) 2003-2007 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@2: * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members williamr@2: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: User dictionary interface williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: #ifndef _PTI_USERDICENTRY_H williamr@2: #define _PTI_USERDICENTRY_H williamr@2: williamr@2: // INCLUDES williamr@2: #include williamr@2: williamr@2: // CONSTANTS williamr@2: const TInt KMaxUserDictionaryEntrySize = 100; williamr@2: williamr@2: /** williamr@2: * An interface class for accessing items in user dictionary. williamr@2: */ williamr@2: class MPtiUserDictionaryEntry williamr@2: { williamr@2: public: williamr@2: /** williamr@2: * Returns a pointer to the word held by this user dictionary entry. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @return A pointer to user dictionary word. williamr@2: */ williamr@2: virtual TPtrC Word() const = 0; williamr@2: williamr@2: /** williamr@2: * Returns a pointer to latin alphabet "reading" version for this user williamr@2: * dictionary entry. Needed for Japanese input. williamr@2: * williamr@2: * @since S60 V2.6 williamr@2: * @return A pointer to reading word williamr@2: */ williamr@2: virtual TPtrC Reading() const = 0; // Needed for Japanese input. williamr@2: williamr@2: /** williamr@2: * Sets word for this user dictionary entry. This version also williamr@2: * sets reading text. williamr@2: * williamr@2: * @param aWord A descriptor containing word to be set. williamr@2: * @param aReading A descriptor containing reading text for aWord. williamr@2: * @since S60 V2.6 williamr@2: */ williamr@2: virtual void SetWord(TDesC& aWord, TDesC& aReading) = 0; williamr@2: williamr@2: /** williamr@2: * Sets word for this user dictionary entry. This version williamr@2: * sets reading text to same value as "word": williamr@2: * williamr@2: * @param aWord A descriptor containing word to be set. williamr@2: * @since S60 V2.6 williamr@2: */ williamr@2: virtual void SetWord(TDesC& aWord) = 0; williamr@2: }; williamr@2: williamr@2: williamr@2: /** williamr@2: * This is implementation of MPtiUserDictionaryEntry interface williamr@2: * for latin languages (or any other language, which needs williamr@2: * only one component (=word) for user dictionary entry). williamr@2: * Implementation of Reading() method is same as implementation of williamr@2: * Word() method. williamr@2: */ williamr@2: class TPtiUserDictionaryEntry : public MPtiUserDictionaryEntry williamr@2: { williamr@2: public: williamr@2: inline TPtiUserDictionaryEntry(); williamr@2: inline TPtiUserDictionaryEntry(const TDesC& aWord); williamr@2: williamr@2: inline TPtrC Word() const; williamr@2: inline TPtrC Reading() const; williamr@2: inline void SetWord(TDesC& aWord, TDesC& aReading); williamr@2: inline void SetWord(TDesC& aWord); williamr@2: williamr@2: private: williamr@2: TBuf iEntry; williamr@2: }; williamr@2: williamr@2: #include "PtiUserDicEntry.inl" williamr@2: williamr@2: #endif williamr@2: williamr@2: // End of file williamr@2: