taskswitcher/contextengine/hgfswserver/engine/src/hgfsalwaysshownapplist.cpp
changeset 4 4d54b72983ae
parent 3 fb3763350a08
child 5 c743ef5928ba
equal deleted inserted replaced
3:fb3763350a08 4:4d54b72983ae
     1 /*
       
     2  * ============================================================================
       
     3  *  Name        : hgfsalwaysshownapplist.cpp
       
     4  *  Part of     : Hg Teleport
       
     5  *  Description : File containing application list classes
       
     6  *  Version     : %version: 4 %
       
     7  *
       
     8  *  Copyright 2008 Nokia.  All rights reserved.
       
     9  *  This material, including documentation and any related computer
       
    10  *  programs, is protected by copyright controlled by Nokia.  All
       
    11  *  rights are reserved.  Copying, including reproducing, storing,
       
    12  *  adapting or translating, any or all of this material requires the
       
    13  *  prior written consent of Nokia.  This material also contains
       
    14  *  confidential information which may not be disclosed to others
       
    15  *  without the prior written consent of Nokia.
       
    16  * ============================================================================
       
    17  */
       
    18 
       
    19 //INCLUDES:
       
    20 #include <apaid.h>
       
    21 #include "hgfsalwaysshownapplist.h"
       
    22 
       
    23 //CONSTANTS:
       
    24 /* Array for all application uid that need to be always displayed (if they are running).
       
    25    Also, there will be no Close option for such apps. */
       
    26 const TUint32 KHgFsUidArray[] =
       
    27     {
       
    28     0x102750F0 // Idle App Uid
       
    29     ,0x0EFC346A //Search App Uid
       
    30 /* never show menu app */    //,0x101F4CD2 // Menu App Uid
       
    31     };
       
    32 
       
    33 // ================= MEMBER FUNCTIONS =======================
       
    34 
       
    35 // --------------------------------------------------------------------------
       
    36 // CHgFsAlwaysShownAppList::NewL
       
    37 // --------------------------------------------------------------------------
       
    38 //
       
    39 CHgFsAlwaysShownAppList* CHgFsAlwaysShownAppList::NewL()
       
    40     {
       
    41     CHgFsAlwaysShownAppList* self =
       
    42         new (ELeave) CHgFsAlwaysShownAppList;
       
    43     CleanupStack::PushL (self );
       
    44     self->ConstructL ( );
       
    45     CleanupStack::Pop ( self );
       
    46     return self;
       
    47     }
       
    48 
       
    49 // --------------------------------------------------------------------------
       
    50 // CHgFsAlwaysShownAppList::CHgFsAlwaysShownAppList
       
    51 // --------------------------------------------------------------------------
       
    52 //
       
    53 CHgFsAlwaysShownAppList::CHgFsAlwaysShownAppList()
       
    54     {
       
    55     }
       
    56 
       
    57 // --------------------------------------------------------------------------
       
    58 // CHgFsAlwaysShownAppList::~CHgFsAlwaysShownAppList
       
    59 // --------------------------------------------------------------------------
       
    60 //
       
    61 CHgFsAlwaysShownAppList::~CHgFsAlwaysShownAppList( )
       
    62     {
       
    63     iAppList.Close();
       
    64     iAppArcSession.Close();
       
    65     }
       
    66 
       
    67 // --------------------------------------------------------------------------
       
    68 // CHgFsAlwaysShownAppList::ConstructL
       
    69 // --------------------------------------------------------------------------
       
    70 //
       
    71 void CHgFsAlwaysShownAppList::ConstructL( )
       
    72     {
       
    73     User::LeaveIfError( iAppArcSession.Connect() );
       
    74     }
       
    75 
       
    76 // --------------------------------------------------------------------------
       
    77 // CHgFsAlwaysShownAppList::InitializeAlwaysShownListL
       
    78 // Applications that are always shown in fast swap are stored
       
    79 // in different their own list whether they exist
       
    80 // in the phone rom or not
       
    81 // --------------------------------------------------------------------------
       
    82 //
       
    83 void CHgFsAlwaysShownAppList::InitializeAlwaysShownListL( )
       
    84     {
       
    85     iAppList.Reset();
       
    86     // order of always shown applications
       
    87     TApaAppInfo applicationInfo;
       
    88     for (TInt index = 0,
       
    89             sizeOfArray = ( sizeof(KHgFsUidArray) / sizeof( TUint32 ) );
       
    90             index < sizeOfArray; index++ )
       
    91         {
       
    92         // if exists in phone rom
       
    93         if ( iAppArcSession.GetAppInfo( applicationInfo,
       
    94                 TUid::Uid( KHgFsUidArray[index] ) )!= KErrNotFound )
       
    95             {
       
    96             iAppList.AppendL( TUid::Uid( KHgFsUidArray[index] ) );
       
    97             }
       
    98         }
       
    99     }
       
   100 
       
   101 // --------------------------------------------------------------------------
       
   102 // CHgFsAlwaysShownAppList::IsAlwaysShownApp
       
   103 // If application uid exists in the always shown application list
       
   104 // --------------------------------------------------------------------------
       
   105 //
       
   106 TBool CHgFsAlwaysShownAppList::IsAlwaysShownApp( TUid aAppUid )
       
   107     {
       
   108     for ( TInt index = 0, count = iAppList.Count ( ); index < count; index++ )
       
   109         {
       
   110         if ( iAppList[index] == aAppUid )
       
   111             {
       
   112             return ETrue;
       
   113             }
       
   114         }
       
   115     return EFalse;
       
   116     }
       
   117 
       
   118 
       
   119 // end of file