taskswitcher/backstepping/src/tsbacksteppingfilter.cpp
changeset 126 efda7c0771b9
parent 125 26079c1bb561
child 127 7b66bc3c6dc9
equal deleted inserted replaced
125:26079c1bb561 126:efda7c0771b9
     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:
       
    15 *
       
    16 */
       
    17 #include "tsbacksteppingfilter.h"
       
    18 #include "tsidlist.h"
       
    19 
       
    20 const TInt KBlockedApps [] = {0x100058b3/* <-- phoneui */,
       
    21                               0x2001843A/* <-- javainstaller */,
       
    22                               0x200267D2/* <-- widgetinstallerapp */};
       
    23 
       
    24 // -----------------------------------------------------------------------------
       
    25 /** 
       
    26  * Symbian two-phase constructor. Allocate and initialize list blocked applications
       
    27  * @return backstepping filtering
       
    28  */
       
    29 CTsBacksteppingFilter* CTsBacksteppingFilter::NewL()
       
    30     {
       
    31     CTsBacksteppingFilter *self = new(ELeave)CTsBacksteppingFilter();
       
    32     CleanupStack::PushL( self );
       
    33     self->ConstructL();
       
    34     CleanupStack::Pop( self );
       
    35     return self;
       
    36     }
       
    37 
       
    38 // -----------------------------------------------------------------------------
       
    39 /** 
       
    40  * Destructor
       
    41  */
       
    42 CTsBacksteppingFilter::~CTsBacksteppingFilter()
       
    43     {
       
    44     delete iBlockedApps;
       
    45     }
       
    46 
       
    47 // -----------------------------------------------------------------------------
       
    48 /** 
       
    49  * Inform if application is blocked for backstepping engine
       
    50  * @param aApplicationUid - tested application UID
       
    51  * @return EFalse if application is not blocked for backstepping engine, other value in other cases
       
    52  */
       
    53 TBool CTsBacksteppingFilter::isBlocked( TUid aApplicationUid ) const
       
    54     {
       
    55     return iBlockedApps->IsPresent( aApplicationUid.iUid );
       
    56     }
       
    57 
       
    58 // -----------------------------------------------------------------------------
       
    59 /** 
       
    60  * Constructor
       
    61  */
       
    62 CTsBacksteppingFilter::CTsBacksteppingFilter()
       
    63     {
       
    64     //No implementation required
       
    65     }
       
    66 
       
    67 // -----------------------------------------------------------------------------
       
    68 /** 
       
    69  * Symbian second-phase constructor. Initilaize blocked applications list
       
    70  */
       
    71 void CTsBacksteppingFilter::ConstructL()
       
    72     {
       
    73     const TInt count( sizeof( KBlockedApps ) / sizeof( TInt ) );
       
    74     iBlockedApps = CTsIdList::NewL();
       
    75     iBlockedApps->AppendL( KBlockedApps, count );
       
    76     }