1304 // Cleanup. |
1316 // Cleanup. |
1305 CleanupStack::Pop( iconArray ); |
1317 CleanupStack::Pop( iconArray ); |
1306 |
1318 |
1307 // construct the "New Alarm" button |
1319 // construct the "New Alarm" button |
1308 iNewAlarmButton = CAknButton::NewL( NULL, NULL, NULL, NULL, |
1320 iNewAlarmButton = CAknButton::NewL( NULL, NULL, NULL, NULL, |
1309 iAlarmArray->NewAlarmText()->Des(),iAlarmArray->NewAlarmText()->Des(), 0, 0 ); |
1321 iAlarmArray->NewAlarmText()->Des(), KNullDesC, 0, 0 ); |
1310 iNewAlarmButton->SetParent( this ); |
1322 iNewAlarmButton->SetParent( this ); |
1311 iNewAlarmButton->SetContainerWindowL( *this ); |
1323 iNewAlarmButton->SetContainerWindowL( *this ); |
1312 //TAknLayoutRect newAlarmButtonRect; |
|
1313 // Get the skinnable clock rect. |
|
1314 //newAlarmButtonRect.LayoutRect( listRect.Rect(), |
|
1315 // AknLayoutScalable_Apps::main_clock2_btn_pane( layoutOrientation ).LayoutLine() ); |
|
1316 |
|
1317 //iNewAlarmButton->SetRect( newAlarmButtonRect.Rect() ); |
|
1318 SetCorrectRectForNewAlarmButton(); |
1324 SetCorrectRectForNewAlarmButton(); |
1319 iNewAlarmButton->SetObserver( this ); |
1325 iNewAlarmButton->SetObserver( this ); |
1320 iNewAlarmButton->ActivateL(); |
1326 iNewAlarmButton->ActivateL(); |
1321 // Add the icon for DST indicator. |
1327 // Add the icon for DST indicator. |
1322 AknsUtils::CreateColorIconL( AknsUtils::SkinInstance(), |
1328 AknsUtils::CreateColorIconL( AknsUtils::SkinInstance(), |
1393 TAknLayoutRect parentRect; |
1399 TAknLayoutRect parentRect; |
1394 parentRect.LayoutRect( Rect(), AknLayoutScalable_Apps::main_clock2_pane().LayoutLine() ); |
1400 parentRect.LayoutRect( Rect(), AknLayoutScalable_Apps::main_clock2_pane().LayoutLine() ); |
1395 |
1401 |
1396 TRect mainClockPane( parentRect.Rect() ); |
1402 TRect mainClockPane( parentRect.Rect() ); |
1397 |
1403 |
1398 // Get the layout for the day string. |
1404 if( Layout_Meta_Data::IsLandscapeOrientation() ) |
1399 layoutText.LayoutText( mainClockPane, AknLayoutScalable_Apps::main_clock2_pane_t1( displayOrientation ).LayoutLine() ); |
1405 { |
1400 |
1406 // main_clock2_pane_cp01_t1 Day + date |
1401 TPtr dayStringPtr = iDayNameString->Des(); |
1407 HBufC* dayAndDateString = HBufC::NewLC( iDayNameString->Length() + iDateString->Length() + 1 ); |
1402 // Day long format. |
1408 TPtr dayAndDateStringPtr = dayAndDateString->Des(); |
1403 layoutText.DrawText( aWindowGc, *iDayNameString, ETrue, cachedColor ); |
1409 dayAndDateStringPtr.Append( *iDayNameString ); |
1404 |
1410 dayAndDateStringPtr.Append( KSpace ); |
1405 // Get the layout for the datestring. |
1411 TPtr dateStringPtr = iDateString->Des(); |
1406 layoutText.LayoutText( mainClockPane, AknLayoutScalable_Apps::main_clock2_pane_t2( displayOrientation ).LayoutLine() ); |
1412 AknTextUtils::DisplayTextLanguageSpecificNumberConversion( dateStringPtr ); |
1407 |
1413 dayAndDateStringPtr.Append( *iDateString ); |
1408 TPtr dateStringPtr = iDateString->Des(); |
1414 |
1409 // For mirrored languages. |
1415 layoutText.LayoutText( mainClockPane, AknLayoutScalable_Apps::main_clock2_pane_cp01_t1( displayOrientation ).LayoutLine() ); |
1410 AknTextUtils::DisplayTextLanguageSpecificNumberConversion( dateStringPtr ); |
1416 layoutText.DrawText( aWindowGc, *dayAndDateString , ETrue, cachedColor ); |
1411 // Date long format |
1417 |
1412 layoutText.DrawText( aWindowGc, *iDateString, ETrue, cachedColor ); |
1418 CleanupStack::PopAndDestroy( dayAndDateString ); |
1413 |
1419 dayAndDateString = NULL; |
1414 // Get the layout for the timezone string. |
1420 |
1415 layoutText.LayoutText( mainClockPane, AknLayoutScalable_Apps::main_clock2_pane_t3( Layout_Meta_Data::IsLandscapeOrientation() ).LayoutLine() ); |
1421 // main_clock2_pane_cp01_t3 zone + country |
1416 |
1422 HBufC* timeZoneAndCountryString = HBufC::NewLC( iTimeZoneString->Length() + iLocationString->Length() + 1 ); |
1417 TPtr timeZonePtr = iTimeZoneString->Des(); |
1423 TPtr timeZoneAndCountryStringPtr = timeZoneAndCountryString->Des(); |
1418 // This is for mirrored languages. |
1424 TPtr timeZoneStringPtr = iTimeZoneString->Des(); |
1419 AknTextUtils::DisplayTextLanguageSpecificNumberConversion( timeZonePtr ); |
1425 AknTextUtils::DisplayTextLanguageSpecificNumberConversion( timeZoneStringPtr ); |
1420 // The timezone string. |
1426 timeZoneAndCountryStringPtr.Append( *iTimeZoneString ); |
1421 layoutText.DrawText( aWindowGc, *iTimeZoneString, ETrue, cachedColor ); |
1427 timeZoneAndCountryStringPtr.Append( KSpace ); |
1422 |
1428 timeZoneAndCountryStringPtr.Append( *iLocationString ); |
1423 // Get the layout for the country string. |
1429 |
1424 TAknTextComponentLayout labelLayout; |
1430 layoutText.LayoutText( mainClockPane, AknLayoutScalable_Apps::main_clock2_pane_cp01_t3( displayOrientation ).LayoutLine() ); |
1425 labelLayout = AknLayoutScalable_Apps::main_clock2_pane_t4( Layout_Meta_Data::IsLandscapeOrientation() ); |
1431 layoutText.DrawText( aWindowGc, *timeZoneAndCountryString, ETrue, cachedColor ); |
1426 AknLayoutUtils::LayoutLabel( iLocationLabel, parentRect.Rect(), labelLayout.LayoutLine() ); |
1432 /* |
1427 |
1433 TAknTextComponentLayout labelLayout; |
1428 // Set the label for the text and start marqueeing. |
1434 labelLayout = AknLayoutScalable_Apps::main_clock2_pane_cp01_t3( Layout_Meta_Data::IsLandscapeOrientation() ); |
1429 iLocationLabel->SetLabelTextL( *iLocationString ); |
1435 AknLayoutUtils::LayoutLabel( iLocationLabel, parentRect.Rect(), labelLayout.LayoutLine() ); |
1430 iLocationLabel->StartMarquee(); |
1436 |
1431 iLocationLabel->RedrawRect( iLocationLabel->Rect() ); |
1437 // Set the label for the text and start marqueeing. |
1432 |
1438 iLocationLabel->SetLabelTextL( *timeZoneAndCountryString ); |
1433 // We display empty text only if there are no alarms set. |
1439 TGulAlignment alignment; |
1434 // if( !iAlarmArray->MdcaCount() ) |
1440 alignment.SetHAlignment( EHCenter ); |
1435 // { |
1441 iLocationLabel->SetAlignment( alignment ); |
1436 // Set the listbox layout. |
1442 iLocationLabel->StartMarquee(); |
1437 // TAknLayoutRect listRect; |
1443 iLocationLabel->RedrawRect( iLocationLabel->Rect() ); |
1438 // Get the main clock rect. |
1444 */ |
1439 // listRect.LayoutRect( mainClockPane, AknLayoutScalable_Apps::listscroll_gen_pane_cp06( Layout_Meta_Data::IsLandscapeOrientation() ).LayoutLine() ); |
1445 CleanupStack::PopAndDestroy( timeZoneAndCountryString ); |
1440 |
1446 timeZoneAndCountryString = NULL; |
1441 // Get the rect for the empty text. |
1447 } |
1442 // layoutText.LayoutText( listRect.Rect(), AknLayoutScalable_Apps::listscroll_gen_pane_cp06_t1( Layout_Meta_Data::IsLandscapeOrientation() ).LayoutLine() ); |
1448 else |
1443 // Draw the text. |
1449 { |
1444 // layoutText.DrawText( aWindowGc, *iNoAlarmsText, ETrue, cachedColor ); |
1450 // Get the layout for the day string. |
1445 //} |
1451 layoutText.LayoutText( mainClockPane, AknLayoutScalable_Apps::main_clock2_pane_t1( displayOrientation ).LayoutLine() ); |
1446 |
1452 |
|
1453 TPtr dayStringPtr = iDayNameString->Des(); |
|
1454 // Day long format. |
|
1455 layoutText.DrawText( aWindowGc, *iDayNameString, ETrue, cachedColor ); |
|
1456 |
|
1457 // Get the layout for the datestring. |
|
1458 layoutText.LayoutText( mainClockPane, AknLayoutScalable_Apps::main_clock2_pane_t2( displayOrientation ).LayoutLine() ); |
|
1459 |
|
1460 TPtr dateStringPtr = iDateString->Des(); |
|
1461 // For mirrored languages. |
|
1462 AknTextUtils::DisplayTextLanguageSpecificNumberConversion( dateStringPtr ); |
|
1463 // Date long format |
|
1464 layoutText.DrawText( aWindowGc, *iDateString, ETrue, cachedColor ); |
|
1465 |
|
1466 // Get the layout for the timezone string. |
|
1467 layoutText.LayoutText( mainClockPane, AknLayoutScalable_Apps::main_clock2_pane_t3( Layout_Meta_Data::IsLandscapeOrientation() ).LayoutLine() ); |
|
1468 |
|
1469 TPtr timeZonePtr = iTimeZoneString->Des(); |
|
1470 // This is for mirrored languages. |
|
1471 AknTextUtils::DisplayTextLanguageSpecificNumberConversion( timeZonePtr ); |
|
1472 // The timezone string. |
|
1473 layoutText.DrawText( aWindowGc, *iTimeZoneString, ETrue, cachedColor ); |
|
1474 |
|
1475 // Get the layout for the country string. |
|
1476 TAknTextComponentLayout labelLayout; |
|
1477 labelLayout = AknLayoutScalable_Apps::main_clock2_pane_t4( Layout_Meta_Data::IsLandscapeOrientation() ); |
|
1478 AknLayoutUtils::LayoutLabel( iLocationLabel, parentRect.Rect(), labelLayout.LayoutLine() ); |
|
1479 |
|
1480 // Set the label for the text and start marqueeing. |
|
1481 iLocationLabel->SetLabelTextL( *iLocationString ); |
|
1482 iLocationLabel->StartMarquee(); |
|
1483 iLocationLabel->RedrawRect( iLocationLabel->Rect() ); |
|
1484 } |
1447 __PRINTS( "CClockMainContainer::DrawMainViewText - Exit" ); |
1485 __PRINTS( "CClockMainContainer::DrawMainViewText - Exit" ); |
1448 } |
1486 } |
1449 |
1487 |
1450 // --------------------------------------------------------- |
1488 // --------------------------------------------------------- |
1451 // CClockMainContainer::IsDstOnL |
1489 // CClockMainContainer::IsDstOnL |