videofeeds/vcnsscheduleview/src/CVcxNsScheduleSettingsDlTimePage.cpp
changeset 0 96612d01cf9f
equal deleted inserted replaced
-1:000000000000 0:96612d01cf9f
       
     1 /*
       
     2 * Copyright (c) 2007 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 the License "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:    Video on Demand download time setting selection page*
       
    15 */
       
    16 
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDES
       
    21 #include <vcxnsscheduleview.rsg>
       
    22 #include "CVcxNsScheduleSettingsDlTimePage.h"
       
    23 
       
    24 // -----------------------------------------------------------------------------
       
    25 // C++ default constructor
       
    26 // -----------------------------------------------------------------------------
       
    27 //
       
    28 CVcxNsScheduleSettingsDlTimePage::CVcxNsScheduleSettingsDlTimePage(	
       
    29                             TInt aResourceID,
       
    30                             CSelectionItemList* aItemArray)
       
    31     : CAknCheckBoxSettingPage( aResourceID, aItemArray ),
       
    32       iItemArray( *aItemArray )
       
    33 	{
       
    34 	}
       
    35 
       
    36 // -----------------------------------------------------------------------------
       
    37 // Destructor
       
    38 // -----------------------------------------------------------------------------
       
    39 //
       
    40 CVcxNsScheduleSettingsDlTimePage::~CVcxNsScheduleSettingsDlTimePage()
       
    41 	{
       
    42 	}
       
    43 
       
    44 // ---------------------------------------------------------
       
    45 // CVcxNsScheduleSettingsDlTimePage::OfferKeyEventL
       
    46 // ---------------------------------------------------------
       
    47 //
       
    48 TKeyResponse CVcxNsScheduleSettingsDlTimePage::OfferKeyEventL( 
       
    49         const TKeyEvent& aKeyEvent, 
       
    50         TEventCode aType )
       
    51     {
       
    52     
       
    53     TInt oldInd = ListBoxControl()->CurrentItemIndex();
       
    54     
       
    55     // Offer event to base class
       
    56     TKeyResponse retVal = CAknCheckBoxSettingPage::OfferKeyEventL( aKeyEvent,
       
    57                                                                    aType );
       
    58     // Get new index
       
    59     TInt curInd = ListBoxControl()->CurrentItemIndex();
       
    60     if ( curInd != oldInd )
       
    61         {
       
    62         SetCbaL();
       
    63         }
       
    64     return retVal;
       
    65     }
       
    66     
       
    67 // ---------------------------------------------------------
       
    68 // CVcxNsScheduleSettingsDlTimePage::SetCbaL
       
    69 // ---------------------------------------------------------
       
    70 //
       
    71 void CVcxNsScheduleSettingsDlTimePage::SetCbaL()
       
    72     {
       
    73     TInt resId;
       
    74         
       
    75     if ( ListBoxControl() && Cba() )
       
    76         {
       
    77         TInt curSel = ListBoxControl()->CurrentItemIndex();
       
    78         if ( curSel >= 0 && curSel < iItemArray.Count() )
       
    79             {
       
    80             if ( iItemArray.At( curSel )->SelectionStatus() )
       
    81                 {
       
    82                 resId = R_VCXNS_SCHEDULE_SCHEDULESETTINGSVIEW_SOFTKEYS_UNMARK_DONE;
       
    83                 }
       
    84             else
       
    85                 {
       
    86                 resId = R_VCXNS_SCHEDULE_SCHEDULESETTINGSVIEW_SOFTKEYS_MARK_DONE;
       
    87                 }
       
    88 
       
    89             Cba()->SetCommandSetL( resId );
       
    90             Cba()->DrawDeferred();
       
    91             }
       
    92         }
       
    93     }