bluetoothengine/bthid/bthidkbdsettings/src/btkeysettinglist.cpp
branchRCL_3
changeset 56 9386f31cc85b
parent 0 f63038272f30
equal deleted inserted replaced
55:613943a21004 56:9386f31cc85b
       
     1 /*
       
     2 * Copyright (c) 2004 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:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "bthidsettingview.h"
       
    20 #include "bthidsettings.h"
       
    21 #include "bthidsettinglist.h"
       
    22 #include "btkeyenumtextsettingitem.h"
       
    23 #include "btkeyboard.hrh"
       
    24 
       
    25 //-----------------------------------------------------------------------------
       
    26 // CBTKeySettingList::CBTKeySettingList
       
    27 //-----------------------------------------------------------------------------
       
    28 //
       
    29 CBTKeySettingList::CBTKeySettingList(CBtHidSettings& aSettings, CBtHidSettingView* aBtHidSettingView):
       
    30     CAknSettingItemList(), iSettings(aSettings), iBtHidSettingView(aBtHidSettingView)
       
    31     {
       
    32     }
       
    33 
       
    34 //-----------------------------------------------------------------------------
       
    35 // CBTKeySettingList::CreateSettingItemL
       
    36 //-----------------------------------------------------------------------------
       
    37 //
       
    38 CAknSettingItem* CBTKeySettingList::CreateSettingItemL( TInt aIdentifier )
       
    39     {
       
    40     CAknSettingItem* settingItem = 0;
       
    41     switch ( aIdentifier )
       
    42         {
       
    43         case EBTKeySettingLayout:
       
    44             iLayoutCode = iSettings.LoadLayoutSetting();
       
    45             settingItem = new (ELeave) CBTKeyEnumTextSettingItem(
       
    46                                             aIdentifier, iLayoutCode, iSettings, iBtHidSettingView);
       
    47             break;      
       
    48         default:
       
    49             break;
       
    50         }
       
    51 
       
    52     return settingItem;
       
    53     }
       
    54 
       
    55 //-----------------------------------------------------------------------------
       
    56 // CBTKeySettingList::HandleListBoxEventL
       
    57 //-----------------------------------------------------------------------------
       
    58 //
       
    59 void CBTKeySettingList::HandleListBoxEventL(
       
    60             CEikListBox* aListBox, TListBoxEvent aEventType)
       
    61     {
       
    62         // call the base classes handler to handle this event.
       
    63     CAknSettingItemList::HandleListBoxEventL(aListBox, aEventType);
       
    64     
       
    65     // store the values from all setting items to their external variables
       
    66     StoreSettingsL();
       
    67     }
       
    68 
       
    69 //-----------------------------------------------------------------------------
       
    70 // CBTKeySettingList::SizeChanged
       
    71 //-----------------------------------------------------------------------------
       
    72 //
       
    73 void CBTKeySettingList::SizeChanged()
       
    74     {
       
    75     if ( ListBox() ) 
       
    76         {
       
    77         ListBox()->SetRect(Rect());
       
    78         }
       
    79     }
       
    80 
       
    81 //-----------------------------------------------------------------------------
       
    82 // CBTKeySettingList::EditCurrentItemL
       
    83 //-----------------------------------------------------------------------------
       
    84 //
       
    85 void CBTKeySettingList::EditCurrentItemL( TInt aCommand )
       
    86     {
       
    87     if ( ListBox() )
       
    88         {
       
    89         TInt index = ListBox()->CurrentItemIndex();
       
    90         EditItemL(index, EBTKeyCmdAppChange == aCommand);
       
    91         StoreSettingsL();        
       
    92         }
       
    93     }    
       
    94 //End of file