sipplugins/sippsipsettingsui/src/SIPSettListSIPSrvTakeOverCBAKeyPress.cpp
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2003 - 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:  Catches right soft key press
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 
       
    21 #include "SIPSettListSIPSrvTakeOverCBAKeyPress.h"
       
    22 #include <coedef.h>
       
    23 #include <eikenv.h>
       
    24 #include <coeaui.h>
       
    25 #include "gssippluginlogger.h"
       
    26 
       
    27 // -----------------------------------------------------------------------------
       
    28 // CSIPSettListSIPSrvTakeOverCBAKeyPress::NewL
       
    29 // Two-phased constructor.
       
    30 // -----------------------------------------------------------------------------
       
    31 // 
       
    32 CSIPSettListSIPSrvTakeOverCBAKeyPress* 
       
    33 		CSIPSettListSIPSrvTakeOverCBAKeyPress::NewL()
       
    34     {
       
    35     __GSLOGSTRING("CSIPSettListSIPSrvTakeOverCBAKeyPress::NewL" )
       
    36     CSIPSettListSIPSrvTakeOverCBAKeyPress* self =
       
    37         CSIPSettListSIPSrvTakeOverCBAKeyPress::NewLC();
       
    38 	CleanupStack::Pop( self );
       
    39     return self;
       
    40     } 
       
    41 
       
    42 // -----------------------------------------------------------------------------
       
    43 // CSIPSettListSIPSrvTakeOverCBAKeyPress::NewL
       
    44 // Two-phased constructor.
       
    45 // -----------------------------------------------------------------------------
       
    46 //
       
    47 CSIPSettListSIPSrvTakeOverCBAKeyPress* 
       
    48 		CSIPSettListSIPSrvTakeOverCBAKeyPress::NewLC()
       
    49     {
       
    50     __GSLOGSTRING("CSIPSettListSIPSrvTakeOverCBAKeyPress::NewLC" )
       
    51     CSIPSettListSIPSrvTakeOverCBAKeyPress* self =
       
    52         new ( ELeave ) CSIPSettListSIPSrvTakeOverCBAKeyPress();
       
    53     
       
    54     CleanupStack::PushL( self );
       
    55     self->ConstructL();
       
    56     return self;
       
    57     }
       
    58     
       
    59 // ----------------------------------------------------------------------------
       
    60 // CSIPSettListSIPSrvTakeOverCBAKeyPress::CSIPSettListSIPSrvTakeOverCBAKeyPress
       
    61 // C++ default constructor can NOT contain any code, that
       
    62 // might leave.
       
    63 // ----------------------------------------------------------------------------
       
    64 //
       
    65 CSIPSettListSIPSrvTakeOverCBAKeyPress::CSIPSettListSIPSrvTakeOverCBAKeyPress()
       
    66 	: iBackCalled(EFalse)
       
    67 	{
       
    68     __GSLOGSTRING("CSIPSettListSIPSrvTakeOverCBAKeyPress::CSIPSettListSIPSrvTakeOverCBAKeyPress" )
       
    69 	}
       
    70 
       
    71 // -----------------------------------------------------------------------------
       
    72 // CSIPSettListSIPSrvTakeOverCBAKeyPress::ConstructL
       
    73 // Symbian 2nd phase constructor can leave.
       
    74 // -----------------------------------------------------------------------------
       
    75 //
       
    76 void CSIPSettListSIPSrvTakeOverCBAKeyPress::ConstructL()
       
    77 	{
       
    78     __GSLOGSTRING("CSIPSettListSIPSrvTakeOverCBAKeyPress::ConstructL" )
       
    79     CCoeEnv::Static()->AppUi()->AddToStackL( this, ECoeStackPriorityCba, 
       
    80     										 ECoeStackFlagRefusesFocus );	
       
    81 	this->SetFocusing( EFalse );
       
    82 	}
       
    83 
       
    84 // Destructor
       
    85 CSIPSettListSIPSrvTakeOverCBAKeyPress::~CSIPSettListSIPSrvTakeOverCBAKeyPress()
       
    86 	{
       
    87     __GSLOGSTRING("CSIPSettListSIPSrvTakeOverCBAKeyPress::~CSIPSettListSIPSrvTakeOverCBAKeyPress" )
       
    88     CCoeEnv::Static()->AppUi()->RemoveFromStack( this );
       
    89 	}
       
    90 
       
    91 // -----------------------------------------------------------------------------
       
    92 // CSIPSettListSIPSrvTakeOverCBAKeyPress::OfferKeyEventL
       
    93 // Handles the key events, pushes them to item list
       
    94 // -----------------------------------------------------------------------------
       
    95 //
       
    96 TKeyResponse CSIPSettListSIPSrvTakeOverCBAKeyPress::OfferKeyEventL
       
    97 			(const TKeyEvent &aKeyEvent, TEventCode aType)
       
    98 	{
       
    99     __GSLOGSTRING("CSIPSettListSIPSrvTakeOverCBAKeyPress::OfferKeyEventL" )
       
   100 	if ( aType == EEventKeyDown && aKeyEvent.iScanCode == EStdKeyDevice1 )
       
   101 		{
       
   102 		iBackCalled = ETrue;
       
   103 		}
       
   104 		 	
       
   105 	return EKeyWasNotConsumed;
       
   106 	}
       
   107 
       
   108 // -----------------------------------------------------------------------------
       
   109 // CSIPSettListSIPSrvTakeOverCBAKeyPress::BackCalledL
       
   110 // Returns true, if right soft key is pressed
       
   111 // -----------------------------------------------------------------------------
       
   112 //	
       
   113 TBool CSIPSettListSIPSrvTakeOverCBAKeyPress::BackCalled()
       
   114 	{
       
   115 	return iBackCalled;
       
   116 	}