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