--- a/uifw/AvKon/src/aknsignal.cpp Thu Aug 19 10:11:06 2010 +0300
+++ b/uifw/AvKon/src/aknsignal.cpp Tue Aug 31 15:28:30 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -82,7 +82,7 @@
CFbsBitmap* iCdmaStaticIcons[5]; // non-animated icons
CFbsBitmap* iCdmaStaticMasks[5]; // non-animated masks (needed because of AknIconUtils)
- CEikStatusPaneBase* iStatusPane;
+ TBool iIsActiveIdle;
};
@@ -289,8 +289,7 @@
// off by default
iExtension->iCdmaSignalState = EAknSignalCdmaIndicatorOff;
iExtension->iCdmaAnimationIndex = 0;
-
- iExtension->iStatusPane = CEikStatusPaneBase::Current();
+ iExtension->iIsActiveIdle = AknStatuspaneUtils::IsActiveIdle();
iSignalIconControl = CAknSignalIcon::NewL();
iSignalIconControl->SetDrawBlank( EFalse );
@@ -303,6 +302,8 @@
iSignalIconControl->SetContainerWindowL( *this );
iSignalStrengthControl->SetContainerWindowL( *this );
+ iTicker = CPeriodic::NewL( CActive::EPriorityLow );
+
// Set flags to default values
iPrivateFlags = 0;
@@ -379,7 +380,10 @@
//
void CAknSignalPane::DisableAnimation()
{
- StopTicker();
+ if ( iTicker && iTicker->IsActive() )
+ {
+ iTicker->Cancel();
+ }
}
@@ -399,14 +403,19 @@
iSignalIconControl->SetDrawBlank( EFalse );
- if ( aGprsIconState != EAknSignalGprsIndicatorEstablishingContext )
+ if ( aGprsIconState != EAknSignalGprsIndicatorEstablishingContext &&
+ iTicker )
{
- StopTicker();
+ iTicker->Cancel();
}
else if ( aGprsIconState == EAknSignalGprsIndicatorEstablishingContext )
{
- TRAP_IGNORE( StartTickerL( KAknIndicatorAnimationDelay,
- KAknIndicatorAnimationInterval ) );
+ if ( iTicker && !iTicker->IsActive() )
+ {
+ iTicker->Start( KAknIndicatorAnimationDelay,
+ KAknIndicatorAnimationInterval,
+ TCallBack( TickerCallback, this ) );
+ }
}
}
}
@@ -521,45 +530,32 @@
// Draws the signal pane.
// ---------------------------------------------------------------------------
//
-EXPORT_C void CAknSignalPane::Draw( const TRect& aRect ) const
- {
- if ( iExtension->iStatusPane &&
- iExtension->iStatusPane->IsTransparent() )
+EXPORT_C void CAknSignalPane::Draw( const TRect& /*aRect*/ ) const
+ {
+ if ( iExtension->iIsActiveIdle )
{
- CWindowGc& gc = SystemGc();
- TRgb rgb(TRgb::Color16MA(0));
- gc.SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
- gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
- gc.SetBrushColor(rgb);
- gc.Clear(aRect);
return;
}
- // Don't allow normal background drawing if
- // background is already drawn with a background drawer.
- const MCoeControlBackground* backgroundDrawer = FindBackground();
- if ( !backgroundDrawer )
+ if ( AknStatuspaneUtils::StaconPaneActive() )
+ {
+ // Signal pane in STACON PANE layout
+ DrawInStaconPane( Rect() );
+ }
+ else if ( AknStatuspaneUtils::FlatLayoutActive() )
{
- if ( AknStatuspaneUtils::StaconPaneActive() )
- {
- // Signal pane in STACON PANE layout
- DrawInStaconPane( Rect() );
- }
- else if ( AknStatuspaneUtils::FlatLayoutActive() )
- {
- // Signal pane in FLAT STATUSPANE layout
- DrawInFlatStatusPane( Rect() );
- }
- else if ( AknStatuspaneUtils::SmallLayoutActive() )
- {
- // Signal pane in SMALL STATUSPANE layout
- DrawInSmallStatusPane( Rect() );
- }
- else
- {
- // Signal pane in NORMAL STATUSPANE layout
- DrawInNormalStatusPane( Rect() );
- }
+ // Signal pane in FLAT STATUSPANE layout
+ DrawInFlatStatusPane( Rect() );
+ }
+ else if ( AknStatuspaneUtils::SmallLayoutActive() )
+ {
+ // Signal pane in SMALL STATUSPANE layout
+ DrawInSmallStatusPane( Rect() );
+ }
+ else
+ {
+ // Signal pane in NORMAL STATUSPANE layout
+ DrawInNormalStatusPane( Rect() );
}
}
@@ -759,14 +755,19 @@
iSignalIconControl->SetDrawBlank( EFalse );
- if ( aCommonPacketDataIconState != EAknSignalCommonPacketDataIndicatorEstablishingContext )
+ if ( aCommonPacketDataIconState != EAknSignalCommonPacketDataIndicatorEstablishingContext &&
+ iTicker )
{
- StopTicker();
+ iTicker->Cancel();
}
else if ( aCommonPacketDataIconState == EAknSignalCommonPacketDataIndicatorEstablishingContext )
{
- TRAP_IGNORE( StartTickerL( KAknIndicatorAnimationDelay,
- KAknIndicatorAnimationInterval ) );
+ if ( iTicker && !iTicker->IsActive() )
+ {
+ iTicker->Start( KAknIndicatorAnimationDelay,
+ KAknIndicatorAnimationInterval,
+ TCallBack( TickerCallback, this ) );
+ }
}
}
}
@@ -788,14 +789,19 @@
iSignalIconControl->SetDrawBlank( EFalse );
- if ( aEdgeIconState != EAknSignalEdgeIndicatorEstablishingContext )
+ if ( aEdgeIconState != EAknSignalEdgeIndicatorEstablishingContext &&
+ iTicker )
{
- StopTicker();
+ iTicker->Cancel();
}
else if ( aEdgeIconState == EAknSignalEdgeIndicatorEstablishingContext )
{
- TRAP_IGNORE( StartTickerL( KAknIndicatorAnimationDelay,
- KAknIndicatorAnimationInterval ) );
+ if ( iTicker && !iTicker->IsActive() )
+ {
+ iTicker->Start( KAknIndicatorAnimationDelay,
+ KAknIndicatorAnimationInterval,
+ TCallBack( TickerCallback, this ) );
+ }
}
}
}
@@ -817,14 +823,19 @@
iSignalIconControl->SetDrawBlank( EFalse );
- if ( aWcdmaIconState != EAknSignalWcdmaIndicatorEstablishingContext )
+ if ( aWcdmaIconState != EAknSignalWcdmaIndicatorEstablishingContext &&
+ iTicker )
{
- StopTicker();
+ iTicker->Cancel();
}
else if ( aWcdmaIconState == EAknSignalWcdmaIndicatorEstablishingContext )
{
- TRAP_IGNORE( StartTickerL( KAknIndicatorAnimationDelay,
- KAknIndicatorAnimationInterval ) );
+ if ( iTicker && !iTicker->IsActive() )
+ {
+ iTicker->Start( KAknIndicatorAnimationDelay,
+ KAknIndicatorAnimationInterval,
+ TCallBack( TickerCallback, this ) );
+ }
}
}
}
@@ -846,46 +857,23 @@
iSignalIconControl->SetDrawBlank( EFalse );
- if ( aHsdpaIconState != EAknSignalHsdpaIndicatorEstablishingContext )
+ if ( aHsdpaIconState != EAknSignalHsdpaIndicatorEstablishingContext &&
+ iTicker )
{
- StopTicker();
+ iTicker->Cancel();
}
else if ( aHsdpaIconState == EAknSignalHsdpaIndicatorEstablishingContext )
{
- TRAP_IGNORE( StartTickerL( KAknIndicatorAnimationDelay,
- KAknIndicatorAnimationInterval ) );
+ if ( iTicker && !iTicker->IsActive() )
+ {
+ iTicker->Start( KAknIndicatorAnimationDelay,
+ KAknIndicatorAnimationInterval,
+ TCallBack( TickerCallback, this ) );
+ }
}
}
}
-// ---------------------------------------------------------------------------
-// CAknSignalPane::ShowUmaIcon
-// Displays an Uma state icon.
-// ---------------------------------------------------------------------------
-//
-EXPORT_C void CAknSignalPane::ShowUmaIconL(TInt aUmaIconState)
- {
- // State is not changed if illegal value was given.
- if (( aUmaIconState >= EAknSignalUmaIndicatorOff ) &&
- ( aUmaIconState <= EAknSignalUmaIndicatorMultipdp ))
- {
- LoadSignalIconL( aUmaIconState, iSignalIconControl->ColorIndex() );
-
- iSignalIconControl->SetDrawBlank( EFalse );
-
- if ( aUmaIconState != EAknSignalUmaIndicatorEstablishingContext )
- {
- StopTicker();
- }
- else if ( aUmaIconState == EAknSignalUmaIndicatorEstablishingContext )
- {
- StartTickerL( KAknIndicatorAnimationDelay,
- KAknIndicatorAnimationInterval );
- }
- }
-
-
- }
// ---------------------------------------------------------------------------
// CAknSignalPane::ShowCdmaIcon
@@ -907,26 +895,25 @@
// Tick timer is only used when animating.
if ( aCdmaIconState != EAknSignalCdmaIndicatorSending &&
- aCdmaIconState != EAknSignalCdmaIndicatorReceiving )
+ aCdmaIconState != EAknSignalCdmaIndicatorReceiving &&
+ iTicker )
{
- StopTicker();
+ iTicker->Cancel();
}
switch ( aCdmaIconState )
{
case EAknSignalCdmaIndicatorSending:
case EAknSignalCdmaIndicatorReceiving:
- {
if ( iTicker && !iTicker->IsActive() )
{
// restart animation
iExtension->iCdmaAnimationIndex = 0;
- TRAP_IGNORE(
- StartTickerL( KAknIndicatorShortAnimationInterval,
- KAknIndicatorShortAnimationInterval ) );
+ iTicker->Start( KAknIndicatorShortAnimationInterval,
+ KAknIndicatorShortAnimationInterval,
+ TCallBack( TickerCallback, this ) );
}
break;
- }
default:
break;
}
@@ -1083,42 +1070,4 @@
iSignalState = aIconState;
}
-
-// ---------------------------------------------------------------------------
-// CAknSignalPane::StartTickerL
-// Starts the animation timer.
-// ---------------------------------------------------------------------------
-//
-void CAknSignalPane::StartTickerL( TTimeIntervalMicroSeconds32 aDelay,
- TTimeIntervalMicroSeconds32 aInterval )
- {
- if ( !iTicker )
- {
- iTicker = CPeriodic::NewL( CActive::EPriorityLow );
- }
-
- if ( iTicker && !iTicker->IsActive() )
- {
- iTicker->Start( aDelay,
- aInterval,
- TCallBack( TickerCallback, this ) );
- }
- }
-
-
-// ---------------------------------------------------------------------------
-// CAknSignalPane::StopTicker
-// Stops the animation timer.
-// ---------------------------------------------------------------------------
-//
-void CAknSignalPane::StopTicker()
- {
- if ( iTicker )
- {
- iTicker->Cancel();
- delete iTicker;
- iTicker = NULL;
- }
- }
-
// End of File