textinput/peninputsplitqwerty/src/peninputsplitqwertyuistatestandby.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 vkb ui standby state
       
    15  *
       
    16  */
       
    17 
       
    18 // System includes
       
    19 #include <peninputcmd.h>
       
    20 #include <aknfeppeninputenums.h>
       
    21 #include <peninputdataprovider.h>
       
    22 #include <peninputlayoutcontext.h>
       
    23 #include <peninputdataconverter.h>
       
    24 #include <peninputlayoutbasecontrol.h>
       
    25 #include <peninputcommonlayoutglobalenum.h>
       
    26 
       
    27 // User includes
       
    28 #include "peninputsplitqwerty.hrh"
       
    29 #include "peninputsplitqwertyuistatestandby.h"
       
    30 #include "peninputsplitqwertyenum.h"
       
    31 
       
    32 // ======== MEMBER FUNCTIONS ========
       
    33 
       
    34 // --------------------------------------------------------------------------
       
    35 // Symbian constructor
       
    36 // --------------------------------------------------------------------------
       
    37 //
       
    38 CPeninputSplitQwertyUiStateStandby* CPeninputSplitQwertyUiStateStandby::NewL(
       
    39                                             MPeninputUiStateMgr* aUiStateMgr, 
       
    40                                             MPeninputLayoutContext* aContext )
       
    41     {
       
    42     CPeninputSplitQwertyUiStateStandby* self = NULL;
       
    43     self = new ( ELeave ) CPeninputSplitQwertyUiStateStandby( aUiStateMgr,
       
    44                                                               aContext );
       
    45     CleanupStack::PushL( self );
       
    46     self->Construct();
       
    47     CleanupStack::Pop( self );
       
    48 
       
    49     return self;
       
    50     }
       
    51 
       
    52 // --------------------------------------------------------------------------
       
    53 // CPeninputUiStateVkbStandby::CPeninputUiStateVkbStandby
       
    54 // (other items were commented in a header)
       
    55 // --------------------------------------------------------------------------
       
    56 //
       
    57 CPeninputSplitQwertyUiStateStandby::CPeninputSplitQwertyUiStateStandby(
       
    58                                             MPeninputUiStateMgr* aUiStateMgr, 
       
    59                                             MPeninputLayoutContext* aContext ) 
       
    60     : CPeninputUiStateBase( aUiStateMgr, aContext )
       
    61     {
       
    62     }
       
    63 
       
    64 // --------------------------------------------------------------------------
       
    65 // C++ destructor
       
    66 // --------------------------------------------------------------------------
       
    67 //
       
    68 CPeninputSplitQwertyUiStateStandby::~CPeninputSplitQwertyUiStateStandby()
       
    69     {
       
    70     }
       
    71 
       
    72 // --------------------------------------------------------------------------
       
    73 // Process key event
       
    74 // --------------------------------------------------------------------------
       
    75 //
       
    76 TBool CPeninputSplitQwertyUiStateStandby::HandleKeyEventL( const TRawEvent& /*aData*/)
       
    77     {
       
    78     return EFalse;
       
    79     }
       
    80 
       
    81 // --------------------------------------------------------------------------
       
    82 // process internal event
       
    83 // --------------------------------------------------------------------------
       
    84 //
       
    85 TBool CPeninputSplitQwertyUiStateStandby::HandleControlEvent( TInt aEventType, 
       
    86                                                      const TDesC& aEventData )
       
    87     {
       
    88     switch ( aEventType )
       
    89         {
       
    90         case EEventVirtualKeyUp:
       
    91             {
       
    92             return HandleVkbEvent( aEventType, aEventData );
       
    93             }
       
    94         case EPeninputLayoutEventBack:
       
    95             {
       
    96             return HandleBackEvent( aEventType, aEventData );
       
    97             }
       
    98         case EPeninputLayoutEventLeftArrow:
       
    99         case EPeninputLayoutEventRightArrow:
       
   100             {
       
   101             SendKey( aEventData );
       
   102             return EFalse;
       
   103             }
       
   104         case EPeninputLayoutEventTab:
       
   105             {
       
   106             return HandleTabEvent( aEventType, aEventData );
       
   107             }
       
   108         case EPeninputLayoutEventEnter:
       
   109         case EPeninputLayoutEventSpace:
       
   110             {
       
   111             return HandleEnterSpaceEvent( aEventType, aEventData );
       
   112             }
       
   113         default:
       
   114             return EFalse;
       
   115         }
       
   116     }
       
   117 
       
   118 // --------------------------------------------------------------------------
       
   119 // Process virtual key event
       
   120 // --------------------------------------------------------------------------
       
   121 //
       
   122 TBool CPeninputSplitQwertyUiStateStandby::HandleVkbEvent(TInt /*aEventType*/, 
       
   123                                                      const TDesC& aEventData )
       
   124     {
       
   125     return SendKey( aEventData );
       
   126     }
       
   127 
       
   128 // --------------------------------------------------------------------------
       
   129 // Process backspace key event
       
   130 // --------------------------------------------------------------------------
       
   131 //
       
   132 TBool CPeninputSplitQwertyUiStateStandby::HandleBackEvent( TInt /*aEventType*/, 
       
   133                                                       const TDesC& aEventData )
       
   134     {
       
   135     TInt latchedFlag = CPeninputDataConverter::AnyToInt(
       
   136             iContext->RequestData( EAkninputDataTypeLatchedSet ) );
       
   137     if ( !latchedFlag )
       
   138         {
       
   139         SendKey( aEventData );
       
   140         }
       
   141     return EFalse;
       
   142     }
       
   143 
       
   144 // --------------------------------------------------------------------------
       
   145 // Process enter, space key event
       
   146 // --------------------------------------------------------------------------
       
   147 //
       
   148 TBool CPeninputSplitQwertyUiStateStandby::HandleEnterSpaceEvent( TInt /*aEventType*/,
       
   149                                                       const TDesC& aEventData )
       
   150     {
       
   151     TInt latchedFlag = CPeninputDataConverter::AnyToInt(
       
   152             iContext->RequestData( EAkninputDataTypeLatchedSet ) );
       
   153     
       
   154     if ( !latchedFlag )
       
   155         {
       
   156         SendKey( aEventData );
       
   157         }
       
   158 
       
   159     return EFalse;
       
   160     }
       
   161 
       
   162 // --------------------------------------------------------------------------
       
   163 // Process tab key event
       
   164 // --------------------------------------------------------------------------
       
   165 //
       
   166 TBool CPeninputSplitQwertyUiStateStandby::HandleTabEvent( TInt /*aEventType*/, 
       
   167                                                       const TDesC& aEventData )
       
   168     {
       
   169     SendKey( aEventData );
       
   170     return EFalse;
       
   171     }
       
   172