178 |
181 |
179 // --------------------------------------------------------------------------- |
182 // --------------------------------------------------------------------------- |
180 // CMailCpsIf::PublishSetupWizardL |
183 // CMailCpsIf::PublishSetupWizardL |
181 // --------------------------------------------------------------------------- |
184 // --------------------------------------------------------------------------- |
182 // |
185 // |
183 void CMailCpsIf::PublishSetupWizardL(TInt instance) |
186 void CMailCpsIf::PublishSetupWizardL(TInt aInstance) |
184 { |
187 { |
185 FUNC_LOG; |
188 FUNC_LOG; |
186 TFSMailMsgId mailBoxId; |
189 if (!iInstIdList[aInstance].iWizardPublished) |
187 TFSMailMsgId folderId; |
190 { |
188 |
191 TFSMailMsgId mailBoxId; |
189 HBufC* setupEmail = StringLoader::LoadLC(R_EMAILWIDGET_TEXT_SETUP_EMAIL); |
192 TFSMailMsgId folderId; |
190 |
193 |
191 iSetupUid = PublishDescriptorL( |
194 HBufC* setupEmail = StringLoader::LoadLC(R_EMAILWIDGET_TEXT_SETUP_EMAIL); |
|
195 |
|
196 iSetupUid = PublishDescriptorL( |
192 KPubId, KContTypeSetupText, |
197 KPubId, KContTypeSetupText, |
193 iInstIdList[instance]->Des(), |
198 iInstIdList[aInstance].iCid, |
194 *setupEmail, |
199 *setupEmail, |
195 KKeySetupText, KTriggerWizard8); |
200 KKeySetupText, KTriggerWizard8); |
196 |
201 |
197 PublishImageL( |
202 PublishImageL( |
198 iInstIdList[instance]->Des(), |
203 iInstIdList[aInstance].iCid, |
199 KContTypeSetupIcon, |
204 KContTypeSetupIcon, |
200 KKeySetupIcon, |
205 KKeySetupIcon, |
201 EMbmCmailhandlerpluginQgn_prop_cmail_new_mailbox, |
206 EMbmCmailhandlerpluginQgn_prop_cmail_new_mailbox, |
202 EMbmCmailhandlerpluginQgn_prop_cmail_new_mailbox_mask, |
207 EMbmCmailhandlerpluginQgn_prop_cmail_new_mailbox_mask, |
203 mailBoxId, |
208 mailBoxId, |
204 KNullDes); |
209 KNullDes); |
205 |
210 |
206 PublishImageL( |
211 PublishImageL( |
207 iInstIdList[instance]->Des(), |
212 iInstIdList[aInstance].iCid, |
208 KContTypeSetupBrandIcon1, |
213 KContTypeSetupBrandIcon1, |
209 KKeySetupBrandIcon1, |
214 KKeySetupBrandIcon1, |
210 EMbmCmailhandlerpluginQgn_indi_cmail_drop_email_account, |
215 EMbmCmailhandlerpluginQgn_indi_cmail_drop_email_account, |
211 EMbmCmailhandlerpluginQgn_indi_cmail_drop_email_account_mask, |
216 EMbmCmailhandlerpluginQgn_indi_cmail_drop_email_account_mask, |
212 mailBoxId, |
217 mailBoxId, |
213 KSetupBrand1); |
218 KSetupBrand1); |
214 |
219 |
215 PublishImageL( |
220 PublishImageL( |
216 iInstIdList[instance]->Des(), |
221 iInstIdList[aInstance].iCid, |
217 KContTypeSetupBrandIcon2, |
222 KContTypeSetupBrandIcon2, |
218 KKeySetupBrandIcon2, |
223 KKeySetupBrandIcon2, |
219 EMbmCmailhandlerpluginQgn_indi_cmail_drop_email_account, |
224 EMbmCmailhandlerpluginQgn_indi_cmail_drop_email_account, |
220 EMbmCmailhandlerpluginQgn_indi_cmail_drop_email_account_mask, |
225 EMbmCmailhandlerpluginQgn_indi_cmail_drop_email_account_mask, |
221 mailBoxId, |
226 mailBoxId, |
222 KSetupBrand2); |
227 KSetupBrand2); |
223 |
228 |
224 PublishImageL( |
229 PublishImageL( |
225 iInstIdList[instance]->Des(), |
230 iInstIdList[aInstance].iCid, |
226 KContTypeSetupBrandIcon3, |
231 KContTypeSetupBrandIcon3, |
227 KKeySetupBrandIcon3, |
232 KKeySetupBrandIcon3, |
228 EMbmCmailhandlerpluginQgn_indi_cmail_drop_email_account, |
233 EMbmCmailhandlerpluginQgn_indi_cmail_drop_email_account, |
229 EMbmCmailhandlerpluginQgn_indi_cmail_drop_email_account_mask, |
234 EMbmCmailhandlerpluginQgn_indi_cmail_drop_email_account_mask, |
230 mailBoxId, |
235 mailBoxId, |
231 KSetupBrand3); |
236 KSetupBrand3); |
232 |
237 |
233 PublishImageL( |
238 PublishImageL( |
234 iInstIdList[instance]->Des(), |
239 iInstIdList[aInstance].iCid, |
235 KContTypeSetupBrandIcon4, |
240 KContTypeSetupBrandIcon4, |
236 KKeySetupBrandIcon4, |
241 KKeySetupBrandIcon4, |
237 EMbmCmailhandlerpluginQgn_indi_cmail_drop_email_account, |
242 EMbmCmailhandlerpluginQgn_indi_cmail_drop_email_account, |
238 EMbmCmailhandlerpluginQgn_indi_cmail_drop_email_account_mask, |
243 EMbmCmailhandlerpluginQgn_indi_cmail_drop_email_account_mask, |
239 mailBoxId, |
244 mailBoxId, |
240 KSetupBrand4); |
245 KSetupBrand4); |
241 |
246 iInstIdList[aInstance].iWizardPublished = ETrue; |
242 CleanupStack::PopAndDestroy(setupEmail); |
247 CleanupStack::PopAndDestroy(setupEmail); |
|
248 } |
243 } |
249 } |
244 |
250 |
245 // --------------------------------------------------------------------------- |
251 // --------------------------------------------------------------------------- |
246 // CMailCpsIf::PublishActiveMailboxNameL |
252 // CMailCpsIf::PublishActiveMailboxNameL |
247 // --------------------------------------------------------------------------- |
253 // --------------------------------------------------------------------------- |
290 textKey.Copy(KKeyBodyText); |
296 textKey.Copy(KKeyBodyText); |
291 textKey.Append(_L("1")); |
297 textKey.Append(_L("1")); |
292 |
298 |
293 TFSMailMsgId dummy; |
299 TFSMailMsgId dummy; |
294 |
300 |
295 PublishDescriptorL( KPubId, contentType, iInstIdList[aInstance]->Des(), |
301 PublishDescriptorL( KPubId, contentType, iInstIdList[aInstance].iCid, |
296 aMailboxName, textKey, aAction); |
302 aMailboxName, textKey, aAction); |
297 } |
303 } |
298 |
304 |
299 // --------------------------------------------------------------------------- |
305 // --------------------------------------------------------------------------- |
300 // CMailCpsIf::PublishIndicatorIconL |
306 // CMailCpsIf::PublishIndicatorIconL |
301 // --------------------------------------------------------------------------- |
307 // --------------------------------------------------------------------------- |
893 } |
900 } |
894 if (trigger.Compare(KSuspend16) == 0) |
901 if (trigger.Compare(KSuspend16) == 0) |
895 { |
902 { |
896 // Publishing to homescreen suspended. |
903 // Publishing to homescreen suspended. |
897 HBufC* cid = contentid.AllocLC(); |
904 HBufC* cid = contentid.AllocLC(); |
898 TInt widgetInstance = FindWidgetInstanceId(cid->Des()); |
905 TInt widgetInstance = GetWidgetInstanceId(cid->Des()); |
899 if(widgetInstance>=0) |
906 if(widgetInstance>=0) |
900 iAllowedToPublish[widgetInstance] = EFalse; |
907 iAllowedToPublish[widgetInstance] = EFalse; |
901 CleanupStack::PopAndDestroy( cid ); |
908 CleanupStack::PopAndDestroy( cid ); |
902 } |
909 } |
903 else if (trigger.Compare(KResume16) == 0) |
910 else if (trigger.Compare(KResume16) == 0) |
904 { |
911 { |
905 HBufC* cid = contentid.AllocLC(); |
912 HBufC* cid = contentid.AllocLC(); |
906 if ( FindWidgetInstanceId(cid->Des()) < 0 ) |
913 if ( GetWidgetInstanceId(cid->Des()) < 0 ) |
907 { |
914 { |
908 iInstIdList.AppendL( contentid.AllocL() ); |
915 TInstIdInfo instIdInfo; |
|
916 instIdInfo.iCid.Copy(cid->Des()); |
|
917 instIdInfo.iUpdateNeeded = ETrue; |
|
918 instIdInfo.iWizardPublished = EFalse; |
|
919 iInstIdList.AppendL(instIdInfo); |
909 } |
920 } |
910 TInt widgetInstance = FindWidgetInstanceId(cid->Des()); |
921 TInt widgetInstance = GetWidgetInstanceId(cid->Des()); |
911 if(widgetInstance>=0)// coverity fix, index can be negativ, allowed 0, since it is valid index |
922 if(widgetInstance>=0)// coverity fix, index can be negativ, allowed 0, since it is valid index |
912 { |
923 { |
913 PublishSetupWizardL(widgetInstance); |
|
914 iMailCpsHandler->UpdateMailboxesL(widgetInstance, cid->Des()); |
924 iMailCpsHandler->UpdateMailboxesL(widgetInstance, cid->Des()); |
|
925 PublishSetupWizardL(widgetInstance); |
915 // Widget visible on the homescreen. Publishing allowed. |
926 // Widget visible on the homescreen. Publishing allowed. |
916 iAllowedToPublish[widgetInstance] = ETrue; |
927 iAllowedToPublish[widgetInstance] = ETrue; |
917 } |
928 } |
918 CleanupStack::PopAndDestroy( cid ); |
929 CleanupStack::PopAndDestroy( cid ); |
919 } |
930 } |
921 { |
932 { |
922 // Widget added to homescreen |
933 // Widget added to homescreen |
923 HBufC* cid = contentid.AllocLC(); |
934 HBufC* cid = contentid.AllocLC(); |
924 if ( cid->Length() > 0 ) |
935 if ( cid->Length() > 0 ) |
925 { |
936 { |
926 iInstIdList.AppendL( contentid.AllocL() ); |
937 TInstIdInfo instIdInfo; |
|
938 instIdInfo.iCid.Copy(cid->Des()); |
|
939 instIdInfo.iUpdateNeeded = ETrue; |
|
940 instIdInfo.iWizardPublished = EFalse; |
|
941 iInstIdList.AppendL(instIdInfo); |
927 TFSMailMsgId mailBox( iMailCpsHandler->WaitingForNewWidget() ); |
942 TFSMailMsgId mailBox( iMailCpsHandler->WaitingForNewWidget() ); |
928 if ( mailBox.Id() > 0 ) |
943 if ( mailBox.Id() > 0 ) |
929 { |
944 { |
930 // Associate new mailbox to widget setting |
945 // Associate new mailbox to widget setting |
931 iMailCpsHandler->AssociateWidgetToSetting( |
946 iMailCpsHandler->AssociateWidgetToSetting( |