|
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" |
|
21 |
|
22 //------------------------------------------------------------------------------ |
|
23 CAfApplicationsEngine* CAfApplicationsEngine::NewL(RApaLsSession& serviceProvider, |
|
24 CAfStorage& storage) |
|
25 { |
|
26 CAfApplicationsEngine *self = new(ELeave)CAfApplicationsEngine(); |
|
27 CleanupStack::PushL(self); |
|
28 self->ConstructL(storage, serviceProvider); |
|
29 CleanupStack::Pop(self); |
|
30 return self; |
|
31 } |
|
32 |
|
33 //------------------------------------------------------------------------------ |
|
34 CAfApplicationsEngine::CAfApplicationsEngine() |
|
35 {} |
|
36 |
|
37 //------------------------------------------------------------------------------ |
|
38 void CAfApplicationsEngine::ConstructL(CAfStorage& storage, |
|
39 RApaLsSession& serviceProvider) |
|
40 { |
|
41 mCollection = CAfApplicationsCollection::NewL(serviceProvider); |
|
42 mMonitor = CAfApplicationsMonitor::NewL(serviceProvider, *mCollection); |
|
43 mStorage = CAfApplicationsStorage::NewL(storage, *mCollection); |
|
44 |
|
45 mCollection->setObserver(*mStorage); |
|
46 } |
|
47 |
|
48 //------------------------------------------------------------------------------ |
|
49 CAfApplicationsEngine::~CAfApplicationsEngine() |
|
50 { |
|
51 delete mMonitor; |
|
52 delete mStorage; |
|
53 delete mCollection; |
|
54 } |