uifw/AvKon/src/akndigitalclock.cpp
branchRCL_3
changeset 19 aecbbf00d063
parent 10 3d340a0166ff
child 20 d48ab3b357f1
--- a/uifw/AvKon/src/akndigitalclock.cpp	Thu Aug 19 10:11:06 2010 +0300
+++ b/uifw/AvKon/src/akndigitalclock.cpp	Tue Aug 31 15:28:30 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-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"
@@ -323,9 +323,7 @@
 
         TRect rect( Rect() );
 
-        const MCoeControlBackground* backgroundDrawer = FindBackground();
-        if ( !backgroundDrawer &&
-             iFlags & EAknDigitalClockInStatusPane )
+        if ( iFlags & EAknDigitalClockInStatusPane )
             {
             MAknsSkinInstance* skin = AknsUtils::SkinInstance();
             MAknsControlContext* cc = AknsDrawUtils::ControlContext( this );
@@ -355,110 +353,72 @@
 
 // -----------------------------------------------------------------------------
 // CAknDigitalClock::HandlePointerEventL
-// Opens the universal indicator popup upon tap.
+// Starts clock application in down event.
 // -----------------------------------------------------------------------------
 //
 void CAknDigitalClock::HandlePointerEventL( const TPointerEvent& aPointerEvent )
     {
-    CAknControl::HandlePointerEventL( aPointerEvent );
-
-    // Do nothing if dimmed.
-    if ( IsDimmed() || Window().IsFaded() )
-        {
-        return;
-        }
-
-    TRect rect( Rect() );
+    CAknControl:: HandlePointerEventL( aPointerEvent );
 
-    // Currently the small digital clock pane, universal
-    // indicator pane and battery pane (in status pane layouts
-    // where it's adjacent to universal indicator or digital
-    // clock pane) are regarded as one touch responsive
-    // area from which the universal indicator popup should
-    // open on tap, so upon pointer up event it must be checked
-    // here if the down event happened inside this control,
-    // but the up event inside battery or indicator pane area.
-    TBool pointerUpInIndicatorArea( EFalse );
-    TBool pointerUpInBatteryArea( EFalse );
-
-    if ( iFlags & EAknDigitalClockInStatusPane &&
-         aPointerEvent.iType == TPointerEvent::EButton1Up )
+    if ( AknLayoutUtils::PenEnabled() )
         {
-        CEikStatusPaneBase* sp = CEikStatusPaneBase::Current();
-
-        if ( sp )
+        // Do nothing if dimmed.
+        if ( IsDimmed() ||
+             Window().IsFaded() )
             {
-            CCoeControl* indicatorPane = sp->ContainerControlL(
-                TUid::Uid( EEikStatusPaneUidIndic ) );
-            if ( indicatorPane )
+            return;
+            }
+
+        TRect rect( Rect() );
+
+        // Currently the small digital clock pane and universal
+        // indicator pane are regarded as one touch responsive area from
+        // which the universal indicator popup should open on tap,
+        // so upon pointer up event it must be checked here if
+        // the down event happened inside this control, but the up event
+        // inside indicator pane area.
+        TRect indicatorRect( 0, 0, 0, 0 );
+
+        if ( iFlags & EAknDigitalClockInStatusPane &&
+             aPointerEvent.iType == TPointerEvent::EButton1Up )
+            {
+            CEikStatusPaneBase* sp = CEikStatusPaneBase::Current();
+
+            if ( sp )
                 {
-                TRect indicatorRect( indicatorPane->PositionRelativeToScreen(),
-                                     indicatorPane->Size() );
-                pointerUpInIndicatorArea =
-                    indicatorRect.Contains( aPointerEvent.iParentPosition );
-                }
-            
-            if ( !AknStatuspaneUtils::ExtendedFlatLayoutActive() )
-                {
-                CCoeControl* batteryPane = sp->ContainerControlL(
-                    TUid::Uid( EEikStatusPaneUidBattery ) );
-                if ( batteryPane )
+                CCoeControl* indicatorPane = sp->ContainerControlL(
+                    TUid::Uid( EEikStatusPaneUidIndic ) );
+                if ( indicatorPane )
                     {
-                    TRect batteryRect( batteryPane->PositionRelativeToScreen(),
-                                       batteryPane->Size() );
-                    pointerUpInBatteryArea =
-                        batteryRect.Contains( aPointerEvent.iParentPosition );
+                    indicatorRect =
+                        TRect( indicatorPane->PositionRelativeToScreen(),
+                               indicatorPane->Size() );
                     }
                 }
             }
-        }
 
-    if ( aPointerEvent.iType == TPointerEvent::EButton1Down &&
-         rect.Contains( aPointerEvent.iPosition ) )
-        {
-        // Set flag that down event was inside the clock.
-        iFlags |= EAknDigitalClockButton1DownReceived;
-
-        // tactile feedback is done with SetFeedbackArea
-        }
-    else if ( aPointerEvent.iType == TPointerEvent::EButton1Up &&
-              ( ( iFlags & EAknDigitalClockButton1DownReceived &&
-                  rect.Contains( aPointerEvent.iPosition ) ) ||
-                pointerUpInIndicatorArea ||
-                pointerUpInBatteryArea ) )
-        {
-        if ( pointerUpInIndicatorArea || pointerUpInBatteryArea )
+        if ( aPointerEvent.iType == TPointerEvent::EButton1Down &&
+             rect.Contains( aPointerEvent.iPosition ) )
             {
-            MTouchFeedback* feedback = MTouchFeedback::Instance();
-            if ( feedback )
-                {
-                // The pointer down was received in another control,
-                // so the tactile feedback must be given directly.
-                feedback->InstantFeedback( this,
-                                           ETouchFeedbackSensitiveButton,
-                                           ETouchFeedbackVibra,
-                                           aPointerEvent );
-                }
+            // Set flag that down event was inside the clock.
+            iFlags |= EAknDigitalClockButton1DownReceived;
+
+            // tactile feedback is done with SetFeedbackArea
             }
-    
-        // Launch the universal indicator popup.
-        CAknSmallIndicator* indicatorNotifier =
-            CAknSmallIndicator::NewLC( TUid::Uid( 0 ) );
-        indicatorNotifier->HandleIndicatorTapL();
-        //for indicator popup event
-        MTouchFeedback* feedback = MTouchFeedback::Instance();
-        if ( feedback )
+        else if ( aPointerEvent.iType == TPointerEvent::EButton1Up &&
+                  ( ( iFlags & EAknDigitalClockButton1DownReceived &&
+                      rect.Contains( aPointerEvent.iPosition ) ) ||
+                    ( indicatorRect.Contains( aPointerEvent.iParentPosition ) ) ) )
             {
-            feedback->InstantFeedback(
-                               this,
-                               ETouchFeedbackPopUp,
-                               ETouchFeedbackVibra,
-                               aPointerEvent );
+            // Launch the universal indicator popup.
+            CAknSmallIndicator* indicatorNotifier =
+                CAknSmallIndicator::NewLC( TUid::Uid( 0 ) );
+            indicatorNotifier->HandleIndicatorTapL();
+            CleanupStack::PopAndDestroy( indicatorNotifier );
+
+            // Up event received, reset button down flag.
+            iFlags &= ( ~EAknDigitalClockButton1DownReceived );
             }
-        CleanupStack::PopAndDestroy( indicatorNotifier );
-
-        // Up event received, reset button down flag.
-        iFlags &= ( ~EAknDigitalClockButton1DownReceived );
         }
     }