107
|
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 "afapplicationsengine.h"
|
|
18 |
#include "afapplicationsstorage.h"
|
|
19 |
#include "afapplicationscollection.h"
|
|
20 |
#include "afapplicationsmonitor.h"
|
119
|
21 |
#include "aftaskstorage.h"
|
|
22 |
#include "aftask.h"
|
107
|
23 |
|
|
24 |
//------------------------------------------------------------------------------
|
|
25 |
CAfApplicationsEngine* CAfApplicationsEngine::NewL(RApaLsSession& serviceProvider,
|
119
|
26 |
CAfStorage& storage,
|
|
27 |
MAfTaskStorage& taskStorage)
|
107
|
28 |
{
|
119
|
29 |
CAfApplicationsEngine *self = new(ELeave)CAfApplicationsEngine(taskStorage);
|
107
|
30 |
CleanupStack::PushL(self);
|
119
|
31 |
self->ConstructL(serviceProvider, storage);
|
107
|
32 |
CleanupStack::Pop(self);
|
|
33 |
return self;
|
|
34 |
}
|
|
35 |
|
|
36 |
//------------------------------------------------------------------------------
|
119
|
37 |
CAfApplicationsEngine::CAfApplicationsEngine(MAfTaskStorage& taskStorage) :
|
|
38 |
mTaskStorage(taskStorage)
|
|
39 |
{
|
|
40 |
}
|
107
|
41 |
|
|
42 |
//------------------------------------------------------------------------------
|
119
|
43 |
void CAfApplicationsEngine::ConstructL(RApaLsSession& serviceProvider,
|
|
44 |
CAfStorage& storage)
|
107
|
45 |
{
|
|
46 |
mCollection = CAfApplicationsCollection::NewL(serviceProvider);
|
|
47 |
mMonitor = CAfApplicationsMonitor::NewL(serviceProvider, *mCollection);
|
119
|
48 |
mStorage = CAfApplicationsStorage::NewL(storage, *mCollection, *this);
|
107
|
49 |
|
|
50 |
mCollection->setObserver(*mStorage);
|
|
51 |
}
|
|
52 |
|
|
53 |
//------------------------------------------------------------------------------
|
|
54 |
CAfApplicationsEngine::~CAfApplicationsEngine()
|
|
55 |
{
|
|
56 |
delete mMonitor;
|
|
57 |
delete mStorage;
|
|
58 |
delete mCollection;
|
|
59 |
}
|
119
|
60 |
|
|
61 |
//------------------------------------------------------------------------------
|
|
62 |
void CAfApplicationsEngine::applicationsChanged()
|
|
63 |
{
|
|
64 |
const RPointerArray<CAfTask> &table(mTaskStorage.StorageData());
|
|
65 |
for (TInt iter(table.Count() - 1); 0 <= iter; --iter) {
|
|
66 |
table[iter]->BroadcastReceivedL(RMessage2(), ETrue);
|
|
67 |
}
|
|
68 |
}
|