phoneapp/phoneui2/tsrc/ut_phoneuikeyeventadapter/cphoneuicontroller_stub.cpp
changeset 21 92ab7f8d0eab
child 22 6bb1b21d2484
equal deleted inserted replaced
4:c84cf270c54f 21:92ab7f8d0eab
       
     1 /*
       
     2 * Copyright (c) 2009 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 CPhoneUIController class.
       
    15 *
       
    16 */
       
    17 
       
    18 // INCLUDE FILES
       
    19 
       
    20 #include "CPhoneUIController_Stub.h"
       
    21 
       
    22 int m_scan_code;
       
    23 int m_code;
       
    24 int m_scan_code_down;
       
    25 int m_code_down;
       
    26 int m_repeats;
       
    27 bool m_leave;
       
    28 
       
    29 
       
    30 // ================= MEMBER FUNCTIONS =======================
       
    31 
       
    32 // -----------------------------------------------------------
       
    33 // CPhoneUIController::CPhoneUIController
       
    34 // C++ default constructor can NOT contain any code, that
       
    35 // might leave.
       
    36 // -----------------------------------------------------------
       
    37 //
       
    38 CPhoneUIController_Stub::CPhoneUIController_Stub()  
       
    39     {
       
    40     m_leave = false;	
       
    41     }
       
    42 
       
    43 
       
    44 
       
    45 // -----------------------------------------------------------
       
    46 // Destructor
       
    47 // 
       
    48 // -----------------------------------------------------------
       
    49 
       
    50 CPhoneUIController_Stub::~CPhoneUIController_Stub()
       
    51     {
       
    52 
       
    53     }
       
    54 
       
    55 
       
    56 
       
    57 // ---------------------------------------------------------
       
    58 // CPhoneUIController_Stub::HandleKeyEventL
       
    59 // ---------------------------------------------------------
       
    60 //
       
    61 TKeyResponse CPhoneUIController_Stub::HandleKeyEventL(
       
    62     const TKeyEvent& aKeyEvent,
       
    63     TEventCode aEventCode )
       
    64     {
       
    65     m_scan_code = 0;
       
    66     m_code = 0;
       
    67     m_scan_code_down = 0;
       
    68     m_code_down = 0;
       
    69     
       
    70     if (m_leave)
       
    71         {
       
    72         User::Leave(KErrArgument);
       
    73         }
       
    74         
       
    75     m_repeats = aKeyEvent.iRepeats;
       
    76     
       
    77     if ( EEventKeyUp == aEventCode )
       
    78         {
       
    79         m_scan_code = aKeyEvent.iScanCode;
       
    80         m_code = aKeyEvent.iCode;
       
    81         }
       
    82     else if ( EEventKey == aEventCode )
       
    83         {
       
    84         m_scan_code_down = aKeyEvent.iScanCode;
       
    85         m_code_down = aKeyEvent.iCode;       	
       
    86         }
       
    87     
       
    88     return EKeyWasNotConsumed;
       
    89     }
       
    90 
       
    91 
       
    92 
       
    93 //  End of File