1 /* |
|
2 * Copyright (c) 2005 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: methods for CFotaReminderDlg |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #include <fotaserver.rsg> |
|
21 #include "FotaReminderDlg.h" |
|
22 |
|
23 #include "FotaDB.h" |
|
24 #include "FotaSrvDebug.h" |
|
25 |
|
26 // --------------------------------------------------------------------------- |
|
27 // CFotaReminderDlg::NewLC |
|
28 // Two-phase construction |
|
29 // --------------------------------------------------------------------------- |
|
30 // |
|
31 CFotaReminderDlg* CFotaReminderDlg::NewLC(TInt& aSelectedItem, CDesCArray* aItemArray, TInt& aEvent) |
|
32 { |
|
33 CFotaReminderDlg* self = new (ELeave) CFotaReminderDlg(aSelectedItem, aItemArray, aEvent); |
|
34 CleanupStack::PushL(self); |
|
35 self->ConstructL(); |
|
36 |
|
37 return self; |
|
38 } |
|
39 |
|
40 // --------------------------------------------------------------------------- |
|
41 // CFotaReminderDlg::NewL |
|
42 // Two-phase construction |
|
43 // --------------------------------------------------------------------------- |
|
44 // |
|
45 CFotaReminderDlg* CFotaReminderDlg::NewL(TInt& aSelectedItem, CDesCArray* aItemArray, TInt& aEvent) |
|
46 { |
|
47 CFotaReminderDlg* self = CFotaReminderDlg::NewLC(aSelectedItem, aItemArray, aEvent); |
|
48 CleanupStack::Pop(self); |
|
49 return self; |
|
50 } |
|
51 |
|
52 // --------------------------------------------------------------------------- |
|
53 // CFotaReminderDlg::~CFotaReminderDlg |
|
54 // Destructor. |
|
55 // --------------------------------------------------------------------------- |
|
56 // |
|
57 CFotaReminderDlg::~CFotaReminderDlg() |
|
58 { |
|
59 FLOG(_L("CFotaReminderDlg::~CFotaReminderDlg >>")); |
|
60 iAppKeyClient.Close(); |
|
61 FLOG(_L("CFotaReminderDlg::~CFotaReminderDlg <<")); |
|
62 } |
|
63 |
|
64 // --------------------------------------------------------------------------- |
|
65 // CFotaReminderDlg::CFotaReminderDlg |
|
66 // Constructor. |
|
67 // --------------------------------------------------------------------------- |
|
68 // |
|
69 CFotaReminderDlg::CFotaReminderDlg(TInt& aSelectedItem, CDesCArray* aItemArray, TInt& aEvent): |
|
70 CAknRadioButtonSettingPage( R_SETTING_REMAINDER, aSelectedItem, aItemArray ), |
|
71 iSelectedItem(aSelectedItem), |
|
72 iEvent(aEvent), |
|
73 iIsAppKeySuppressed(EFalse) |
|
74 { |
|
75 |
|
76 } |
|
77 |
|
78 // --------------------------------------------------------------------------- |
|
79 // CFotaReminderDlg::~CFotaReminderDlg |
|
80 // Two-phase construction. |
|
81 // --------------------------------------------------------------------------- |
|
82 // |
|
83 void CFotaReminderDlg::ConstructL() |
|
84 { |
|
85 FLOG(_L("CFotaReminderDlg::ConstructL >>")); |
|
86 |
|
87 SuppressAppKey(ETrue); |
|
88 |
|
89 CAknRadioButtonSettingPage::ConstructL(); |
|
90 iList = ListBoxControl(); |
|
91 |
|
92 FLOG(_L("CFotaReminderDlg::ConstructL <<")); |
|
93 } |
|
94 |
|
95 // --------------------------------------------------------------------------- |
|
96 // CFotaReminderDlg::ActivateL |
|
97 // Used to activate the radiobuttonsettingpage. |
|
98 // --------------------------------------------------------------------------- |
|
99 // |
|
100 void CFotaReminderDlg::ActivateL() |
|
101 { |
|
102 FLOG(_L("CFotaReminderDlg::ActivateL >>")); |
|
103 |
|
104 //iList->SetCurrentItemIndexAndDraw(0); |
|
105 CAknRadioButtonSettingPage::ActivateL(); |
|
106 |
|
107 FLOG(_L("CFotaReminderDlg::ActivateL <<")); |
|
108 } |
|
109 |
|
110 // --------------------------------------------------------------------------- |
|
111 // CFotaReminderDlg::OkToExitL |
|
112 // Determines if the dialog can be closed. |
|
113 // --------------------------------------------------------------------------- |
|
114 // |
|
115 TBool CFotaReminderDlg::OkToExitL( TInt aButtonId ) |
|
116 { |
|
117 FLOG(_L("CFotaReminderDlg::OkToExitL >>")); |
|
118 |
|
119 TBool IsAccepted = aButtonId; |
|
120 |
|
121 if ( IsAccepted ) |
|
122 { |
|
123 iSelectedItem = iList->CurrentItemIndex(); |
|
124 } |
|
125 |
|
126 SuppressAppKey(EFalse); |
|
127 FLOG(_L("CFotaReminderDlg::OkToExitL <<")); |
|
128 |
|
129 return ETrue; |
|
130 } |
|
131 |
|
132 |
|
133 // --------------------------------------------------------------------------- |
|
134 // CFotaReminderDlg::ProcessCommandL |
|
135 // Process events from softkeys |
|
136 // --------------------------------------------------------------------------- |
|
137 // |
|
138 void CFotaReminderDlg::ProcessCommandL( TInt aCommandId ) |
|
139 { |
|
140 FLOG(_L("CFotaReminderDlg::ProcessCommandL >>")); |
|
141 |
|
142 if ( aCommandId == EAknSoftkeyOk ) |
|
143 { |
|
144 AttemptExitL(ETrue); |
|
145 } |
|
146 |
|
147 if (aCommandId == EAknSoftkeyCancel || |
|
148 aCommandId == EAknCmdExit) |
|
149 { |
|
150 AttemptExitL( EFalse ); |
|
151 } |
|
152 |
|
153 FLOG(_L("CFotaReminderDlg::ProcessCommandL <<")); |
|
154 } |
|
155 |
|
156 |
|
157 // --------------------------------------------------------------------------- |
|
158 // CFotaReminderDlg::OfferKeyEventL |
|
159 // This routine routes the keys to the editor. |
|
160 // --------------------------------------------------------------------------- |
|
161 // |
|
162 TKeyResponse CFotaReminderDlg::OfferKeyEventL( |
|
163 const TKeyEvent& aKeyEvent, |
|
164 TEventCode aType ) |
|
165 { |
|
166 FLOG(_L("CFotaReminderDlg::OfferKeyEventL >>")); |
|
167 |
|
168 /*if (iResumeOnFG && iIsDlgOpen) |
|
169 { |
|
170 TApaTaskList taskList(CEikonEnv::Static()->WsSession()); |
|
171 TApaTask task=taskList.FindApp(TUid::Uid(KFotaServerUid)); |
|
172 if(task.Exists()) |
|
173 task.BringToForeground(); |
|
174 |
|
175 } |
|
176 |
|
177 iResumeOnFG = EFalse; |
|
178 //Menu key is pressed when reminder dialog is shown |
|
179 TBool aStartDmUi (EFalse); |
|
180 if (aKeyEvent.iCode == EKeyApplication0) |
|
181 { |
|
182 iResumeOnFG = ETrue; |
|
183 aStartDmUi = ETrue; |
|
184 }*/ |
|
185 |
|
186 iEvent = aType; |
|
187 TKeyResponse aResp (EKeyWasConsumed ); |
|
188 aResp = CAknRadioButtonSettingPage::OfferKeyEventL( aKeyEvent, aType ); |
|
189 |
|
190 FLOG(_L("CFotaReminderDlg::OfferKeyEventL <<")); |
|
191 return aResp; |
|
192 } |
|
193 |
|
194 // --------------------------------------------------------------------------- |
|
195 // CFotaReminderDlg::SuppressAppKey |
|
196 // Used to suppress the menu/app key |
|
197 // --------------------------------------------------------------------------- |
|
198 // |
|
199 void CFotaReminderDlg::SuppressAppKey(TBool aValue) |
|
200 { |
|
201 FLOG(_L("CFotaReminderDlg::SuppressAppKey >>")); |
|
202 |
|
203 if (iIsAppKeySuppressed!=aValue) |
|
204 { |
|
205 |
|
206 TInt error = iAppKeyClient.ConnectAndSendAppsKeySuppress(aValue); |
|
207 FLOG(_L("Return for suppress (%d)....%d"),aValue,error); |
|
208 iIsAppKeySuppressed = aValue; |
|
209 } |
|
210 |
|
211 FLOG(_L("CFotaReminderDlg::SuppressAppKey <<")); |
|
212 } |
|
213 |
|