textinput/peninputgenerichwr/src/peninputhwrarabicstatebeginwriting.cpp
changeset 0 eb1f2e154e89
equal deleted inserted replaced
-1:000000000000 0:eb1f2e154e89
       
     1 /*
       
     2 * Copyright (c) 2002-2007 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 hwr ui state machine (Pen Beginwriting State)
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // System includes
       
    20 #include <peninputuistatemgr.h>
       
    21 #include <peninputcommonlayoutglobalenum.h>
       
    22 // user includes
       
    23 //#include "peninputhwrevent.h"
       
    24 #include "peninputhwrarabic.hrh"
       
    25 #include "peninputhwrarabiclayout.h"
       
    26 #include "peninputhwrarabicdatamgr.h"       // use data mgr
       
    27 #include "peninputhwrarabicwindow.h"        // use hwr window, which derived from base window
       
    28 #include "peninputhwrarabicstatebeginwriting.h"
       
    29 
       
    30 // ======== MEMBER FUNCTIONS ========
       
    31 
       
    32 // Implementation of Class CPeninputHwrBxAbStateBeginWriting
       
    33 
       
    34 // -----------------------------------------------------------------------------
       
    35 // CPeninputHwrBxAbStateBeginWriting::NewL
       
    36 // (other items were commented in a header).
       
    37 // -----------------------------------------------------------------------------
       
    38 //
       
    39 CPeninputHwrBxAbStateBeginWriting* CPeninputHwrBxAbStateBeginWriting::NewL(MPeninputUiStateMgr* aUiStateMgr,
       
    40                                                          MPeninputLayoutContext* aContext)
       
    41     {
       
    42     CPeninputHwrBxAbStateBeginWriting* self = new ( ELeave ) CPeninputHwrBxAbStateBeginWriting(aUiStateMgr,aContext);
       
    43     CleanupStack::PushL(self);
       
    44     self->Construct();
       
    45     CleanupStack::Pop(self);
       
    46     return self;
       
    47     }
       
    48 
       
    49 // -----------------------------------------------------------------------------
       
    50 // CPeninputHwrBxAbStateBeginWriting::~CPeninputHwrBxAbStateBeginWriting
       
    51 // (other items were commented in a header).
       
    52 // -----------------------------------------------------------------------------
       
    53 //
       
    54 CPeninputHwrBxAbStateBeginWriting::~CPeninputHwrBxAbStateBeginWriting()
       
    55     {
       
    56     }
       
    57 
       
    58 // ---------------------------------------------------------------------------
       
    59 // CPeninputHwrBxAbStateBeginWriting::HandleControlEventPenL
       
    60 // (other items were commented in a header).
       
    61 // ---------------------------------------------------------------------------
       
    62 //
       
    63 void CPeninputHwrBxAbStateBeginWriting::HandleControlEventPenL( TInt aEventType, 
       
    64     const TDesC& /*aEventData*/, CPeninputHwrBxAbLayout& aUiLayout, TDes& aCharCode, TBool& aHandled )
       
    65     {
       
    66     aHandled = EFalse;
       
    67     switch (aEventType)
       
    68         {
       
    69         case EEventHwrStrokeFinished:
       
    70             {
       
    71             aUiLayout.UiStateMgr()->SetCurrentUiState(EPeninputHwrBxAbStateEndWriting);
       
    72             static_cast<CPeninputHwrBxAbWnd*>(aUiLayout.LayoutWindow())->OnStrokeFinished();
       
    73             aHandled = ETrue;
       
    74             }
       
    75             break;
       
    76         case EEventHwrStrokeCanceled:
       
    77             {
       
    78             aUiLayout.UiStateMgr()->SetCurrentUiState(EPeninputHwrBxAbStateStandby);
       
    79             static_cast<CPeninputHwrBxAbWnd*>(aUiLayout.LayoutWindow())->OnStrokeCanceled();
       
    80             aHandled = ETrue;
       
    81             }
       
    82             break;
       
    83         case EPeninputLayoutEventBack:
       
    84             {
       
    85             aUiLayout.UiStateMgr()->SetCurrentUiState(EPeninputHwrBxAbStateStandby);
       
    86             static_cast<CPeninputHwrBxAbWnd*>(aUiLayout.LayoutWindow())->HandleBackspaceKeyEvent();
       
    87             aHandled = ETrue;
       
    88             }
       
    89             break;
       
    90         default:
       
    91             aHandled = EFalse;
       
    92             break;
       
    93         }
       
    94     }
       
    95 
       
    96 // -----------------------------------------------------------------------------
       
    97 // CPeninputHwrBxAbStateBeginWriting::CPeninputHwrBxAbStateBeginWriting
       
    98 // (other items were commented in a header).
       
    99 // -----------------------------------------------------------------------------
       
   100 //
       
   101 CPeninputHwrBxAbStateBeginWriting::CPeninputHwrBxAbStateBeginWriting(MPeninputUiStateMgr* aUiStateMgr,
       
   102                                                    MPeninputLayoutContext* aContext)
       
   103     :CPeninputHwrBxAbStateBase(aUiStateMgr,aContext)
       
   104     {
       
   105     }
       
   106 
       
   107 // End Of File