vtuis/videotelui/src/features/zoom/cvtuizoom.cpp
changeset 18 d9b6a8729acd
parent 4 6dc066157ed4
child 23 c378a0498b84
child 27 dcbddbbaf8fd
equal deleted inserted replaced
4:6dc066157ed4 18:d9b6a8729acd
     1 /*
       
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Zoom feature implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <cvtlogger.h>
       
    20 #include "cvtuizoom.h"
       
    21 #include "tvtuifeatureids.h"
       
    22 #include "cvtuizoompopup.h"
       
    23 #include "cvtuifeaturemanager.h"
       
    24 #include "tvtuistates.h"
       
    25 
       
    26 // ---------------------------------------------------------------------------
       
    27 // CVtUiZoom::NewL
       
    28 // ---------------------------------------------------------------------------
       
    29 //
       
    30 CVtUiZoom* CVtUiZoom::NewL( CVtUiFeatureManager&
       
    31     aFeatureManager )
       
    32     {
       
    33     __VTPRINTENTER( "CVtUiZoom.NewL" )
       
    34     CVtUiZoom* self =
       
    35         new ( ELeave ) CVtUiZoom( aFeatureManager );
       
    36     CleanupStack::PushL( self );
       
    37     self->ConstructL();
       
    38     CleanupStack::Pop();
       
    39     __VTPRINTEXIT( "CVtUiZoom.NewL" )
       
    40     return self;
       
    41     }
       
    42 
       
    43 // ---------------------------------------------------------------------------
       
    44 // CVtUiZoom::~CVtUiZoom
       
    45 // ---------------------------------------------------------------------------
       
    46 //
       
    47 CVtUiZoom::~CVtUiZoom()
       
    48     {
       
    49     __VTPRINTENTER( "CVtUiZoom.~" )
       
    50     __VTPRINTEXIT( "CVtUiZoom.~" )
       
    51     }
       
    52 
       
    53 // ---------------------------------------------------------------------------
       
    54 // CVtUiZoom::RefreshL
       
    55 // ---------------------------------------------------------------------------
       
    56 //
       
    57 void CVtUiZoom::RefreshL()
       
    58     {
       
    59     __VTPRINTENTER( "CVtUiZoom.RefreshL" )
       
    60     if ( State() == EActive )
       
    61         {
       
    62         static_cast< CVtUiZoomPopup& >( Popup() ).RefreshL();
       
    63         }
       
    64     __VTPRINTEXIT( "CVtUiZoom.RefreshL" )
       
    65     }
       
    66 
       
    67 // ---------------------------------------------------------------------------
       
    68 // CVtUiZoom::StartL
       
    69 // ---------------------------------------------------------------------------
       
    70 //
       
    71 void CVtUiZoom::StartL()
       
    72     {
       
    73     __VTPRINTENTER( "CVtUiZoom.StartL" )
       
    74     if ( State() == EActive )
       
    75         {
       
    76         // need to refresh when already active to replenish the close timer
       
    77         RefreshL();
       
    78         }
       
    79     else
       
    80         {
       
    81         iFeatureManager.UiStates().SetIsFloatingToolbarVisible( ETrue );
       
    82         CVtUiSliderBase::StartL();
       
    83         iFeatureManager.UiStates().SetZoomModeOn( ETrue );
       
    84         }
       
    85     __VTPRINTEXIT( "CVtUiZoom.StartL" )
       
    86     }
       
    87 
       
    88 // ---------------------------------------------------------------------------
       
    89 // CVtUiZoom::Stop
       
    90 // ---------------------------------------------------------------------------
       
    91 //
       
    92 void CVtUiZoom::Stop()
       
    93     {
       
    94     __VTPRINTENTER( "CVtUiZoom.Stop" )
       
    95     iFeatureManager.UiStates().SetZoomModeOn( EFalse );
       
    96     CVtUiSliderBase::Stop();
       
    97     __VTPRINTEXIT( "CVtUiZoom.Stop" )
       
    98     }
       
    99 
       
   100 // ---------------------------------------------------------------------------
       
   101 // CVtUiZoom::ComponenStateChangedL()
       
   102 // ---------------------------------------------------------------------------
       
   103 //
       
   104 void CVtUiZoom::ComponenStateChangedL()
       
   105     {
       
   106     __VTPRINTENTER( "CVtUiZoom.ComponenStateChangedL()" )
       
   107     // Close event received stop the feature
       
   108     // If this was a block event then do not stop the feature
       
   109     // Currently we can't separate block and stop events from component manager
       
   110     if ( !iFeatureManager.UiStates().IsCaptureModeOn() )
       
   111         {
       
   112        __VTPRINT( DEBUG_GEN, "CVtUiZoom.ComponenStateChangedL.Stop" )
       
   113         Stop();
       
   114         }
       
   115     __VTPRINTEXIT( "CVtUiZoom.ComponenStateChangedL()" )
       
   116     }
       
   117 
       
   118 // ---------------------------------------------------------------------------
       
   119 // CVtUiZoom::CVtUiZoom
       
   120 // ---------------------------------------------------------------------------
       
   121 //
       
   122 CVtUiZoom::CVtUiZoom( CVtUiFeatureManager& aFeatureManager )
       
   123     : CVtUiSliderBase( aFeatureManager, EVtUiFeatureIdZoom )
       
   124     {
       
   125     __VTPRINTENTER( "CVtUiZoom.CVtUiZoom" )
       
   126     __VTPRINTEXIT( "CVtUiZoom.CVtUiZoom" )
       
   127     }
       
   128 
       
   129 // ---------------------------------------------------------------------------
       
   130 // CVtUiZoom::CVtUiZoom
       
   131 // ---------------------------------------------------------------------------
       
   132 //
       
   133 void CVtUiZoom::ConstructL()
       
   134     {
       
   135     __VTPRINTENTER( "CVtUiZoom.ConstructL" )
       
   136     BaseConstructL();
       
   137     SetPopup( CVtUiZoomPopup::NewL( iFeatureManager ) );
       
   138     __VTPRINTEXIT( "CVtUiZoom.ConstructL" )
       
   139     }