83
|
1 |
/*
|
|
2 |
* Copyright (c) 2008 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: File containing application list classes
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
//INCLUDES:
|
|
20 |
#include <apaid.h>
|
|
21 |
#include "tsfsalwaysshownapplist.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 KTsFsUidArray[] =
|
|
27 |
{
|
|
28 |
0x0EFC346A //Search App Uid
|
|
29 |
/* never show menu app */ //,0x101F4CD2 // Menu App Uid
|
|
30 |
};
|
|
31 |
|
|
32 |
// ================= MEMBER FUNCTIONS =======================
|
|
33 |
|
|
34 |
// --------------------------------------------------------------------------
|
|
35 |
// CTsFsAlwaysShownAppList::NewL
|
|
36 |
// --------------------------------------------------------------------------
|
|
37 |
//
|
|
38 |
CTsFsAlwaysShownAppList* CTsFsAlwaysShownAppList::NewL()
|
|
39 |
{
|
|
40 |
CTsFsAlwaysShownAppList* self =
|
|
41 |
new (ELeave) CTsFsAlwaysShownAppList;
|
|
42 |
CleanupStack::PushL (self );
|
|
43 |
self->ConstructL ( );
|
|
44 |
CleanupStack::Pop ( self );
|
|
45 |
return self;
|
|
46 |
}
|
|
47 |
|
|
48 |
// --------------------------------------------------------------------------
|
|
49 |
// CTsFsAlwaysShownAppList::CTsFsAlwaysShownAppList
|
|
50 |
// --------------------------------------------------------------------------
|
|
51 |
//
|
|
52 |
CTsFsAlwaysShownAppList::CTsFsAlwaysShownAppList()
|
|
53 |
{
|
|
54 |
}
|
|
55 |
|
|
56 |
// --------------------------------------------------------------------------
|
|
57 |
// CTsFsAlwaysShownAppList::~CTsFsAlwaysShownAppList
|
|
58 |
// --------------------------------------------------------------------------
|
|
59 |
//
|
|
60 |
CTsFsAlwaysShownAppList::~CTsFsAlwaysShownAppList( )
|
|
61 |
{
|
|
62 |
iAppList.Close();
|
|
63 |
iAppArcSession.Close();
|
|
64 |
}
|
|
65 |
|
|
66 |
// --------------------------------------------------------------------------
|
|
67 |
// CTsFsAlwaysShownAppList::ConstructL
|
|
68 |
// --------------------------------------------------------------------------
|
|
69 |
//
|
|
70 |
void CTsFsAlwaysShownAppList::ConstructL( )
|
|
71 |
{
|
|
72 |
User::LeaveIfError( iAppArcSession.Connect() );
|
|
73 |
}
|
|
74 |
|
|
75 |
// --------------------------------------------------------------------------
|
|
76 |
// CTsFsAlwaysShownAppList::InitializeAlwaysShownListL
|
|
77 |
// Applications that are always shown in fast swap are stored
|
|
78 |
// in different their own list whether they exist
|
|
79 |
// in the phone rom or not
|
|
80 |
// --------------------------------------------------------------------------
|
|
81 |
//
|
|
82 |
void CTsFsAlwaysShownAppList::InitializeAlwaysShownListL( )
|
|
83 |
{
|
|
84 |
iAppList.Reset();
|
|
85 |
// order of always shown applications
|
|
86 |
TApaAppInfo applicationInfo;
|
|
87 |
for (TInt index = 0,
|
|
88 |
sizeOfArray = ( sizeof(KTsFsUidArray) / sizeof( TUint32 ) );
|
|
89 |
index < sizeOfArray; index++ )
|
|
90 |
{
|
|
91 |
// if exists in phone rom
|
|
92 |
if ( iAppArcSession.GetAppInfo( applicationInfo,
|
|
93 |
TUid::Uid( KTsFsUidArray[index] ) )!= KErrNotFound )
|
|
94 |
{
|
|
95 |
iAppList.AppendL( TUid::Uid( KTsFsUidArray[index] ) );
|
|
96 |
}
|
|
97 |
}
|
|
98 |
}
|
|
99 |
|
|
100 |
// --------------------------------------------------------------------------
|
|
101 |
// CTsFsAlwaysShownAppList::IsAlwaysShownApp
|
|
102 |
// If application uid exists in the always shown application list
|
|
103 |
// --------------------------------------------------------------------------
|
|
104 |
//
|
|
105 |
TBool CTsFsAlwaysShownAppList::IsAlwaysShownApp( TUid aAppUid )
|
|
106 |
{
|
|
107 |
for ( TInt index = 0, count = iAppList.Count ( ); index < count; index++ )
|
|
108 |
{
|
|
109 |
if ( iAppList[index] == aAppUid )
|
|
110 |
{
|
|
111 |
return ETrue;
|
|
112 |
}
|
|
113 |
}
|
|
114 |
return EFalse;
|
|
115 |
}
|
|
116 |
|
|
117 |
|
|
118 |
// end of file
|