userdict/inc/UdictElement.h
changeset 0 9a3a17bfeb67
equal deleted inserted replaced
-1:000000000000 0:9a3a17bfeb67
       
     1 /*
       
     2 * Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:     This class represents an element of Japanese user dictionary
       
    15 *                for Japanese FEP.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 #ifndef UDICTELEMENT_H
       
    25 #define UDICTELEMENT_H
       
    26 
       
    27 //  INCLUDES
       
    28 #include    <e32base.h>
       
    29 #include    <PtiUserDicEntry.h>
       
    30 #include    "UserDict.hrh"
       
    31 
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35 * This class represents an element of Japanese user dictionary
       
    36 * for Japanese FEP.
       
    37 * It contains two string buffers for a word text and  a reading text.
       
    38 *  @since 2.6
       
    39 */
       
    40 class TUDictElement  : public MPtiUserDictionaryEntry
       
    41     {
       
    42     public:
       
    43 
       
    44        /**
       
    45         * C++ default constructor.
       
    46         */   
       
    47         TUDictElement();
       
    48 
       
    49     public: // New functions
       
    50 
       
    51         /**
       
    52         * Returns the descriptor which has a ListBox's separator character,
       
    53         * for using to ListBox item.
       
    54         * @return the descriptor with a ListBox separator.
       
    55         */
       
    56         inline const TDesC& ListItemText() const;
       
    57 
       
    58         /**
       
    59         * Sets aReading to the buffer of the reading descriptor.
       
    60         * @param aReading is set to the reading buffer. 
       
    61         */
       
    62         inline void SetReading(TDesC& aReading);
       
    63 
       
    64         /**
       
    65         * Compares to the other element.
       
    66         * @param aElement to be compared to this 
       
    67         * @return zero, if the both elements are identical.
       
    68         */
       
    69         inline TInt operator!=(const TUDictElement& aElement) const;
       
    70         
       
    71         /**
       
    72         * Tests if this element is empty.
       
    73         * @return zero, if this element isn't empty.
       
    74         */
       
    75         inline TInt IsEmpty() const;
       
    76 
       
    77     public: // Functions from base classes
       
    78 
       
    79         /**
       
    80         * From MPtiUserDictionaryEntry 
       
    81         * Returns the word descriptor.
       
    82         * @return the word descriptor.
       
    83         */
       
    84         TPtrC Word() const;
       
    85 
       
    86         /**
       
    87         * From MPtiUserDictionaryEntry 
       
    88         * Returns the reading descriptor.
       
    89         * @return the reading descriptor.
       
    90         */
       
    91         TPtrC Reading() const;
       
    92 
       
    93         /**
       
    94         * From MPtiUserDictionaryEntry 
       
    95         * Sets aWord to the buffer of the word descriptor.
       
    96         * @param aWord is set to the word buffer. 
       
    97         */
       
    98         void SetWord(TDesC& aWord);
       
    99 
       
   100     private: // Functions from base classes
       
   101 
       
   102         /**
       
   103         * From MPtiUserDictionaryEntry 
       
   104         * Sets word and reading descriptor.
       
   105         *
       
   106         * @param aWord is set to the word buffer.
       
   107         * @param aReading is set to the reading buffer.
       
   108         */
       
   109         void SetWord(TDesC& aWord, TDesC& aReading);
       
   110 
       
   111     private: // Data
       
   112 
       
   113         // Word buffer
       
   114         // The buffer needs one additional room for a ListBox separator. 
       
   115         TBuf<EUseDictWordBuffer + 1> iWord;
       
   116  
       
   117         // Reading buffer
       
   118         TBuf<EUseDictReadingBuffer> iReading;
       
   119     };
       
   120 
       
   121 #include    "UdictElement.inl"
       
   122 
       
   123 #endif      // UDICTELEMENT_H
       
   124             
       
   125 // End of File