author | hgs |
Mon, 23 Aug 2010 13:33:21 +0300 | |
changeset 48 | 1389872e7c51 |
parent 43 | c5e73110f733 |
permissions | -rw-r--r-- |
0
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
14 |
* Description: Harvester client active object |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
15 |
* |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
|
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
|
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
19 |
#include "harvesterclientao.h" |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
20 |
#include "harvestercommon.h" |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
21 |
#include "harvesterlog.h" |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
22 |
#include "mdsutils.h" |
36
aa5a574040a4
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
23 |
#include "OstTraceDefinitions.h" |
aa5a574040a4
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
24 |
#ifdef OST_TRACE_COMPILER_IN_USE |
aa5a574040a4
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
25 |
#include "harvesterclientaoTraces.h" |
aa5a574040a4
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
26 |
#endif |
0
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
27 |
|
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
28 |
|
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
29 |
// --------------------------------------------------------------------------- |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
30 |
// NewL |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
31 |
// --------------------------------------------------------------------------- |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
32 |
// |
48 | 33 |
CHarvesterClientAO* CHarvesterClientAO::NewL( RHarvesterClient& aHarvesterClient ) |
0
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
34 |
{ |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
35 |
WRITELOG( "CHarvesterClientAO::NewL()" ); |
36
aa5a574040a4
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
36 |
OstTrace0( TRACE_NORMAL, CHARVESTERCLIENTAO_NEWL, "CHarvesterClientAO::NewL" ); |
aa5a574040a4
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
37 |
|
48 | 38 |
CHarvesterClientAO* self = new (ELeave) CHarvesterClientAO( aHarvesterClient ); |
0
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
39 |
CleanupStack::PushL( self ); |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
40 |
self->ConstructL(); |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
41 |
CleanupStack::Pop( self ); |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
42 |
return self; |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
43 |
} |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
44 |
|
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
45 |
// --------------------------------------------------------------------------- |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
46 |
// ~CHarvesterClientAO |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
47 |
// --------------------------------------------------------------------------- |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
48 |
// |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
49 |
CHarvesterClientAO::~CHarvesterClientAO() // destruct |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
50 |
{ |
36
aa5a574040a4
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
51 |
OstTrace0( TRACE_NORMAL, CHARVESTERCLIENTAO_CHARVESTERCLIENTAO, "CHarvesterClientAO::~CHarvesterClientAO" ); |
aa5a574040a4
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
52 |
|
0
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
53 |
WRITELOG( "CHarvesterClientAO::~CHarvesterClientAO()" ); |
48 | 54 |
CancelRequest(); |
0
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
55 |
} |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
56 |
|
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
57 |
// --------------------------------------------------------------------------- |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
58 |
// CHarvesterClientAO |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
59 |
// First-phase C++ constructor |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
60 |
// --------------------------------------------------------------------------- |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
61 |
// |
48 | 62 |
CHarvesterClientAO::CHarvesterClientAO( RHarvesterClient& aHarvesterClient ) |
63 |
: CActive( CActive::EPriorityUserInput ), |
|
0
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
64 |
iObserver( NULL ), |
43 | 65 |
iHarvesterClient( aHarvesterClient ), |
48 | 66 |
iCancelled( EFalse ) |
0
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
67 |
{ |
36
aa5a574040a4
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
68 |
OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERCLIENTAO_CHARVESTERCLIENTAO, "CHarvesterClientAO::CHarvesterClientAO" ); |
aa5a574040a4
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
69 |
|
0
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
70 |
WRITELOG( "CHarvesterClientAO::CHarvesterClientAO()" ); |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
71 |
} |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
72 |
|
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
73 |
// --------------------------------------------------------------------------- |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
74 |
// ConstructL |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
75 |
// --------------------------------------------------------------------------- |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
76 |
// |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
77 |
void CHarvesterClientAO::ConstructL() // second-phase constructor |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
78 |
{ |
36
aa5a574040a4
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
79 |
WRITELOG( "CHarvesterClientAO::ConstructL()" ); |
aa5a574040a4
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
80 |
OstTrace0( TRACE_NORMAL, CHARVESTERCLIENTAO_CONSTRUCTL, "CHarvesterClientAO::ConstructL" ); |
aa5a574040a4
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
81 |
|
0
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
82 |
CActiveScheduler::Add( this ); |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
83 |
} |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
84 |
|
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
85 |
// --------------------------------------------------------------------------- |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
86 |
// SetObserver |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
87 |
// --------------------------------------------------------------------------- |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
88 |
// |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
89 |
void CHarvesterClientAO::SetObserver( MHarvestObserver* aObserver ) |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
90 |
{ |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
91 |
WRITELOG( "CHarvesterClientAO::SetObserver()" ); |
36
aa5a574040a4
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
92 |
OstTrace0( TRACE_NORMAL, CHARVESTERCLIENTAO_SETOBSERVER, "CHarvesterClientAO::SetObserver" ); |
aa5a574040a4
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
93 |
|
0
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
94 |
iObserver = aObserver; |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
95 |
} |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
96 |
|
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
97 |
// --------------------------------------------------------------------------- |
48 | 98 |
// RemoveObserver |
99 |
// --------------------------------------------------------------------------- |
|
100 |
// |
|
101 |
void CHarvesterClientAO::RemoveObserver( MHarvestObserver* /*aObserver*/ ) |
|
102 |
{ |
|
103 |
WRITELOG( "CHarvesterClientAO::RemoveObserver()" ); |
|
104 |
OstTrace0( TRACE_NORMAL, CHARVESTERCLIENTAO_REMOVEOBSERVER, "CHarvesterClientAO::RemoveObserver" ); |
|
105 |
if ( iObserver ) |
|
106 |
{ |
|
107 |
WRITELOG( "CHarvesterClientAO::RemoveObserver() - deleting observer" ); |
|
108 |
iObserver = NULL; |
|
109 |
} |
|
110 |
||
111 |
CancelRequest(); |
|
112 |
} |
|
113 |
||
114 |
// --------------------------------------------------------------------------- |
|
0
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
115 |
// DoCancel |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
116 |
// --------------------------------------------------------------------------- |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
117 |
// |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
118 |
void CHarvesterClientAO::DoCancel() |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
119 |
{ |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
120 |
WRITELOG( "CHarvesterClientAO::DoCancel()" ); |
36
aa5a574040a4
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
121 |
OstTrace0( TRACE_NORMAL, CHARVESTERCLIENTAO_DOCANCEL, "CHarvesterClientAO::DoCancel" ); |
48 | 122 |
iHarvesterClient.UnregisterHarvestComplete(); |
123 |
WRITELOG( "CHarvesterClientAO::DoCancel() - end" ); |
|
0
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
124 |
} |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
125 |
|
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
126 |
// --------------------------------------------------------------------------- |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
127 |
// Active |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
128 |
// --------------------------------------------------------------------------- |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
129 |
// |
48 | 130 |
void CHarvesterClientAO::Active() |
0
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
131 |
{ |
48 | 132 |
WRITELOG( "CHarvesterClientAO::Active" ); |
133 |
if ( iObserver && !IsActive()) |
|
134 |
{ |
|
135 |
WRITELOG( "CHarvesterClientAO::Active - calling RegisterHarvestComplete" ); |
|
136 |
iHarvesterClient.RegisterHarvestComplete(iURI, iStatus); |
|
137 |
iCancelled = EFalse; |
|
138 |
SetActive(); |
|
139 |
} |
|
0
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
140 |
} |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
141 |
|
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
142 |
// --------------------------------------------------------------------------- |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
143 |
// RunL |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
144 |
// --------------------------------------------------------------------------- |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
145 |
// |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
146 |
void CHarvesterClientAO::RunL() |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
147 |
{ |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
148 |
WRITELOG( "CHarvesterClientAO::RunL()" ); |
36
aa5a574040a4
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
149 |
OstTrace0( TRACE_NORMAL, CHARVESTERCLIENTAO_RUNL, "CHarvesterClientAO::RunL" ); |
43 | 150 |
|
0
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
151 |
const TInt status = iStatus.Int(); |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
152 |
|
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
153 |
if ( status < KErrNone ) |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
154 |
{ |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
155 |
WRITELOG1( "CHarvesterClientAO::RunL() - Error occured while harvesting, error:%d", status ); |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
156 |
} |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
157 |
|
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
158 |
// Callback to client process |
48 | 159 |
if ( iObserver ) |
0
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
160 |
{ |
48 | 161 |
WRITELOG( "CHarvesterClientAO::RunL() - ECompleteRequest - calling callback" ); |
162 |
iObserver->HarvestingComplete( iURI, status ); |
|
0
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
163 |
} |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
164 |
|
48 | 165 |
// if the request was not canceled or server is not terminated, Activating AO again |
166 |
if ( status != KErrCancel && status != KErrServerTerminated && iObserver && !iCancelled ) |
|
167 |
{ |
|
168 |
WRITELOG( "CHarvesterClientAO::RunL() - not cancelled or terminated, calling Active" ); |
|
169 |
Active(); |
|
170 |
} |
|
171 |
WRITELOG( "CHarvesterClientAO::RunL() - end" ); |
|
0
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
172 |
} |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
173 |
|
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
174 |
// --------------------------------------------------------------------------- |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
175 |
// RunError |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
176 |
// --------------------------------------------------------------------------- |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
177 |
// |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
178 |
#ifdef _DEBUG |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
179 |
TInt CHarvesterClientAO::RunError( TInt aError ) |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
180 |
#else |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
181 |
TInt CHarvesterClientAO::RunError( TInt ) |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
182 |
#endif |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
183 |
{ |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
184 |
WRITELOG1( "CHarvesterClientAO::RunError(), errorcode: %d", aError ); |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
185 |
|
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
186 |
return KErrNone; |
c53acadfccc6
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
187 |
} |
43 | 188 |
|
189 |
// --------------------------------------------------------------------------- |
|
48 | 190 |
// Active |
43 | 191 |
// --------------------------------------------------------------------------- |
48 | 192 |
// |
193 |
void CHarvesterClientAO::CancelRequest() |
|
194 |
{ |
|
195 |
WRITELOG( "CHarvesterClientAO::CancelRequest" ); |
|
196 |
if( !iCancelled ) |
|
197 |
{ |
|
198 |
WRITELOG( "CHarvesterClientAO::CancelRequest - not cancelled, calling Cancel" ); |
|
199 |
iCancelled = ETrue; |
|
200 |
Cancel(); |
|
201 |
} |
|
202 |
if( !IsActive() ) |
|
203 |
{ |
|
204 |
WRITELOG( "CHarvesterClientAO::CancelRequest - setting priority to High" ); |
|
205 |
SetPriority( CActive::EPriorityHigh ); |
|
206 |
} |
|
43 | 207 |
} |
208 |