sipplugins/sippsipsettingsui/src/sipsettlistsipprxsetview.cpp
changeset 0 307788aac0a8
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:  The proxy view controller
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 
       
    21 #include    "sipsettlistsipprxsetview.h"
       
    22 #include    "mgssipprofilehandler.h"
       
    23 #include    "sipsettlistsipsrvsetmodel.h"
       
    24 #include    "viewid.h"
       
    25 #include    <aknViewAppUi.h>
       
    26 #include    <gssipsettingspluginrsc.rsg> //GUI Resource
       
    27 #include    "gssippluginlogger.h"
       
    28 
       
    29 // ============================ MEMBER FUNCTIONS ===============================
       
    30 
       
    31 // -----------------------------------------------------------------------------
       
    32 // CSIPSettListSIPPrxSetView::CSIPSettListSIPPrxSetView
       
    33 // C++ default constructor can NOT contain any code, that
       
    34 // might leave.
       
    35 // -----------------------------------------------------------------------------
       
    36 //
       
    37 CSIPSettListSIPPrxSetView::CSIPSettListSIPPrxSetView( 
       
    38 	MGSSIPProfileHandler* aHandler )
       
    39     : CSIPSettListSIPSrvSetView( R_QTN_PROXY_TITLE_PANE_LABEL ),
       
    40     iHandler( aHandler )
       
    41     {
       
    42     __GSLOGSTRING("CSIPSettListSIPPrxSetView::CSIPSettListSIPPrxSetView" )
       
    43     }
       
    44 
       
    45 // -----------------------------------------------------------------------------
       
    46 // CSIPSettListSIPPrxSetView::ConstructL
       
    47 // Symbian 2nd phase constructor can leave.
       
    48 // -----------------------------------------------------------------------------
       
    49 //
       
    50 void CSIPSettListSIPPrxSetView::ConstructL()
       
    51     {
       
    52     __GSLOGSTRING("CSIPSettListSIPPrxSetView::ConstructL" )
       
    53     BaseConstructL( R_GS_SIP_SERVER_SETTING_VIEW );    
       
    54     }
       
    55 
       
    56 // -----------------------------------------------------------------------------
       
    57 // CSIPSettListSIPPrxSetView::NewLC
       
    58 // Two-phased constructor.
       
    59 // -----------------------------------------------------------------------------
       
    60 //
       
    61 CSIPSettListSIPPrxSetView* CSIPSettListSIPPrxSetView::NewLC( 
       
    62     MGSSIPProfileHandler* aHandler )
       
    63     {
       
    64     __GSLOGSTRING("CSIPSettListSIPPrxSetView::NewLC" )
       
    65     CSIPSettListSIPPrxSetView* self = 
       
    66         new ( ELeave ) CSIPSettListSIPPrxSetView( aHandler );
       
    67     
       
    68     CleanupStack::PushL( self );
       
    69     self->ConstructL();    
       
    70 
       
    71     return self;
       
    72     }
       
    73     
       
    74 // Destructor
       
    75 CSIPSettListSIPPrxSetView::~CSIPSettListSIPPrxSetView()
       
    76     {
       
    77     __GSLOGSTRING("CSIPSettListSIPPrxSetView::~CSIPSettListSIPPrxSetView" )
       
    78     }
       
    79 
       
    80 // -----------------------------------------------------------------------------
       
    81 // CSIPSettListSIPPrxSetView::Id
       
    82 // Returns the UID of the view
       
    83 // -----------------------------------------------------------------------------
       
    84 //
       
    85 TUid CSIPSettListSIPPrxSetView::Id() const
       
    86     {    
       
    87     return KSettListSIPProxyServerView;
       
    88     }
       
    89 
       
    90 // -----------------------------------------------------------------------------
       
    91 // CSIPSettListSIPPrxSetView::DataStruct
       
    92 // Returns the used data structure
       
    93 // -----------------------------------------------------------------------------
       
    94 //
       
    95 TGSSIPServerData* CSIPSettListSIPPrxSetView::DataStruct()
       
    96     {        
       
    97     return &( iHandler->ProfileData()->iProxy );
       
    98     }
       
    99 
       
   100 // -----------------------------------------------------------------------------
       
   101 // CSIPSettListSIPPrxSetView::DataStruct
       
   102 // Returns the used data structure
       
   103 // -----------------------------------------------------------------------------
       
   104 //
       
   105 TInt CSIPSettListSIPPrxSetView::ResourceID()
       
   106     {
       
   107     return R_SIP_PROXY_SETTING_VIEW_ITEM_LIST;
       
   108     }
       
   109 
       
   110 // -----------------------------------------------------------------------------
       
   111 // CGSSettListSIPPrxSetView::ProfileType
       
   112 // Returns the used profile type
       
   113 // -----------------------------------------------------------------------------
       
   114 //
       
   115 TSIPProfileTypeInfo::TSIPProfileClass CSIPSettListSIPPrxSetView::ProfileType()
       
   116     {    
       
   117     const TSIPSettingsData* data = iHandler->ProfileData();
       
   118     // Set loose routing to be always off
       
   119     return data->iServiceProfile.iSIPProfileClass;
       
   120     }
       
   121      
       
   122 // -----------------------------------------------------------------------------
       
   123 // CSIPSettListSIPPrxSetView::ProfileLocked
       
   124 // Checks is currently shown profile locked.
       
   125 // -----------------------------------------------------------------------------
       
   126 //    
       
   127 TBool CSIPSettListSIPPrxSetView::ProfileLocked()
       
   128     {
       
   129     __GSLOGSTRING("CSIPSettListSIPPrxSetView::ProfileLocked" )
       
   130     TBool locked( EFalse );
       
   131     
       
   132     // Find right profile from SIP profile array.
       
   133     const TSIPSettingsData* data = iHandler->ProfileData();
       
   134     CArrayPtr<CSIPManagedProfile>* list = iHandler->ProfileArray();
       
   135     for ( TInt i = 0; i < list->Count(); i++ )
       
   136         {
       
   137         TUint32 profileId ( KErrNone );
       
   138         list->At( i )->GetParameter( KSIPProfileId, profileId );
       
   139         if ( profileId == data->iID )
       
   140             {
       
   141             // Get SIP profile lock information.
       
   142             list->At( i )->GetParameter( KSIPProfileLocked, locked );
       
   143             }
       
   144         }
       
   145     
       
   146     return locked;
       
   147     }
       
   148        
       
   149 //  End of File