30 #include "..\help\podcatcher.hlp.hrh" |
30 #include "..\help\podcatcher.hlp.hrh" |
31 #include "PodcastApp.h" |
31 #include "PodcastApp.h" |
32 #include <APGWGNAM.H> |
32 #include <APGWGNAM.H> |
33 #include <HLPLCH.H> |
33 #include <HLPLCH.H> |
34 #include <avkon.hrh> |
34 #include <avkon.hrh> |
|
35 #include "Podcast.mbg" |
35 |
36 |
36 const TUint KDelayLaunch = 1000; |
37 const TUint KDelayLaunch = 1000; |
37 |
38 |
38 CPodcastAppUi::CPodcastAppUi(CPodcastModel* aPodcastModel):iPodcastModel(aPodcastModel) |
39 CPodcastAppUi::CPodcastAppUi(CPodcastModel* aPodcastModel):iPodcastModel(aPodcastModel) |
39 { |
40 { |
202 iNaviStyle = ENaviText; |
203 iNaviStyle = ENaviText; |
203 } |
204 } |
204 |
205 |
205 void CPodcastAppUi::NaviShowTabGroupL() |
206 void CPodcastAppUi::NaviShowTabGroupL() |
206 { |
207 { |
207 if (iNaviStyle != ENaviEmpty) { |
208 // if (iNaviStyle != ENaviEmpty) { |
208 iNaviPane->Pop(); |
209 // iNaviPane->Pop(); |
209 } |
210 // } |
210 |
211 // |
211 iNaviTabGroup = iNaviPane->CreateTabGroupL(); |
212 // iNaviTabGroup = iNaviPane->CreateTabGroupL(); |
212 |
213 |
213 iTabGroup = STATIC_CAST(CAknTabGroup*, iNaviTabGroup->DecoratedControl()); |
214 iTabGroup = STATIC_CAST(CAknTabGroup*, iNaviPane->ResourceDecorator()->DecoratedControl()); |
214 iTabGroup->SetTabFixedWidthL(EAknTabWidthWithTwoTabs); |
215 iTabGroup->SetObserver(this); |
215 |
216 |
216 HBufC *label1 = iEikonEnv->AllocReadResourceLC(R_TABGROUP_FEEDS); |
217 // iTabGroup->SetTabFixedWidthL(EAknTabWidthWithTwoTabs); |
217 iTabGroup->AddTabL(KTabIdFeeds,*label1); |
218 // |
218 |
219 // HBufC *label1 = iEikonEnv->AllocReadResourceLC(R_TABGROUP_FEEDS); |
219 HBufC *label3 = iEikonEnv->AllocReadResourceLC(R_TABGROUP_QUEUE); |
220 // iTabGroup->AddTabL(KTabIdFeeds,*label1); |
220 iTabGroup->AddTabL(KTabIdQueue,*label3); |
221 // |
221 |
222 // HBufC *label3 = iEikonEnv->AllocReadResourceLC(R_TABGROUP_QUEUE); |
222 CleanupStack::PopAndDestroy(label3); |
223 // iTabGroup->AddTabL(KTabIdQueue,*label3); |
223 CleanupStack::PopAndDestroy(label1); |
224 // |
224 |
225 // CleanupStack::PopAndDestroy(label3); |
225 iTabGroup->SetActiveTabByIndex(0); |
226 // CleanupStack::PopAndDestroy(label1); |
226 iTabGroup->SetObserver(this); |
227 // |
227 |
228 // iTabGroup->SetActiveTabByIndex(0); |
228 iNaviPane->PushL(*iNaviTabGroup); |
229 // |
|
230 // iNaviPane->PushL(*iNaviTabGroup); |
229 iNaviStyle = ENaviTabGroup; |
231 iNaviStyle = ENaviTabGroup; |
230 |
232 // |
231 UpdateQueueTabL(iPodcastModel->ShowEngine().GetNumDownloadingShows()); |
233 UpdateQueueTabL(iPodcastModel->ShowEngine().GetNumDownloadingShows()); |
232 } |
234 } |
233 |
235 |
234 void CPodcastAppUi::TabChangedL (TInt aIndex) |
236 void CPodcastAppUi::TabChangedL (TInt aIndex) |
235 { |
237 { |
280 |
282 |
281 void CPodcastAppUi::UpdateQueueTabL(TInt aQueueLength) |
283 void CPodcastAppUi::UpdateQueueTabL(TInt aQueueLength) |
282 { |
284 { |
283 if (iNaviStyle == ENaviTabGroup) |
285 if (iNaviStyle == ENaviTabGroup) |
284 { |
286 { |
|
287 CFbsBitmap* bitmap; |
|
288 CFbsBitmap* mask; |
285 if (aQueueLength == 0) |
289 if (aQueueLength == 0) |
286 { |
290 { |
287 HBufC *queue = iEikonEnv->AllocReadResourceLC(R_TABGROUP_QUEUE); |
291 AknIconUtils::CreateIconL(bitmap, |
288 iTabGroup->ReplaceTabL(KTabIdQueue, *queue); |
292 mask, |
289 CleanupStack::PopAndDestroy(queue); |
293 iEikonEnv->EikAppUi()->Application()->BitmapStoreName(), |
|
294 EMbmPodcastTab_queue, |
|
295 EMbmPodcastTab_queue_mask); |
|
296 } |
|
297 else if (aQueueLength == 1) |
|
298 { |
|
299 |
|
300 AknIconUtils::CreateIconL(bitmap, |
|
301 mask, |
|
302 iEikonEnv->EikAppUi()->Application()->BitmapStoreName(), |
|
303 EMbmPodcastTab_queue1, |
|
304 EMbmPodcastTab_queue1_mask); |
|
305 } |
|
306 else if (aQueueLength == 2) |
|
307 { |
|
308 |
|
309 AknIconUtils::CreateIconL(bitmap, |
|
310 mask, |
|
311 iEikonEnv->EikAppUi()->Application()->BitmapStoreName(), |
|
312 EMbmPodcastTab_queue2, |
|
313 EMbmPodcastTab_queue2_mask); |
290 } |
314 } |
291 else |
315 else |
292 { |
316 { |
293 HBufC *queueTemplate = iEikonEnv->AllocReadResourceLC(R_TABGROUP_QUEUE_COUNTER); |
317 |
294 HBufC *queueCounter = HBufC::NewLC(queueTemplate->Length()+2); |
318 AknIconUtils::CreateIconL(bitmap, |
295 queueCounter->Des().Format(*queueTemplate, aQueueLength); |
319 mask, |
296 |
320 iEikonEnv->EikAppUi()->Application()->BitmapStoreName(), |
297 iTabGroup->ReplaceTabL(KTabIdQueue, *queueCounter); |
321 EMbmPodcastTab_queue3, |
298 CleanupStack::PopAndDestroy(queueCounter); |
322 EMbmPodcastTab_queue3_mask); |
299 CleanupStack::PopAndDestroy(queueTemplate); |
323 } |
300 } |
324 |
|
325 iTabGroup->ReplaceTabL(EPodcastTabQueue, bitmap, mask); |
301 } |
326 } |
302 } |
327 } |
303 |
328 |
304 void CPodcastAppUi::TabLeftL() |
329 void CPodcastAppUi::TabLeftL() |
305 { |
330 { |