systemsettings/GSAccessoryPlugin/src/gsacctextphonecontainer.cpp
changeset 0 2e3d3ce01487
equal deleted inserted replaced
-1:000000000000 0:2e3d3ce01487
       
     1 /*
       
     2 * Copyright (c) 2005-2008 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:  Implementation of CGSAccTextPhoneContainer class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <e32cmn.h> // For accessoriescrkeys.h
       
    20 #include <accessoriescrkeys.h>
       
    21 #include <gsaccessoryplugin.rsg>
       
    22 #include <gsfwviewuids.h> // for KUidGS
       
    23 #include <gslistbox.h>
       
    24 #include <csxhelp/cp.hlp.hrh>
       
    25 
       
    26 #include "gsaccessoryplugin.hrh"
       
    27 #include "gsaccessorypluginmodel.h"
       
    28 #include "gsaccprofilelist.h"
       
    29 #include "gsacctextphonecontainer.h"
       
    30 #include "trace.h"
       
    31 
       
    32 // ========================= MEMBER FUNCTIONS ================================
       
    33 
       
    34 // ---------------------------------------------------------------------------
       
    35 // CGSAccTextPhoneContainer::CGSAccTextPhoneContainer()
       
    36 // ---------------------------------------------------------------------------
       
    37 //
       
    38 CGSAccTextPhoneContainer::CGSAccTextPhoneContainer(
       
    39     CGSAccessoryPluginModel& aModel )
       
    40   : CGSAccBaseContainer( aModel )
       
    41     {
       
    42     FUNC_LOG;
       
    43     }
       
    44 
       
    45 
       
    46 // ---------------------------------------------------------------------------
       
    47 // CGSAccTextPhoneContainer::~CGSAccTextPhoneContainer()
       
    48 // ---------------------------------------------------------------------------
       
    49 //
       
    50 CGSAccTextPhoneContainer::~CGSAccTextPhoneContainer()
       
    51     {
       
    52     FUNC_LOG;
       
    53     }
       
    54 
       
    55 
       
    56 // ---------------------------------------------------------------------------
       
    57 // CGSAccTextPhoneContainer::UpdateListBoxL()
       
    58 // ---------------------------------------------------------------------------
       
    59 //
       
    60 void CGSAccTextPhoneContainer::UpdateListBoxL( TInt aFeatureId )
       
    61     {
       
    62     FUNC_LOG;
       
    63 
       
    64     if ( aFeatureId == KGSSettIdTextPhoneDP )
       
    65         {
       
    66         RefreshDefaultProfileL();
       
    67         }
       
    68 
       
    69     iListBox->HandleItemAdditionL();
       
    70     }
       
    71 
       
    72 
       
    73 // ---------------------------------------------------------------------------
       
    74 // CGSAccTextPhoneContainer::ConstructL()
       
    75 // ---------------------------------------------------------------------------
       
    76 //
       
    77 void CGSAccTextPhoneContainer::ConstructL( const TRect& aRect )
       
    78     {
       
    79     FUNC_LOG;
       
    80 
       
    81     CreateListBoxL();
       
    82     BaseConstructL( aRect, R_ACC_TTY_TITLE, R_ACC_TTY_LBX ); // Needs the listbox
       
    83     }
       
    84 
       
    85 
       
    86 // ---------------------------------------------------------------------------
       
    87 // CGSAccTextPhoneContainer::ConstructListBoxL()
       
    88 // ---------------------------------------------------------------------------
       
    89 //
       
    90 void CGSAccTextPhoneContainer::ConstructListBoxL( TInt aResLbxId )
       
    91     {
       
    92     FUNC_LOG;
       
    93 
       
    94     CGSAccBaseContainer::ConstructListBoxL( aResLbxId );
       
    95 
       
    96     RefreshDefaultProfileL();
       
    97     MakeItemVisibleL( KGSSettIdTextPhoneDP );
       
    98     }
       
    99 
       
   100 
       
   101 // ---------------------------------------------------------------------------
       
   102 // CGSAccTextPhoneContainer::GetHelpContext() const
       
   103 // ---------------------------------------------------------------------------
       
   104 //
       
   105 void CGSAccTextPhoneContainer::GetHelpContext(
       
   106     TCoeHelpContext& aContext ) const
       
   107     {
       
   108     FUNC_LOG;
       
   109 
       
   110     aContext.iMajor = KUidGS;
       
   111     aContext.iContext = KSET_HLP_ACCESSORIES_TTY;
       
   112     }
       
   113 
       
   114 
       
   115 // ---------------------------------------------------------------------------
       
   116 // CGSAccTextPhoneContainer::RefreshDefaultProfileL()
       
   117 // ---------------------------------------------------------------------------
       
   118 //
       
   119 void CGSAccTextPhoneContainer::RefreshDefaultProfileL()
       
   120     {
       
   121     FUNC_LOG;
       
   122 
       
   123     TInt profile =
       
   124         iModel.DefaultProfileByKey( KSettingsTTYDefaultProfile );
       
   125     // Set default profile item text.
       
   126     SetItemTextL(
       
   127         KGSSettIdTextPhoneDP,
       
   128         iModel.ProfileList().NameByIdL( profile, iCoeEnv ) );
       
   129     }