phoneengine/networkhandlingstarter/inc/cnetworklistener.h
changeset 64 6aaf0276100e
parent 56 5bcb308bd24d
child 65 2a5d4ab426d3
equal deleted inserted replaced
56:5bcb308bd24d 64:6aaf0276100e
    21 
    21 
    22 // System includes
    22 // System includes
    23 #include <e32base.h>
    23 #include <e32base.h>
    24 #include <nwhandlingengine.h>
    24 #include <nwhandlingengine.h>
    25 #include <qsysteminfo.h>
    25 #include <qsysteminfo.h>
       
    26 #include <MSSSettingsRefreshObserver.h>
       
    27 #include <MPsetNetworkInfoObs.h>
    26 
    28 
    27 // User includes
    29 // User includes
    28 
    30 
    29 // Forward declarations
    31 // Forward declarations
    30 class CNWSession;
    32 class CNWSession;
    31 class MNetworkListenerObserver;
    33 class MNetworkListenerObserver;
       
    34 class CPsetNetwork;
       
    35 class CPsetContainer;
       
    36 class CPSetRefreshHandler;
    32 
    37 
    33 using namespace QtMobility;
    38 using namespace QtMobility;
    34 
    39 
    35 /**
    40 /**
    36  *  Network info listener.
    41  *  Network info listener.
    37  */
    42  */
    38 NONSHARABLE_CLASS( CNetworkListener ) : public CBase, 
    43 NONSHARABLE_CLASS( CNetworkListener ) : public CBase, 
    39     public MNWMessageObserver
    44     public MNWMessageObserver,
       
    45     public MSSSettingsRefreshObserver,
       
    46     public MPsetNetworkInfoObserver
    40     {
    47     {
    41 public:
    48 public:
    42 
    49 
    43     /**
    50     /**
    44      * Get pointer to network info listener.
    51      * Get pointer to network info listener.
    64      * @param aErrorCode is fail reason.
    71      * @param aErrorCode is fail reason.
    65      */
    72      */
    66     void HandleNetworkError( const TNWOperation aOperation, TInt aErrorCode );
    73     void HandleNetworkError( const TNWOperation aOperation, TInt aErrorCode );
    67     
    74     
    68     static TInt NWLostDelayCallBack(TAny* aParam);
    75     static TInt NWLostDelayCallBack(TAny* aParam);
       
    76     
       
    77     static TInt NWSimRefreshCallBack(TAny* aParam);
       
    78     
       
    79     /**
       
    80      * From MSSSettingsRefreshObserver.
       
    81      * Refresh query. Client should determine whether it allow the
       
    82      * refresh to happen.
       
    83      * 
       
    84      * @param aType  Refresh type.
       
    85      * @param aFiles Elementary files which are to be changed. 
       
    86      *               May be zero length. 
       
    87      * @return ETrue to allow refresh, EFalse to decline refresh.
       
    88      */
       
    89     TBool AllowRefresh(
       
    90         const TSatRefreshType aType,
       
    91         const TSatElementaryFiles aFiles );
       
    92 
       
    93     /**
       
    94      * From MSSSettingsRefreshObserver.
       
    95      * Notification of refresh.
       
    96      * 
       
    97      * @param aType Type of refresh which has happened.
       
    98      * @param aFiles List of elementary files which have been changed.
       
    99      *               May be zero length.
       
   100       */
       
   101     void Refresh(
       
   102         const TSatRefreshType aType,
       
   103         const TSatElementaryFiles aFiles );
       
   104    
       
   105     /**
       
   106     * Shows notes when network information received.
       
   107     *
       
   108     * @param aInfoArray Network information. Receiver owns the array.
       
   109     * @param aResult Result of action.
       
   110     */
       
   111     void HandleNetworkInfoReceivedL( 
       
   112         const CNetworkInfoArray* aInfoArray, const TInt aResult );
       
   113     
       
   114     /**
       
   115     * Shows notes when requested for current network information.
       
   116     *
       
   117     * @param aCurrentInfo Current network information.
       
   118     * @param aResult Result of action.
       
   119     */
       
   120     void HandleCurrentNetworkInfoL( 
       
   121         const MPsetNetworkSelect::TCurrentNetworkInfo& aCurrentInfo, 
       
   122         const TInt aResult );
       
   123     
       
   124     /**
       
   125     *  DEPRECATED.
       
   126     */
       
   127     void HandleNetworkChangedL( 
       
   128         const MPsetNetworkSelect::TNetworkInfo& aCurrentInfo,
       
   129         const MPsetNetworkSelect::TCurrentNetworkStatus aStatus, 
       
   130         const TInt aResult );    
       
   131 
       
   132     /**
       
   133     * Shows notes when network change has been approved.
       
   134     *
       
   135     * @param aCurrentInfo Current network information.
       
   136     * @param aStatus Current network status.
       
   137     * @param aResult Result of action.
       
   138     */
       
   139     void HandleNetworkChangedL( 
       
   140         const MPsetNetworkSelect::TNetworkInfo& aCurrentInfo,
       
   141         const RMobilePhone::TMobilePhoneRegistrationStatus& aStatus, 
       
   142         const TInt aResult );    
       
   143 
       
   144     /**
       
   145     * Searches for networks that have coverage.
       
   146     *
       
   147     * @param aRequest Type of request that is being handled.
       
   148     */
       
   149     void HandleSearchingNetworksL( TServiceRequest aRequest );
       
   150 
       
   151     /**
       
   152     * Handles user request to register to specific network.
       
   153     *
       
   154     * @param aOngoing Is there an ongoing request.
       
   155     */
       
   156     void HandleRequestingSelectedNetworkL( TBool aOngoing );
       
   157 
       
   158     /**
       
   159     * Handles notes when call is active.
       
   160     */
       
   161     void HandleCallActivatedL();
       
   162 
       
   163     /**
       
   164     * Handles errors.
       
   165     * 
       
   166     * @param aRequest current request.
       
   167     * @param aError error code.
       
   168     */
       
   169     void HandleNetworkErrorL( const MPsetNetworkInfoObserver::TServiceRequest aRequest,
       
   170         const TInt aError );
    69 
   171 
    70 private:
   172 private:
    71     
   173     
    72     CNetworkListener( MNetworkListenerObserver& aObserver );
   174     CNetworkListener( MNetworkListenerObserver& aObserver );
    73     
   175     
   127     /**
   229     /**
   128      * System device info API.
   230      * System device info API.
   129      * Own.
   231      * Own.
   130      */
   232      */
   131     QSystemDeviceInfo* iDeviceInfo;
   233     QSystemDeviceInfo* iDeviceInfo;
       
   234     
       
   235     /**
       
   236      * PhoneSettings container.
       
   237      * Own.
       
   238      */
       
   239     CPsetContainer* iContainer;
       
   240     
       
   241     /**
       
   242      * PhoneSettings engine object.
       
   243      * Own.
       
   244      */
       
   245     CPsetNetwork* iSettingsEngine;
       
   246     
       
   247     /**
       
   248      * PhoneSettings refresh handler.
       
   249      * Own.
       
   250      */
       
   251     CPSetRefreshHandler* iRefreshHandler;
       
   252     
   132     };
   253     };
   133     
   254     
   134 #endif // CNETWORKLISTENER_H
   255 #endif // CNETWORKLISTENER_H