43 CActiveScheduler::Add(this); |
41 CActiveScheduler::Add(this); |
44 } |
42 } |
45 |
43 |
46 EXPORT_C CAknWaitNoteWrapper* CAknWaitNoteWrapper::NewL() |
44 EXPORT_C CAknWaitNoteWrapper* CAknWaitNoteWrapper::NewL() |
47 { |
45 { |
48 _AKNTRACE_FUNC_ENTER; |
|
49 CAknWaitNoteWrapper* self = new(ELeave) CAknWaitNoteWrapper; |
46 CAknWaitNoteWrapper* self = new(ELeave) CAknWaitNoteWrapper; |
50 _AKNTRACE_FUNC_EXIT; |
|
51 return self; |
47 return self; |
52 } |
48 } |
53 |
49 |
54 EXPORT_C CAknWaitNoteWrapper::~CAknWaitNoteWrapper() |
50 EXPORT_C CAknWaitNoteWrapper::~CAknWaitNoteWrapper() |
55 { |
51 { |
56 _AKNTRACE_FUNC_ENTER; |
|
57 Cancel(); |
52 Cancel(); |
58 iTimer.Close(); |
53 iTimer.Close(); |
59 delete iWaitDialog; |
54 delete iWaitDialog; |
60 _AKNTRACE_FUNC_EXIT; |
|
61 } |
55 } |
62 |
56 |
63 EXPORT_C TBool CAknWaitNoteWrapper::ExecuteL |
57 EXPORT_C TBool CAknWaitNoteWrapper::ExecuteL |
64 (TInt aResId,MAknBackgroundProcess& aBackgroundProcess, |
58 (TInt aResId,MAknBackgroundProcess& aBackgroundProcess, |
65 TBool aVisibilityDelayOff, const CAknNoteDialog::TTone& aTone) |
59 TBool aVisibilityDelayOff, const CAknNoteDialog::TTone& aTone) |
66 { |
60 { |
67 _AKNTRACE_FUNC_ENTER; |
|
68 iBackgroundProcess = &aBackgroundProcess; |
61 iBackgroundProcess = &aBackgroundProcess; |
69 CreateDialogL(aVisibilityDelayOff,aTone); |
62 CreateDialogL(aVisibilityDelayOff,aTone); |
70 iWaitDialog->ExecuteLD(aResId); |
63 iWaitDialog->ExecuteLD(aResId); |
71 _AKNTRACE_FUNC_EXIT; |
|
72 return NextCycleAndReturnL(); |
64 return NextCycleAndReturnL(); |
73 } |
65 } |
74 |
66 |
75 EXPORT_C TBool CAknWaitNoteWrapper::ExecuteL |
67 EXPORT_C TBool CAknWaitNoteWrapper::ExecuteL |
76 (TInt aResId,MAknBackgroundProcess& aBackgroundProcess, |
68 (TInt aResId,MAknBackgroundProcess& aBackgroundProcess, |
77 const TDesC& aPrompt, TBool aVisibilityDelayOff, const CAknNoteDialog::TTone& aTone) |
69 const TDesC& aPrompt, TBool aVisibilityDelayOff, const CAknNoteDialog::TTone& aTone) |
78 { |
70 { |
79 _AKNTRACE_FUNC_ENTER; |
|
80 iBackgroundProcess = &aBackgroundProcess; |
71 iBackgroundProcess = &aBackgroundProcess; |
81 CreateDialogL(aVisibilityDelayOff,aTone); |
72 CreateDialogL(aVisibilityDelayOff,aTone); |
82 iWaitDialog->PrepareLC(aResId); |
73 iWaitDialog->PrepareLC(aResId); |
83 iWaitDialog->SetTextL(aPrompt); |
74 iWaitDialog->SetTextL(aPrompt); |
84 iWaitDialog->RunLD(); |
75 iWaitDialog->RunLD(); |
85 _AKNTRACE_FUNC_EXIT; |
|
86 return NextCycleAndReturnL(); |
76 return NextCycleAndReturnL(); |
87 } |
77 } |
88 |
78 |
89 void CAknWaitNoteWrapper::DoCancel() |
79 void CAknWaitNoteWrapper::DoCancel() |
90 { |
80 { |
91 _AKNTRACE_FUNC_ENTER; |
|
92 if (IsActive()) |
81 if (IsActive()) |
93 { |
82 { |
94 iTimer.Cancel(); |
83 iTimer.Cancel(); |
95 CAknEnv::StopSchedulerWaitWithBusyMessage(iWait); |
84 CAknEnv::StopSchedulerWaitWithBusyMessage(iWait); |
96 } |
85 } |
97 _AKNTRACE_FUNC_EXIT; |
|
98 } |
86 } |
99 |
87 |
100 void CAknWaitNoteWrapper::RunL() |
88 void CAknWaitNoteWrapper::RunL() |
101 { |
89 { |
102 _AKNTRACE_FUNC_ENTER; |
|
103 if (iBackgroundProcess->IsProcessDone() || !iWaitDialog) |
90 if (iBackgroundProcess->IsProcessDone() || !iWaitDialog) |
104 { |
91 { |
105 iBackgroundProcess->ProcessFinished(); |
92 iBackgroundProcess->ProcessFinished(); |
106 if (iWaitDialog) |
93 if (iWaitDialog) |
107 { |
94 { |
146 SetActive(); |
132 SetActive(); |
147 } |
133 } |
148 |
134 |
149 TBool CAknWaitNoteWrapper::NextCycleAndReturnL() |
135 TBool CAknWaitNoteWrapper::NextCycleAndReturnL() |
150 { |
136 { |
151 _AKNTRACE_FUNC_ENTER; |
|
152 User::LeaveIfError(iTimer.CreateLocal()); |
137 User::LeaveIfError(iTimer.CreateLocal()); |
153 iIsDialogCanceled = ETrue; |
138 iIsDialogCanceled = ETrue; |
154 |
139 |
155 NextCycle(); |
140 NextCycle(); |
156 iWait.Start(); |
141 iWait.Start(); |
157 iTimer.Close(); |
142 iTimer.Close(); |
158 |
143 |
159 User::LeaveIfError(iRunError); |
144 User::LeaveIfError(iRunError); |
160 _AKNTRACE_FUNC_EXIT; |
|
161 |
|
162 return !iIsDialogCanceled; |
145 return !iIsDialogCanceled; |
163 } |
146 } |
164 |
147 |
165 void CAknWaitNoteWrapper::CreateDialogL(TBool aVisibilityDelayOff, const CAknNoteDialog::TTone& aTone) |
148 void CAknWaitNoteWrapper::CreateDialogL(TBool aVisibilityDelayOff, const CAknNoteDialog::TTone& aTone) |
166 { |
149 { |