textinput/peninputvkbcn/src/peninputvkbuistatecompositionnochars.cpp
changeset 0 eb1f2e154e89
equal deleted inserted replaced
-1:000000000000 0:eb1f2e154e89
       
     1 /*
       
     2 * Copyright (c) 2002-2005 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:  Implementation of the vkb ui state machine (compositionnochars)
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // user includes
       
    20 #include "peninputvkbuistatecompositionnochars.h"
       
    21 #include "peninputvkbevent.h"
       
    22 #include "peninputvkblayout.h"
       
    23 #include "peninputvkbwindow.h"
       
    24 // ======== MEMBER FUNCTIONS ========
       
    25 
       
    26 // Implementation of Class CAknFepVkbUiStateCompositionNoChars
       
    27 
       
    28 // -----------------------------------------------------------------------------
       
    29 // CAknFepVkbUiStateCompositionNoChars::CAknFepVkbUiStateCompositionNoChars
       
    30 // (other items were commented in a header).
       
    31 // -----------------------------------------------------------------------------
       
    32 //
       
    33 CAknFepVkbUiStateCompositionNoChars::CAknFepVkbUiStateCompositionNoChars(
       
    34                                        MAknFepVkbUiStateMgr* aUiStateMgr, 
       
    35                                        MAknFepVkbLayoutContext* aContext)
       
    36     :CAknFepVkbUiState(aUiStateMgr,aContext)
       
    37     {
       
    38     }
       
    39        
       
    40 // -----------------------------------------------------------------------------
       
    41 // CAknFepVkbUiStateCompositionNoChars::NewL
       
    42 // (other items were commented in a header).
       
    43 // -----------------------------------------------------------------------------
       
    44 //
       
    45 CAknFepVkbUiStateCompositionNoChars* CAknFepVkbUiStateCompositionNoChars::
       
    46                         NewL(MAknFepVkbUiStateMgr* aUiStateMgr, MAknFepVkbLayoutContext* aContext)
       
    47     {
       
    48     CAknFepVkbUiStateCompositionNoChars* self = new ( ELeave ) 
       
    49                         CAknFepVkbUiStateCompositionNoChars(aUiStateMgr,aContext);
       
    50     CleanupStack::PushL(self);
       
    51     self->ConstructL(); 
       
    52     CleanupStack::Pop();
       
    53     return self;
       
    54     }  
       
    55       
       
    56 // -----------------------------------------------------------------------------
       
    57 // CAknFepVkbUiStateCompositionNoChars::~CAknFepVkbUiStateCompositionNoChars
       
    58 // (other items were commented in a header).
       
    59 // -----------------------------------------------------------------------------
       
    60 //
       
    61 CAknFepVkbUiStateCompositionNoChars::~CAknFepVkbUiStateCompositionNoChars()
       
    62     {
       
    63     }
       
    64 
       
    65 // -----------------------------------------------------------------------------
       
    66 // CAknFepVkbUiStateCompositionNoChars::HandleKeyEventL
       
    67 // (other items were commented in a header).
       
    68 // -----------------------------------------------------------------------------
       
    69 //
       
    70 TBool CAknFepVkbUiStateCompositionNoChars::HandleKeyEventL(const TRawEvent& aData)     
       
    71     {
       
    72     if ( static_cast<CAknFepVkbLayout*>(iContext)->Window()->FocusedControlID()
       
    73           == EAknFepVkbCtrlIdCompositionField)
       
    74         {
       
    75         if (aData.ScanCode() == EStdKeyLeftArrow || aData.ScanCode() == EStdKeyRightArrow)
       
    76             {
       
    77             return ETrue;
       
    78             }
       
    79         }
       
    80     return EFalse;
       
    81     }
       
    82 
       
    83 // -----------------------------------------------------------------------------
       
    84 // CAknFepVkbUiStateCompositionNoChars::HandleVkbEvent
       
    85 // (other items were commented in a header).
       
    86 // -----------------------------------------------------------------------------
       
    87 //
       
    88 TBool CAknFepVkbUiStateCompositionNoChars::HandleVkbEvent(TInt /*aEventType*/,
       
    89                                                           const TDesC& aEventData)
       
    90     {
       
    91     TKeyEvent* event = (TKeyEvent*) aEventData.Ptr();
       
    92     if ( IsFilterUnicode(event->iScanCode) )
       
    93         {
       
    94         iUiStateMgr->SetCurrentUiState(iUiStateMgr->UiStateStandbycn());
       
    95         iContext->ForceEditGainFocus(EInputContextFieldGetFocus);    
       
    96         return SendKey(aEventData);                
       
    97         }
       
    98     else
       
    99         {
       
   100         iUiStateMgr->SetCurrentUiState(iUiStateMgr->UiStateCompositionWithChars());  
       
   101         iContext->SendEventToVkbControl(EVkbEventStandby2Composition,NULL);                
       
   102         return EFalse;  
       
   103         }
       
   104     }
       
   105     
       
   106 // -----------------------------------------------------------------------------
       
   107 // CAknFepVkbUiStateCompositionNoChars::HandleBackEvent
       
   108 // (other items were commented in a header).
       
   109 // -----------------------------------------------------------------------------
       
   110 //
       
   111 TBool CAknFepVkbUiStateCompositionNoChars::HandleBackEvent(TInt /*aEventType*/,
       
   112                                                            const TDesC& aEventData)
       
   113     {
       
   114     iUiStateMgr->SetCurrentUiState(iUiStateMgr->UiStateStandbycn()); 
       
   115     iContext->ForceEditGainFocus(EInputContextFieldGetFocus);   
       
   116     return SendKey(aEventData); 
       
   117     }
       
   118     
       
   119 // -----------------------------------------------------------------------------
       
   120 // CAknFepVkbUiStateCompositionNoChars::HandleEnterSpaceEvent
       
   121 // (other items were commented in a header).
       
   122 // -----------------------------------------------------------------------------
       
   123 //
       
   124 TBool CAknFepVkbUiStateCompositionNoChars::HandleEnterSpaceEvent(TInt /*aEventType*/, 
       
   125                                                                  const TDesC& aEventData)  
       
   126     {           
       
   127     iUiStateMgr->SetCurrentUiState(iUiStateMgr->UiStateStandbycn());
       
   128     iContext->ForceEditGainFocus(EInputContextFieldGetFocus);    
       
   129     return SendKey(aEventData);      
       
   130     }
       
   131     
       
   132 // -----------------------------------------------------------------------------
       
   133 // CAknFepVkbUiStateCompositionNoChars::HandleETabEvent
       
   134 // (other items were commented in a header).
       
   135 // -----------------------------------------------------------------------------
       
   136 //
       
   137 TBool CAknFepVkbUiStateCompositionNoChars::HandleTabEvent(TInt /*aEventType*/, 
       
   138                                                           const TDesC& aEventData)  
       
   139     {           
       
   140     iUiStateMgr->SetCurrentUiState(iUiStateMgr->UiStateStandbycn());
       
   141     iContext->ForceEditGainFocus(EInputContextFieldGetFocus);    
       
   142     return SendKey(aEventData);      
       
   143     }
       
   144     
       
   145 // -----------------------------------------------------------------------------
       
   146 // CAknFepVkbUiStateCompositionNoChars::HandleArrowKeyEvent
       
   147 // (other items were commented in a header).
       
   148 // -----------------------------------------------------------------------------
       
   149 //
       
   150 TBool CAknFepVkbUiStateCompositionNoChars::HandleArrowKeyEvent(TInt /*aEventType*/, 
       
   151                                                                const TDesC& aEventData)
       
   152     {
       
   153     return ETrue;
       
   154     }       
       
   155 // End Of File