radioengine/engine/inc/cradionetworkinfolistener.h
branchRCL_3
changeset 20 93c594350b9a
parent 19 cce62ebc198e
equal deleted inserted replaced
19:cce62ebc198e 20:93c594350b9a
     1 /*
       
     2 * Copyright (c) 2009 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:
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef C_RADIONETWORKINFOLISTENER_H
       
    19 #define C_RADIONETWORKINFOLISTENER_H
       
    20 
       
    21 // System includes
       
    22 #include <e32base.h>
       
    23 #include <etel3rdparty.h>
       
    24 
       
    25 // Forward declarations
       
    26 class CTelephony;
       
    27 class MRadioSettingsSetter;
       
    28 
       
    29 /**
       
    30  * An interface for notifying about network id changes
       
    31  */
       
    32 NONSHARABLE_CLASS( MRadioNetworkChangeObserver )
       
    33     {
       
    34 public:
       
    35 
       
    36     /**
       
    37      * Used for notifying that the network id has changed
       
    38      */
       
    39     virtual void NetworkIdChanged() = 0;
       
    40 
       
    41     };
       
    42 
       
    43 /**
       
    44  * Listens changes in network ID and country code.
       
    45  */
       
    46 NONSHARABLE_CLASS( CRadioNetworkInfoListener ) : public CActive
       
    47     {
       
    48 public:
       
    49 
       
    50     static CRadioNetworkInfoListener* NewL( MRadioSettingsSetter& aSetter,
       
    51                                             MRadioNetworkChangeObserver* aObserver );
       
    52 
       
    53     ~CRadioNetworkInfoListener();
       
    54 
       
    55     /**
       
    56      * Return current combined network ID and country code as TInt.
       
    57      * @return   An integer composed of the current network ID and country code.
       
    58      */
       
    59     TInt CompoundNetworkId() const;
       
    60 
       
    61     /**
       
    62      * Returns current country code.
       
    63      * @return   The current country code.
       
    64      */
       
    65     TPtrC CountryCode() const;
       
    66 
       
    67     /**
       
    68      * SubscriberId
       
    69      * @return subscriber id
       
    70      */
       
    71     TPtrC SubscriberId() const;
       
    72 
       
    73 private:
       
    74 
       
    75     CRadioNetworkInfoListener( MRadioSettingsSetter& aSetter,
       
    76                                MRadioNetworkChangeObserver* aObserver );
       
    77 
       
    78     void ConstructL();
       
    79 
       
    80 // from base class CActive
       
    81 
       
    82     void DoCancel();
       
    83     void RunL();
       
    84 
       
    85 // New functions
       
    86 
       
    87     void SaveNetworkInfoL();
       
    88 
       
    89 private: // data
       
    90 
       
    91     MRadioSettingsSetter&           iSetter;
       
    92 
       
    93     MRadioNetworkChangeObserver*    iObserver;
       
    94 
       
    95 #ifndef __WINS__
       
    96     CTelephony*                     iTelephony;
       
    97 #endif
       
    98 
       
    99     CTelephony::TSubscriberIdV1     iSubscriberId;
       
   100     CTelephony::TSubscriberIdV1Pckg iSubscriberIdPckg;
       
   101     CTelephony::TNetworkInfoV1      iNetworkInfo;
       
   102     CTelephony::TNetworkInfoV1Pckg  iNetworkInfoPckg;
       
   103 
       
   104     TInt                            iCompoundNetworkId;
       
   105     TInt                            iPreviousCompoundNetworkId;
       
   106 
       
   107     };
       
   108 
       
   109 #endif // C_RADIONETWORKINFOLISTENER_H