|
1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #include "Te_LoopbackCWrapGetSmspList.h" |
|
17 |
|
18 |
|
19 CTestGetSmspList* CTestGetSmspList::NewLC(RMobileSmsMessaging& aSmsMessaging) |
|
20 { |
|
21 CTestGetSmspList* r=new(ELeave) CTestGetSmspList(aSmsMessaging); |
|
22 CleanupStack::PushL(r); |
|
23 r->ConstructL(); |
|
24 CleanupStack::Pop(); |
|
25 return r; |
|
26 } |
|
27 |
|
28 CTestGetSmspList::CTestGetSmspList(RMobileSmsMessaging& aSmsMessaging) |
|
29 : CActive(EPriorityNormal), iSmsMessaging(aSmsMessaging) |
|
30 { |
|
31 } |
|
32 |
|
33 void CTestGetSmspList::ConstructL() |
|
34 { |
|
35 CActiveScheduler::Add(this); |
|
36 iRetrieve=CRetrieveMobilePhoneSmspList::NewL(iSmsMessaging); |
|
37 } |
|
38 |
|
39 CTestGetSmspList::~CTestGetSmspList() |
|
40 { |
|
41 iRetrieve->Cancel(); |
|
42 delete iRetrieve; |
|
43 } |
|
44 |
|
45 void CTestGetSmspList::Start() |
|
46 { |
|
47 iRetrieve->Start(iStatus); |
|
48 SetActive(); |
|
49 } |
|
50 |
|
51 CMobilePhoneSmspList* CTestGetSmspList::RetrieveList() |
|
52 { |
|
53 CMobilePhoneSmspList* ptr=NULL; |
|
54 TRAP_IGNORE(ptr=iRetrieve->RetrieveListL()); // trap but ignore leaves |
|
55 return ptr; |
|
56 } |
|
57 |
|
58 void CTestGetSmspList::RunL() |
|
59 { |
|
60 TInt ret=iStatus.Int(); |
|
61 User::LeaveIfError(ret); |
|
62 CActiveScheduler::Stop(); |
|
63 } |
|
64 |
|
65 void CTestGetSmspList::DoCancel() |
|
66 { |
|
67 iRetrieve->Cancel(); |
|
68 } |