85
|
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: ?Description
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include "cainstallnotifier.h"
|
119
|
19 |
#include "cadef.h"
|
|
20 |
|
|
21 |
using namespace Usif;
|
85
|
22 |
|
|
23 |
EXPORT_C CCaInstallNotifier* CCaInstallNotifier::NewL(
|
|
24 |
MCaInstallListener& aListener, TNotificationType aNotificationType )
|
|
25 |
{
|
92
|
26 |
CCaInstallNotifier* self = new ( ELeave ) CCaInstallNotifier( aListener );
|
85
|
27 |
CleanupStack::PushL( self );
|
92
|
28 |
self->ConstructL( aNotificationType );
|
85
|
29 |
CleanupStack::Pop( self );
|
|
30 |
return self;
|
|
31 |
}
|
|
32 |
|
|
33 |
CCaInstallNotifier::~CCaInstallNotifier()
|
|
34 |
{
|
119
|
35 |
delete iNotifier;
|
85
|
36 |
}
|
|
37 |
|
92
|
38 |
CCaInstallNotifier::CCaInstallNotifier( MCaInstallListener& aListener ) :
|
119
|
39 |
iListener( aListener )
|
|
40 |
{
|
|
41 |
}
|
85
|
42 |
|
92
|
43 |
void CCaInstallNotifier::ConstructL( TNotificationType aNotificationType )
|
119
|
44 |
{
|
|
45 |
iNotifier = CSifOperationsNotifier::NewL( *this );
|
|
46 |
iNotificationType = aNotificationType;
|
|
47 |
}
|
|
48 |
|
127
|
49 |
void CCaInstallNotifier::EndOperationHandler(
|
|
50 |
const CSifOperationEndData& aEndData )
|
119
|
51 |
{
|
|
52 |
TRAP_IGNORE
|
|
53 |
(
|
|
54 |
if( aEndData.ErrorCode() == KErrNone )
|
|
55 |
{
|
|
56 |
iListener.HandleInstallNotifyL();
|
|
57 |
}
|
|
58 |
iNotifier->CancelSubscribeL( iKey );
|
|
59 |
)
|
|
60 |
}
|
85
|
61 |
|
119
|
62 |
void CCaInstallNotifier::ProgressOperationHandler(
|
127
|
63 |
const CSifOperationProgressData& /*aProgressData*/ )
|
119
|
64 |
{
|
|
65 |
}
|
85
|
66 |
|
119
|
67 |
void CCaInstallNotifier::StartOperationHandler(
|
127
|
68 |
TUint aKey, const CSifOperationStartData& aStartData )
|
119
|
69 |
{
|
|
70 |
TRAP_IGNORE
|
|
71 |
(
|
|
72 |
if( iNotificationType == EAllTypesNotification )
|
|
73 |
{
|
|
74 |
iKey = aKey;
|
|
75 |
iNotifier->SubscribeL( aKey, ETrue );
|
|
76 |
}
|
|
77 |
else if ( iNotificationType == ESisInstallNotification
|
|
78 |
&& aStartData.SoftwareType().Compare(
|
|
79 |
KCaAttrAppTypeValueNative ) == KErrNone )
|
|
80 |
{
|
|
81 |
iKey = aKey;
|
|
82 |
iNotifier->SubscribeL( aKey, ETrue );
|
|
83 |
}
|
|
84 |
)
|
|
85 |
}
|