camerauis/cameraapp/generic/common/src/CamWaitDialog.cpp
branchRCL_3
changeset 24 bac7acad7cb3
parent 0 1ddebce53859
equal deleted inserted replaced
23:61bc0f252b2b 24:bac7acad7cb3
       
     1 /*
       
     2 * Copyright (c) 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:  Wait dialog that doesn't consume key events*
       
    15 */
       
    16 
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "CamWaitDialog.h"
       
    21 #include "CamUtility.h"
       
    22 
       
    23 
       
    24 // ============================ MEMBER FUNCTIONS ===============================
       
    25 
       
    26 // ---------------------------------------------------------------------------
       
    27 // CCamWaitDialog::CCamWaitDialog
       
    28 // C++ constructor
       
    29 // ---------------------------------------------------------------------------
       
    30 //
       
    31 CCamWaitDialog::CCamWaitDialog( CEikDialog** aSelfPtr,
       
    32                                 TBool        aVisibilityDelayOff )
       
    33   : CAknWaitDialog( aSelfPtr, aVisibilityDelayOff )
       
    34   {
       
    35   }
       
    36 
       
    37 // ---------------------------------------------------------------------------
       
    38 // CCamWaitDialog::~CCamWaitDialog
       
    39 // C++ destructor
       
    40 // ---------------------------------------------------------------------------
       
    41 //
       
    42 CCamWaitDialog::~CCamWaitDialog()
       
    43   {
       
    44   iNonConsumedKeys.Close();
       
    45   }
       
    46 
       
    47 // ---------------------------------------------------------------------------
       
    48 // CCamWaitDialog::OfferKeyEventL
       
    49 // Key event handling
       
    50 // ---------------------------------------------------------------------------
       
    51 //
       
    52 TKeyResponse 
       
    53 CCamWaitDialog::OfferKeyEventL( const TKeyEvent& aKeyEvent,
       
    54                                       TEventCode aType     )
       
    55   {
       
    56   PRINT( _L("Camera => CCamWaitDialog::OfferKeyEventL") );
       
    57   if ( KErrNotFound != iNonConsumedKeys.Find( aKeyEvent.iScanCode ) )
       
    58     {
       
    59     PRINT( _L("Camera <= CCamWaitDialog::OfferKeyEventL not consumed") );
       
    60 	  return EKeyWasNotConsumed;	
       
    61 	  }
       
    62   else
       
    63     {
       
    64     PRINT( _L("Camera <= CCamWaitDialog::OfferKeyEventL offer to CAknWaitDialog") );
       
    65     return CAknWaitDialog::OfferKeyEventL( aKeyEvent, aType );
       
    66     }
       
    67   }
       
    68 
       
    69 
       
    70 // ---------------------------------------------------------------------------
       
    71 // CCamWaitDialog::SetNonConsumedKeysL
       
    72 // 
       
    73 // ---------------------------------------------------------------------------
       
    74 //
       
    75 void 
       
    76 CCamWaitDialog::SetNonConsumedKeysL( const RArray<TInt>& aNonConsumedKeys )
       
    77   {
       
    78   TInt n = aNonConsumedKeys.Count();
       
    79   
       
    80   iNonConsumedKeys.Reset();
       
    81   for( TInt i = 0; i < n; i++ )
       
    82     {
       
    83     User::LeaveIfError( iNonConsumedKeys.Append( aNonConsumedKeys[i] ) ); 
       
    84     }    
       
    85   }
       
    86