accesspointcontrol/apcontrollistplugin/src/apcontrollistcapschange.cpp
changeset 27 489cf6208544
parent 23 7ec726f93df1
child 42 017c42709822
child 46 95d45f234cf3
equal deleted inserted replaced
23:7ec726f93df1 27:489cf6208544
     1 /*
       
     2 * Copyright (c) 2006 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:  Class for asyncron calls.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include <rmmcustomapi.h>
       
    21 
       
    22 #include "apcontrollistcapschange.h"
       
    23 #include "apcontrollistplugin.h"
       
    24 #include "apcontrollistapiwrapper.h"
       
    25 #include "apcontrollistpluginlogger.h"
       
    26 
       
    27 // ============================ MEMBER FUNCTIONS ===============================
       
    28 
       
    29 // ----------------------------------------------------------------------------- 
       
    30 // CAPControlListCapsChange::CAPControlListCapsChange
       
    31 // Description: CAPControlListCapsChange constructer 
       
    32 // ----------------------------------------------------------------------------- 
       
    33 //
       
    34 CAPControlListCapsChange::CAPControlListCapsChange(
       
    35 					CAPControlListPlugin& aPlugin, TInt aPriority ) : 
       
    36 													CActive( aPriority ), 
       
    37 													iPlugin(aPlugin) 
       
    38 	{
       
    39 	CActiveScheduler::Add( this ); 
       
    40 	}
       
    41 
       
    42 //
       
    43 //----------------------------------------------------------------------------- 
       
    44 // CAPControlListCapsChange:: CAPControlListCapsChange
       
    45 // Description: CAPControlListCapsChange Destructer
       
    46 // ----------------------------------------------------------------------------- 
       
    47 // 
       
    48 CAPControlListCapsChange::~CAPControlListCapsChange()
       
    49 	{
       
    50 	Cancel();
       
    51 	}
       
    52 
       
    53 
       
    54 
       
    55 //
       
    56 //----------------------------------------------------------------------------- 
       
    57 // CAPControlListCapsChange::DoCancel
       
    58 // Description: This calls CActive's Cancel 
       
    59 //----------------------------------------------------------------------------- 
       
    60 //
       
    61 void CAPControlListCapsChange::DoCancel()
       
    62     {
       
    63     CLOG( ( ESelector, 0, _L( "-> CAPControlListCapsChange::DoCancel" ) ) );
       
    64     iPlugin.APIWrapper()->CancelNotify();   
       
    65     CLOG( ( ESelector, 0, _L( "<- CAPControlListCapsChange::DoCancel" ) ) );
       
    66     }
       
    67 
       
    68 //
       
    69 //----------------------------------------------------------------------------- 
       
    70 // CAPControlListCapsChange::RunL 
       
    71 // Description: CActive::RunL implementation which will either stop the
       
    72 // Scheduler or increment the count
       
    73 //----------------------------------------------------------------------------- 
       
    74 //
       
    75 void CAPControlListCapsChange::RunL()
       
    76 	{
       
    77     CLOG( ( ESelector, 0, _L( "-> CAPControlListCapsChange::RunL" ) ) );
       
    78     CLOG( ( ESelector, 0, _L( "iStatus.Int(): %d"), iStatus.Int() ) );
       
    79     CLOG( ( ESelector, 0, _L( "iCaps: %d"), iCaps ) );
       
    80 	if ( !(iCaps & RMobilePhone::KCapsUSimAccessSupported) )
       
    81 		{
       
    82 		iPlugin.ExitOnUSIMRemovalL();
       
    83 		}
       
    84 	else
       
    85 		{
       
    86     	iPlugin.APIWrapper()->NotifyIccAccessCapsChange( iStatus, iCaps );
       
    87 		SetActive();			
       
    88 		}
       
    89     CLOG( ( ESelector, 0, _L( "<- CAPControlListCapsChange::RunL" ) ) );
       
    90 	}
       
    91 	
       
    92 
       
    93 
       
    94 // ---------------------------------------------------------
       
    95 // CAPControlListCapsChange::NotifyCapsChange()
       
    96 // ---------------------------------------------------------
       
    97 //
       
    98 void CAPControlListCapsChange::NotifyCapsChange()
       
    99     {   	
       
   100     CLOG( ( ESelector, 0, _L( 
       
   101     	"-> CAPControlListCapsChange::NotifyCapsChange" ) ) );
       
   102 	if( !IsActive() )
       
   103 		{
       
   104     	iPlugin.APIWrapper()->NotifyIccAccessCapsChange( iStatus, iCaps );
       
   105 		SetActive();	
       
   106 		}
       
   107     CLOG( ( ESelector, 0, _L( 
       
   108     	"<- CAPControlListCapsChange::NotifyCapsChange" ) ) );
       
   109     }
       
   110