|
1 /* |
|
2 * Copyright (c) 2007 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 |
|
18 #include "mmpostevaluationprocessor.h" |
|
19 #include "mmlistboxitemdrawer.h" |
|
20 #include "mmlistboxmodel.h" |
|
21 #include <layoutmetadata.cdl.h> |
|
22 |
|
23 // ----------------------------------------------------------------------------- |
|
24 // |
|
25 // ----------------------------------------------------------------------------- |
|
26 // |
|
27 CMmPostEvaluationProcessor::CMmPostEvaluationProcessor(CMmListBoxItemDrawer& aDrawer) : |
|
28 CActive(EPriorityLess), iDrawer(aDrawer), iIndexToProcess(0) |
|
29 { |
|
30 } |
|
31 |
|
32 // ----------------------------------------------------------------------------- |
|
33 // |
|
34 // ----------------------------------------------------------------------------- |
|
35 // |
|
36 CMmPostEvaluationProcessor* CMmPostEvaluationProcessor::NewLC(CMmListBoxItemDrawer& aDrawer) |
|
37 { |
|
38 CMmPostEvaluationProcessor* self = new ( ELeave ) CMmPostEvaluationProcessor(aDrawer); |
|
39 CleanupStack::PushL(self); |
|
40 self->ConstructL(); |
|
41 return self; |
|
42 } |
|
43 |
|
44 // ----------------------------------------------------------------------------- |
|
45 // |
|
46 // ----------------------------------------------------------------------------- |
|
47 // |
|
48 CMmPostEvaluationProcessor* CMmPostEvaluationProcessor::NewL(CMmListBoxItemDrawer& aDrawer) |
|
49 { |
|
50 CMmPostEvaluationProcessor* self = CMmPostEvaluationProcessor::NewLC(aDrawer); |
|
51 CleanupStack::Pop( self ); |
|
52 return self; |
|
53 } |
|
54 |
|
55 // ----------------------------------------------------------------------------- |
|
56 // |
|
57 // ----------------------------------------------------------------------------- |
|
58 // |
|
59 void CMmPostEvaluationProcessor::ConstructL() |
|
60 { |
|
61 CActiveScheduler::Add( this); // Add to scheduler |
|
62 } |
|
63 |
|
64 // ----------------------------------------------------------------------------- |
|
65 // |
|
66 // ----------------------------------------------------------------------------- |
|
67 // |
|
68 CMmPostEvaluationProcessor::~CMmPostEvaluationProcessor() |
|
69 { |
|
70 Cancel(); // Cancel any request, if outstanding |
|
71 // Delete instance variables if any |
|
72 } |
|
73 |
|
74 // ----------------------------------------------------------------------------- |
|
75 // |
|
76 // ----------------------------------------------------------------------------- |
|
77 // |
|
78 void CMmPostEvaluationProcessor::DoCancel() |
|
79 { |
|
80 } |
|
81 |
|
82 // ----------------------------------------------------------------------------- |
|
83 // |
|
84 // ----------------------------------------------------------------------------- |
|
85 // |
|
86 void CMmPostEvaluationProcessor::RunL() |
|
87 { |
|
88 const TDesC8& mm_template = iDrawer.iMmModel->GetAttributeAsText( |
|
89 iIndexToProcess, KMmTemplate8 ); |
|
90 |
|
91 if ( mm_template.Compare( KNullDesC8 ) && mm_template.Compare( KEmpty8 ) ) |
|
92 { |
|
93 iDrawer.SetupSubCellsL( EFalse, iIndexToProcess ); |
|
94 } |
|
95 |
|
96 if ( ++iIndexToProcess < iDrawer.iMmModel->NumberOfItems() ) |
|
97 { |
|
98 SetActive(); |
|
99 TRequestStatus* status = &iStatus; |
|
100 User::RequestComplete( status, KErrNone ); |
|
101 } |
|
102 } |
|
103 |
|
104 // ----------------------------------------------------------------------------- |
|
105 // |
|
106 // ----------------------------------------------------------------------------- |
|
107 // |
|
108 TInt CMmPostEvaluationProcessor::RunError(TInt aError) |
|
109 { |
|
110 return aError; |
|
111 } |
|
112 |
|
113 // ----------------------------------------------------------------------------- |
|
114 // |
|
115 // ----------------------------------------------------------------------------- |
|
116 // |
|
117 void CMmPostEvaluationProcessor::StartAt( TInt aIndex ) |
|
118 { |
|
119 Cancel(); |
|
120 iIndexToProcess = aIndex; |
|
121 SetActive(); |
|
122 TRequestStatus* status = &iStatus; |
|
123 User::RequestComplete( status, KErrNone ); |
|
124 } |
|
125 |
|
126 //End of file |