userdict/inc/UdictModel.inl
branchRCL_3
changeset 12 e9f0e1110077
parent 9 38691ba2fda5
child 13 261ff9819be3
equal deleted inserted replaced
9:38691ba2fda5 12:e9f0e1110077
     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:     Inline functions of Japanese user dictionary Model class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 // INCLUDE FILES
       
    23 #include    <PtiCore.h>
       
    24 #include    <PtiEngine.h>
       
    25 
       
    26 // CONSTANTS
       
    27 const TInt KRegisterNecessarySpace(75);
       
    28 
       
    29 // ============================ MEMBER FUNCTIONS ===============================
       
    30 
       
    31 // -----------------------------------------------------------------------------
       
    32 // CUserDictModel::List
       
    33 // Returns "this" pointer as interface to the registered word list.
       
    34 // -----------------------------------------------------------------------------
       
    35 //    
       
    36 inline MDesCArray* CUserDictModel::List()
       
    37     {
       
    38     return this;
       
    39     }
       
    40 
       
    41 // -----------------------------------------------------------------------------
       
    42 // CUserDictModel::ListItem
       
    43 // -----------------------------------------------------------------------------
       
    44 //    
       
    45 inline const TUDictElement& CUserDictModel::ListItem(TInt aIndex) const
       
    46     {
       
    47     return iItemList->At(aIndex);
       
    48     }
       
    49 
       
    50 // -----------------------------------------------------------------------------
       
    51 // CUserDictModel::IsChangedByAnotherApp
       
    52 // -----------------------------------------------------------------------------
       
    53 //
       
    54 inline TBool CUserDictModel::IsChangedByAnotherApp() const
       
    55     {
       
    56     return iDictionary->UpdateFlag()
       
    57         && iPtiEngine->NumberOfEntriesInUserDictionary() != iItemList->Count();
       
    58     }
       
    59 
       
    60 // -----------------------------------------------------------------------------
       
    61 // CUserDictModel::SetChangeNotice
       
    62 // -----------------------------------------------------------------------------
       
    63 //
       
    64 inline void CUserDictModel::SetChangeNotice(TBool aFlag)
       
    65     {
       
    66     iDictionary->SetUpdateFlag(aFlag);
       
    67     }
       
    68 
       
    69 // -----------------------------------------------------------------------------
       
    70 // CUserDictModel::IsDictionaryFull
       
    71 // -----------------------------------------------------------------------------
       
    72 //
       
    73 inline TBool CUserDictModel::IsDictionaryFull()
       
    74     {
       
    75     // Checks the left space of the User dictionary data area.
       
    76     TInt leftSpace(iDictionary->SpaceLeft());
       
    77     return (leftSpace >= 0 && leftSpace < KRegisterNecessarySpace) 
       
    78            ? ETrue : EFalse;
       
    79     }
       
    80 
       
    81 // -----------------------------------------------------------------------------
       
    82 // CUserDictModel::ReloadDictInfoL
       
    83 // -----------------------------------------------------------------------------
       
    84 //
       
    85 inline void CUserDictModel::ReloadDictInfoL()
       
    86     {
       
    87     iPtiEngine->HandleCommandL(EPtiCommandReloadLearningInfo);
       
    88     }
       
    89 
       
    90 // -----------------------------------------------------------------------------
       
    91 // CUserDictModel::DelaySavingL
       
    92 // -----------------------------------------------------------------------------
       
    93 //
       
    94 inline void CUserDictModel::DelaySavingL()
       
    95     {
       
    96     iPtiEngine->HandleCommandL(EPtiCommandUserDictionaryDelaySaving);
       
    97     }
       
    98 
       
    99 // -----------------------------------------------------------------------------
       
   100 // CUserDictModel::SaveNowL
       
   101 // -----------------------------------------------------------------------------
       
   102 //
       
   103 inline void CUserDictModel::SaveNowL()
       
   104     {
       
   105     iPtiEngine->HandleCommandL(EPtiCommandUserDictionarySaveNow);
       
   106     }
       
   107 
       
   108 //  End of File