convergedconnectionhandler/cchserver/inc/cchetelnetworkstatusnotifier.h
changeset 0 a4daefaec16c
equal deleted inserted replaced
-1:000000000000 0:a4daefaec16c
       
     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:  CCchEtelNetworkStatusNotifier handles cch's CTelephony 
       
    15 *              : related observing functionality.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef CCHETELNETWORKSTATUSNOTIFIER_H
       
    21 #define CCHETELNETWORKSTATUSNOTIFIER_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <etelmm.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 
       
    29 class MCchEtelNetworkStatusObserver;
       
    30 
       
    31 // CLASS DECLARATION
       
    32 /**
       
    33 *  CCchEtelNetworkStatusNotifier
       
    34 *  
       
    35 *  @lib   cchserver
       
    36 *  @since 3.2
       
    37 */
       
    38 
       
    39 enum TCCHEtelConnectionState
       
    40     {
       
    41     ECCHEtelConnect = 0,
       
    42     ECCHEtelLoadModule,
       
    43     ECCHEtelOpenPhone,
       
    44     ECCHEtelConnected
       
    45     };
       
    46     
       
    47 class CCchEtelNetworkStatusNotifier : 
       
    48               public CActive
       
    49 {
       
    50 public:
       
    51 
       
    52     /**
       
    53     * Two-phased constructor.
       
    54     */         
       
    55     static CCchEtelNetworkStatusNotifier* NewL( 
       
    56         MCchEtelNetworkStatusObserver& aEtelNetworkStatusObserver );
       
    57 
       
    58     /**
       
    59     * Destructor.
       
    60     */
       
    61     ~CCchEtelNetworkStatusNotifier();
       
    62 
       
    63 public: // Other functions
       
    64     
       
    65     /**
       
    66     * Returns whether network status is no-service
       
    67     *
       
    68     * @since S60 3.1
       
    69     * @param None
       
    70     * @return TBool ETrue	if network status is no-service
       
    71     *				EFalse 	if network status is something else 
       
    72     *                           than no-service
       
    73     */
       
    74     TBool IsNetworkStatusNoService() const; 
       
    75 
       
    76     /**
       
    77     * Connects to etel
       
    78     *
       
    79     * @since S60 3.2
       
    80     * @param None
       
    81     * @return None
       
    82     */
       
    83     void Connect(); 
       
    84 
       
    85 
       
    86 protected:
       
    87 
       
    88     // From CActive
       
    89     void RunL();
       
    90     void DoCancel();
       
    91 
       
    92 private:
       
    93 
       
    94     /**
       
    95     * Constructors.
       
    96     */         
       
    97     CCchEtelNetworkStatusNotifier( MCchEtelNetworkStatusObserver& aEtelNetworkStatusObserver );
       
    98     void ConstructL();
       
    99 
       
   100     /*
       
   101     * Order notification
       
   102     */
       
   103     void OrderNotification();
       
   104 
       
   105 private:
       
   106     /**
       
   107      * ETel server
       
   108      */
       
   109     RTelServer                                      iEtelServer;
       
   110     /**
       
   111      * phone
       
   112      */
       
   113     RMobilePhone                                    iPhone;
       
   114     /*
       
   115     * observer, not own
       
   116     */
       
   117     MCchEtelNetworkStatusObserver&                  iEtelNetworkStatusObserver;  
       
   118     
       
   119     /*
       
   120     * current cs network registration status
       
   121     */    
       
   122     RMobilePhone::TMobilePhoneRegistrationStatus    iRegistrationStatus;
       
   123  
       
   124     /*
       
   125      * Last cs network registration status
       
   126      */    
       
   127     RMobilePhone::TMobilePhoneRegistrationStatus    iLastRegistrationStatus;
       
   128     
       
   129     /*
       
   130      * Is notification already ordered?
       
   131      */    
       
   132     TBool                                            iNotified;
       
   133   
       
   134     /*
       
   135     * delay before next try to connect to etel
       
   136     */    
       
   137     TInt                                            iDelay;
       
   138     
       
   139     /*
       
   140     * status of etel connection
       
   141     */    
       
   142     TCCHEtelConnectionState                         iState;
       
   143     
       
   144     /*
       
   145     * connection timer
       
   146     */    
       
   147     RTimer                                          iTimer;
       
   148  
       
   149 };
       
   150 
       
   151 #endif // CCHETELNETWORKSTATUSNOTIFIER_H
       
   152 
       
   153 // End of File