sipplugins/sippsipsettingsui/src/SipSettIntegerEditItem.cpp
changeset 0 307788aac0a8
child 20 a7d1e54a7332
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2005 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:  SIP Settings view controller
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include    <gssipsettingspluginrsc.rsg>
       
    21 #include    "SipSettIntegerEditItem.h"
       
    22 #include    "sipsettlistsipsrvtextsetitem.h"
       
    23 #include    "sipsettlistsipsrvtextsetpage.h"
       
    24 #include    "tgssipvalidatorwrapper.h"
       
    25 #include    "SIPSettIntegerSetPage.h"
       
    26 #include    "tgssipserverdata.h"
       
    27 #include    "gssippluginlogger.h"
       
    28 
       
    29 const TInt KPortMaxLen = 5;
       
    30 _LIT16(NULLString, " ");
       
    31 
       
    32 // -----------------------------------------------------------------------------
       
    33 // CSipSettIntegerEditItem::CSipSettIntegerEditItem
       
    34 //constructor
       
    35 // -----------------------------------------------------------------------------
       
    36 //
       
    37 CSipSettIntegerEditItem::CSipSettIntegerEditItem(
       
    38     TInt aIdentifier, TDes & aInteger):
       
    39     CAknTextSettingItem( aIdentifier, aInteger )
       
    40     {
       
    41     __GSLOGSTRING("CSipSettIntegerEditItem::CSipSettIntegerEditItem" )   
       
    42     
       
    43     TInt value = -1;
       
    44     TLex lex;
       
    45     lex.Assign(aInteger.Ptr());
       
    46     lex.Val(value);
       
    47     iValue = value;
       
    48     
       
    49  
       
    50     
       
    51     }
       
    52 
       
    53 // Destructor
       
    54     CSipSettIntegerEditItem::~CSipSettIntegerEditItem()
       
    55     {    
       
    56     __GSLOGSTRING("CSipSettIntegerEditItem::~CSipSettIntegerEditItem" )
       
    57     }
       
    58 
       
    59 // -----------------------------------------------------------------------------
       
    60 // CSipSettIntegerEditItem::EditItemL
       
    61 // (other items were commented in a header).
       
    62 // -----------------------------------------------------------------------------
       
    63 //
       
    64 void CSipSettIntegerEditItem::EditItemL( TBool /*aCalledFromMenu*/ )
       
    65     {  
       
    66     __GSLOGSTRING("CSipSettIntegerEditItem::EditItemL" )
       
    67         TInt id = SettingPageResourceId();    
       
    68       
       
    69         
       
    70         CSIPSettIntegerSetPage* page = 
       
    71             new( ELeave )CSIPSettIntegerSetPage( 
       
    72                 id,  
       
    73                 iValue, 
       
    74                 CAknIntegerSettingPage::EEmptyValueAllowed );
       
    75         page->SetMaximumWidth( KPortMaxLen );
       
    76         CleanupStack::PushL( page );
       
    77         page->ConstructL();
       
    78         CleanupStack::Pop( page );
       
    79 
       
    80         // Execute the setting page
       
    81         SetSettingPage( page );
       
    82         page->ExecuteLD();
       
    83         SetSettingPage( NULL );
       
    84         if( iValue == -1 )
       
    85         	{
       
    86         	InternalTextPtr().Copy( NULLString );
       
    87         	}
       
    88         else
       
    89         	{
       
    90         	TBuf<KMaxServerPortLength> ValueString;
       
    91         	ValueString.AppendNum( iValue );
       
    92         	InternalTextPtr().Copy( ValueString );
       
    93         	}
       
    94         	
       
    95         // Update text on this side as well
       
    96         UpdateListBoxTextL();  
       
    97     }
       
    98 
       
    99 //  End of File