|
1 /* |
|
2 * Copyright (c) 2006 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: Wait operatin |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "cmailwaitoperation.h" |
|
19 |
|
20 |
|
21 // ======== MEMBER FUNCTIONS ======== |
|
22 |
|
23 // --------------------------------------------------------------------------- |
|
24 // CMailWaitOperation() |
|
25 // --------------------------------------------------------------------------- |
|
26 // |
|
27 CMailWaitOperation::CMailWaitOperation( |
|
28 CMsvSession& aMsvSession, TRequestStatus& aObserverRequestStatus ) : |
|
29 CMsvOperation( |
|
30 aMsvSession, |
|
31 CActive::EPriorityStandard, |
|
32 aObserverRequestStatus ) |
|
33 { |
|
34 // Just wait and do nothing. |
|
35 CActiveScheduler::Add( this ); |
|
36 iStatus = KRequestPending; |
|
37 SetActive(); |
|
38 iObserverRequestStatus = KRequestPending; |
|
39 } |
|
40 |
|
41 // --------------------------------------------------------------------------- |
|
42 // NewL |
|
43 // --------------------------------------------------------------------------- |
|
44 // |
|
45 CMailWaitOperation* CMailWaitOperation::NewL( |
|
46 CMsvSession& aMsvSession, |
|
47 TRequestStatus& aObserverRequestStatus) |
|
48 { |
|
49 return new( ELeave) CMailWaitOperation( |
|
50 aMsvSession, |
|
51 aObserverRequestStatus ); |
|
52 } |
|
53 |
|
54 |
|
55 // --------------------------------------------------------------------------- |
|
56 // Destructor |
|
57 // --------------------------------------------------------------------------- |
|
58 // |
|
59 CMailWaitOperation::~CMailWaitOperation() |
|
60 { |
|
61 Cancel(); |
|
62 } |
|
63 |
|
64 |
|
65 // --------------------------------------------------------------------------- |
|
66 // From class CMsvOperation. |
|
67 // --------------------------------------------------------------------------- |
|
68 // |
|
69 const TDesC8& CMailWaitOperation::ProgressL() |
|
70 { |
|
71 // No need to report progress |
|
72 return KNullDesC8(); |
|
73 } |
|
74 |
|
75 |
|
76 // --------------------------------------------------------------------------- |
|
77 // From class CActive. |
|
78 // --------------------------------------------------------------------------- |
|
79 // |
|
80 void CMailWaitOperation::DoCancel() |
|
81 { |
|
82 // Stop waiting. No need to report cancelation |
|
83 TRequestStatus* ownstatus = &iStatus; |
|
84 User::RequestComplete( ownstatus, KErrCancel ); |
|
85 |
|
86 TRequestStatus* status = &iObserverRequestStatus; |
|
87 User::RequestComplete( status, KErrNone );//iStatus.Int() ); |
|
88 } |
|
89 |
|
90 |
|
91 // --------------------------------------------------------------------------- |
|
92 // From class CActive. |
|
93 // --------------------------------------------------------------------------- |
|
94 // |
|
95 void CMailWaitOperation::RunL() |
|
96 { |
|
97 // Never come here |
|
98 ASSERT( NULL ); |
|
99 } |
|
100 |
|
101 // End Of File |