fep/aknfep/inc/aknfepinputstatepinyinphrasecreationbase.h
changeset 40 2cb9bae34d17
parent 31 f1bdd6b078d1
child 49 37f5d84451bd
equal deleted inserted replaced
31:f1bdd6b078d1 40:2cb9bae34d17
     1 /*
       
     2 * Copyright (c) 2008 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:           
       
    15  *      Provides the TAknFepInputStateEntryPinyinPhraseCreation methods.
       
    16  *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 
       
    30 #ifndef T_AKNFEPINPUTSTATEPINYINPHRASECREATIONBASE_H
       
    31 #define T_AKNFEPINPUTSTATEPINYINPHRASECREATIONBASE_H
       
    32 
       
    33 #include <PtiDefs.h>                            //keys
       
    34 
       
    35 #include "AknFepUiInputStateCandidateBase.h"
       
    36 
       
    37 enum TMkeyReturnValue
       
    38     {
       
    39     EKeyStrokeNull = -2, //  neans the keystroke is null  
       
    40     EKeyDelimiter,   // means the input key is delimiter
       
    41     EkeyNumber       // means the input key is the number( from 2 to 9 )
       
    42     };
       
    43 
       
    44 class TAknFepInputStatePinyinPhraseCreationBase : public TAknFepInputStateCandidateBase
       
    45     {
       
    46 public:
       
    47     
       
    48     /**
       
    49      * C++ constructor.
       
    50      * 
       
    51      * @since S60 v5.0.
       
    52      * @return self object.
       
    53      */  
       
    54     TAknFepInputStatePinyinPhraseCreationBase(
       
    55                                     MAknFepUIManagerStateInterface* aOwner,
       
    56                                     MAknFepUICtrlContainerChinese* aUIContainer);
       
    57     
       
    58     /**
       
    59      * Add keystroke.
       
    60      * 
       
    61      * @param aKey the input keystroke.
       
    62      * @since S60 v5.0.
       
    63      * @return ETrue if that the key can add to the current keystroke, EFase others.
       
    64      */            
       
    65     TBool AddKeystroke( TInt aKey );
       
    66     
       
    67     /**
       
    68      * Add tone mark.
       
    69      * 
       
    70      * @since S60 v5.0.
       
    71      * @return ETrue if that the key can add to the current keystroke, EFase others.
       
    72      */            
       
    73     TBool AddToneMark(); 
       
    74     
       
    75     /**
       
    76      * get the valid keystroke.
       
    77      * 
       
    78      * @since S60 v5.0.
       
    79      * @return ETrue if valid keystroke happen change , EFase others.
       
    80      */            
       
    81     TBool GetValidKeystroke();
       
    82     
       
    83     /**
       
    84      * Delete current keystroke.
       
    85      * 
       
    86      * @since S60 v5.0.
       
    87      * @return ETrue if that can be deleted, EFase others.
       
    88      */            
       
    89     TBool DeleteCurrentKeystroke();
       
    90     
       
    91     /**
       
    92      * Revert the current chinse to keystroke.
       
    93      * 
       
    94      * @since S60 v5.0.
       
    95      * @return ETrue if that can be deleted, EFase others.
       
    96      */            
       
    97     TBool ChineseRevertKeystroke();
       
    98     
       
    99     /**
       
   100      * show info to the eep ctrl.
       
   101      * 
       
   102      * @since S60 v5.0.
       
   103      * @return none.
       
   104      */            
       
   105     void ShowInfo();
       
   106     
       
   107     /**
       
   108      * set the show info warning color.
       
   109      * 
       
   110      * @since S60 v5.0.
       
   111      * @return none.
       
   112      */            
       
   113     void SetWarningColor();
       
   114     
       
   115     /**
       
   116      * Get the candidate info.
       
   117      * 
       
   118      * @since S60 v5.0.
       
   119      * @return none.
       
   120      */            
       
   121     void GetCandidate( TInt aSelection = 0 );
       
   122     
       
   123     /**
       
   124      * Change CBA.
       
   125      *
       
   126      * @since S60 v5.0
       
   127      * @return None.
       
   128      */        
       
   129     void ChangeCba();
       
   130   
       
   131     /**
       
   132      * Refresh the candidate info.
       
   133      * 
       
   134      * @since S60 v5.0.
       
   135      * @return none.
       
   136      */            
       
   137     void RefreshCandidate();
       
   138     
       
   139     /**
       
   140      * Update Selection
       
   141      *
       
   142      * @since S60 v5.0
       
   143      * @param aSelection the index of selecion.
       
   144      * @return None.
       
   145      */ 
       
   146     void RefreshUI(TInt aSelection = 0);
       
   147     
       
   148     /**
       
   149      * clear Selection
       
   150      *
       
   151      * @since S60 v5.0
       
   152      * @return None.
       
   153      */
       
   154     void ClearDeliberateSelection();
       
   155     
       
   156     /**
       
   157      * Update indicator
       
   158      *
       
   159      * @since S60 v5.0
       
   160      * @return None.
       
   161      */
       
   162     void UpdateIndicator();
       
   163     
       
   164 private:
       
   165     
       
   166     /**
       
   167      * clear the keystroke of PtiEngine.
       
   168      * 
       
   169      * @since S60 v5.0.
       
   170      * @return none.
       
   171      */
       
   172     void ClearPtiEngineKeystroke();
       
   173     
       
   174     /**
       
   175      * Add keystroke.
       
   176      * 
       
   177      * @param aKey the input keystroke.
       
   178      * @since S60 v5.0.
       
   179      * @return ETrue if that the key can add to the current keystroke, EFase others.
       
   180      */            
       
   181     TBool AddKeystrokeL( TInt aKey );  
       
   182     
       
   183     /**
       
   184      * Add tone mark.
       
   185      * 
       
   186      * @since S60 v5.0.
       
   187      * @return ETrue if that the key can add to the current keystroke, EFase others.
       
   188      */            
       
   189     TBool AddToneMarkL(); 
       
   190     
       
   191     /**
       
   192      * check the keystroke.
       
   193      * 
       
   194      * @param aInput the input keystroke.
       
   195      * @since S60 v5.0.
       
   196      * @return ETrue if the input param is tone mark, EFalse others.
       
   197      */            
       
   198     TBool IsToneMark( const TDesC& aInput );
       
   199     
       
   200     /**
       
   201      * check the keystroke.
       
   202      * 
       
   203      * @since S60 v5.0.
       
   204      * @return EFalse if that have invalid keystroke, ETrue others.
       
   205      */            
       
   206     TBool CheckKeystroke();
       
   207     
       
   208     /**
       
   209      * get the valid keystroke.
       
   210      * 
       
   211      * @since S60 v5.0.
       
   212      * @return ETrue if that have valid keystroke than happens change, EFase others.
       
   213      */            
       
   214     TBool GetValidKeystrokeL();
       
   215     
       
   216     /**
       
   217      * get the key code.
       
   218      * 
       
   219      * @param aKey the TPtiKey.
       
   220      * @param aKeystroke the input show key.
       
   221      * 
       
   222      * @since S60 v5.0.
       
   223      * @return -2 the aKeystroke is null,-1 if the input key is delimiter, 
       
   224      *  0 the input key is 2 - 9, others return tome mark.
       
   225      */
       
   226     TInt GetKeystrokeCode( TPtiKey& aKey, 
       
   227                            const TDesC& aKeystroke );
       
   228     
       
   229     /**
       
   230      * Append the key to the ptiengine.
       
   231      * 
       
   232      * @param aKey the TPtiKey.
       
   233      * @param aKey the add the spelling to the spelling array flag.
       
   234      * @since S60 v5.0.
       
   235      * @return ETrue if ptiengine can append keypress, others return EFalse.
       
   236      */
       
   237     TBool AppendKeyPressL( TPtiKey& aKey, TBool aAddSpellingFlag );
       
   238     
       
   239     
       
   240     /**
       
   241      * Append the tone mark to the ptiengine.
       
   242      * 
       
   243      * @param aToneMark the tone mark.
       
   244      * 
       
   245      * @since S60 v5.0.
       
   246      * @return ETrue if ptiengine can append tone mark, others return EFalse.
       
   247      */
       
   248     TBool AppendToneMarkL( TInt& aToneMark );
       
   249     
       
   250     /**
       
   251      * Revert the current chinse to keystroke.
       
   252      * 
       
   253      * @since S60 v5.0.
       
   254      * @return ETrue if that can be deleted, EFase others.
       
   255      */            
       
   256     TBool ChineseRevertKeystrokeL();
       
   257     
       
   258     /**
       
   259      * check the spelling delete the phrase spelling.
       
   260      * 
       
   261      * @since S60 v5.0.
       
   262      * @return none.
       
   263      */
       
   264     void CheckSpellingL( CDesCArrayFlat* aTempSpelling, CDesCArrayFlat* aAfterCheck );
       
   265     
       
   266     /**
       
   267      * check the tone mark and delete the phrase spelling.
       
   268      * 
       
   269      * @param aToneMark the tone mark.
       
   270      * @since S60 v5.0.
       
   271      * @return ETrue if the spelling is valid, EFalse others.
       
   272      */
       
   273     TBool CheckToneMark( TInt& aToneMark );
       
   274     
       
   275     /**
       
   276      * Get the candidate info.
       
   277      * 
       
   278      * @since S60 v5.0.
       
   279      * @return none.
       
   280      */            
       
   281     void GetCandidateL( TInt aSelection );
       
   282     
       
   283     /**
       
   284      * Change CBA.
       
   285      *
       
   286      * @since S60 v5.0
       
   287      * @return None.
       
   288      */        
       
   289     void ChangeCbaL();
       
   290     
       
   291     };
       
   292 
       
   293 #endif /*T_AKNFEPINPUTSTATEPINYINPHRASECREATIONBASE_H*/
       
   294 
       
   295 // End of file
       
   296