fep/aknfep/src/AknFepUiInputStateEntryKatakana.cpp
changeset 40 2cb9bae34d17
parent 31 f1bdd6b078d1
child 49 37f5d84451bd
equal deleted inserted replaced
31:f1bdd6b078d1 40:2cb9bae34d17
     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:           
       
    15 *       Provides the TAknFepUiInputStateEntryKatakana methods.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 
       
    30 // INCLUDE FILES
       
    31 #include "AknFepUiInputStateEntryKatakana.h"
       
    32 #include "AknFepUIManagerStateInterface.h"   // MAknFepUIManagerStateInterface
       
    33 #include "AknFepManagerUIInterface.h"        // MAknFepManagerUIInterface
       
    34 #include "AknFepGlobalEnums.h"
       
    35 
       
    36 #include <PtiDefs.h>                     // keys
       
    37 #include <PtiEngine.h>
       
    38 #include <PtiCompositionDataIF.h>        // MPtiEngineCompositionDataInterface
       
    39 #include <avkon.rsg>
       
    40 
       
    41 // CONSTANTS
       
    42 
       
    43 /**
       
    44  *  TAknFepUiInputStateEntryKatakana class.
       
    45  * 
       
    46  */
       
    47 //============================ MEMBER FUNCTIONS ==============================
       
    48 
       
    49 // ---------------------------------------------------------------------------
       
    50 // TAknFepUiInputStateEntryKatakana::
       
    51 //                                  TAknFepUiInputStateEntryKatakana
       
    52 // C++ default Constructor
       
    53 // ---------------------------------------------------------------------------
       
    54 //
       
    55 TAknFepUiInputStateEntryKatakana::TAknFepUiInputStateEntryKatakana(
       
    56                                 MAknFepUIManagerStateInterface* aOwner,
       
    57                                 MAknFepUICtrlContainerJapanese* aUIContainer)
       
    58     :TAknFepUiInputStateEntryJapaneseMultitap(aOwner, aUIContainer)
       
    59     {
       
    60     }
       
    61 
       
    62 // ---------------------------------------------------------------------------
       
    63 // TAknFepUiInputStateEntryKatakana::InitializeStateL
       
    64 // Initialize State
       
    65 // ---------------------------------------------------------------------------
       
    66 //
       
    67 void TAknFepUiInputStateEntryKatakana::InitializeStateL()
       
    68     {
       
    69     // In case of Katakana and Hiragana input, underline and highlight aren't always shown.
       
    70     iOwner->SetInlineEditUnderlineVisibility(EFalse);
       
    71     }
       
    72 
       
    73 // ---------------------------------------------------------------------------
       
    74 // TAknFepUiInputStateEntryKatakana::HandleNumericShortKeyL
       
    75 // Handling short keypress events of the numeric and the star.
       
    76 // ---------------------------------------------------------------------------
       
    77 //
       
    78 TBool TAknFepUiInputStateEntryKatakana::HandleNumericShortKeyL(TInt aKey)
       
    79     {
       
    80     CPtiEngine* ptiEngine = iOwner->PtiEngine();
       
    81     TBool ret = EFalse;
       
    82     if (aKey == EPtiKeyStar)
       
    83         {
       
    84         iOwner->FepMan()->SetInlineEditingCursorVisibilityL(ETrue);
       
    85         }
       
    86     ptiEngine->AppendKeyPress((TPtiKey)aKey);
       
    87 
       
    88 	if ( iOwner->IsQwerty() )
       
    89 		{
       
    90 		const MPtiEngineCompositionDataInterface* data = ptiEngine->CompositionData();
       
    91 		TPtrC text = data->CompletedString();
       
    92 		// In case of Katakana and Hiragana transitory input,
       
    93 		// underline and highlight are shown.
       
    94 		iOwner->SetInlineEditUnderlineVisibility(
       
    95 				(text.Length() > 0)? EFalse : ETrue);
       
    96 		}
       
    97 	else
       
    98 		{
       
    99 		// In case of Katakana and Hiragana input, underline and highlight aren't always shown .
       
   100 		iOwner->SetInlineEditUnderlineVisibility( EFalse );
       
   101 		}
       
   102 
       
   103     ret = UpdateInlineEditingCharacterL();
       
   104     return ret;
       
   105     }
       
   106 
       
   107 // End of file