systemsettings/GSAccessoryPlugin/src/gsacctextphoneview.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:  Declaration of CGSAccTextPhoneView class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <e32cmn.h> // For accessoriescrkeys.h
       
    20 #include <accessoriescrkeys.h>
       
    21 #include <gsaccessoryplugin.rsg>
       
    22 #include <gscommon.hrh>
       
    23 
       
    24 #include "acclocalviewids.h"
       
    25 #include "gsaccessoryplugin.hrh"
       
    26 #include "gsacctextphonecontainer.h"
       
    27 #include "gsacctextphoneview.h"
       
    28 #include "trace.h"
       
    29 
       
    30 // ========================= MEMBER FUNCTIONS ================================
       
    31 
       
    32 // ---------------------------------------------------------------------------
       
    33 // CGSAccTextPhoneView::NewLC()
       
    34 // ---------------------------------------------------------------------------
       
    35 //
       
    36 CGSAccTextPhoneView* CGSAccTextPhoneView::NewLC(
       
    37     CGSAccessoryPluginModel& aModel )
       
    38     {
       
    39     CGSAccTextPhoneView* self = new ( ELeave ) CGSAccTextPhoneView( aModel );
       
    40     CleanupStack::PushL( self );
       
    41     self->ConstructL();
       
    42     return self;
       
    43     }
       
    44 
       
    45 
       
    46 // ---------------------------------------------------------------------------
       
    47 // CGSAccTextPhoneView::~CGSAccTextPhoneView()
       
    48 // ---------------------------------------------------------------------------
       
    49 //
       
    50 CGSAccTextPhoneView::~CGSAccTextPhoneView()
       
    51     {
       
    52     FUNC_LOG;
       
    53     }
       
    54 
       
    55 
       
    56 // ---------------------------------------------------------------------------
       
    57 // TUid CGSAccTextPhoneView::Id()
       
    58 // ---------------------------------------------------------------------------
       
    59 //
       
    60 TUid CGSAccTextPhoneView::Id() const
       
    61     {
       
    62     return KAccTextPhoneViewId;
       
    63     }
       
    64 
       
    65 
       
    66 // ---------------------------------------------------------------------------
       
    67 // CGSAccTextPhoneView::HandleCommandL()
       
    68 // ---------------------------------------------------------------------------
       
    69 //
       
    70 void CGSAccTextPhoneView::HandleCommandL( TInt aCommand )
       
    71     {
       
    72     FUNC_LOG;
       
    73 
       
    74     switch ( aCommand )
       
    75         {
       
    76         case EGSCmdAppChange:
       
    77             {
       
    78             // Act as user had pressed the selection key
       
    79             HandleListBoxSelectionL( iContainer->CurrentFeatureId() );
       
    80             break;
       
    81             }
       
    82         default:
       
    83             CGSAccBaseView::HandleCommandL( aCommand );
       
    84             break;
       
    85         }
       
    86     }
       
    87 
       
    88 
       
    89 // ---------------------------------------------------------------------------
       
    90 // CGSAccTextPhoneView::NewContainerL()
       
    91 // ---------------------------------------------------------------------------
       
    92 //
       
    93 void CGSAccTextPhoneView::NewContainerL()
       
    94     {
       
    95     FUNC_LOG;
       
    96 
       
    97     // Base class owns the container.
       
    98     iContainer = new ( ELeave ) CGSAccTextPhoneContainer( iModel );
       
    99     }
       
   100 
       
   101 
       
   102 // ---------------------------------------------------------------------------
       
   103 // CGSAccTextPhoneView::HandleListBoxSelectionL()
       
   104 // ---------------------------------------------------------------------------
       
   105 //
       
   106 void CGSAccTextPhoneView::HandleListBoxSelectionL( TInt aSelectedItem )
       
   107     {
       
   108     FUNC_LOG;
       
   109 
       
   110     // User has pressed selection key. If the selected item has just two
       
   111     // possible values, flip the value to the other option. If the item has
       
   112     // more possible values, show a selection dialog.
       
   113     if ( aSelectedItem == KGSSettIdTextPhoneDP )
       
   114         {
       
   115         ChangeDefaultProfileL(
       
   116             KSettingsTTYDefaultProfile, KGSSettIdTextPhoneDP );
       
   117         }
       
   118     }
       
   119 
       
   120 
       
   121 // ---------------------------------------------------------------------------
       
   122 // CGSAccTextPhoneView::CGSAccTextPhoneView()
       
   123 // ---------------------------------------------------------------------------
       
   124 //
       
   125 CGSAccTextPhoneView::CGSAccTextPhoneView( CGSAccessoryPluginModel& aModel )
       
   126   : CGSAccBaseView( aModel )
       
   127     {
       
   128     FUNC_LOG;
       
   129     }
       
   130 
       
   131 
       
   132 // ---------------------------------------------------------------------------
       
   133 // CGSAccTextPhoneView::ConstructL()
       
   134 // ---------------------------------------------------------------------------
       
   135 //
       
   136 void CGSAccTextPhoneView::ConstructL()
       
   137     {
       
   138     FUNC_LOG;
       
   139 
       
   140     BaseConstructL( R_ACC_TTY_VIEW );
       
   141     }