satengine/SatServer/SystemState/inc/csatnetworkregstatusmonitor.h
changeset 46 2fa1fa551b0b
parent 42 35488577e233
child 48 78df25012fda
equal deleted inserted replaced
42:35488577e233 46:2fa1fa551b0b
     1 /*
       
     2 * Copyright (c) 2005-2008 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:  Network registration status monitor.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CSATNETWORKREGSTATUSMONITOR_H
       
    21 #define CSATNETWORKREGSTATUSMONITOR_H
       
    22 
       
    23 #include <e32base.h>
       
    24 #include <e32svr.h>
       
    25 #include <satcs.h>
       
    26 #include "msatmultimodeapi.h"
       
    27 
       
    28 /**
       
    29  *  Network registration status monitor
       
    30  *
       
    31  *  Initiates asynchronous operation to get current network registration
       
    32  *  status. After it has been got, initiates monitor change of its value.
       
    33  *
       
    34  *  @lib SystemState
       
    35  *  @since S60 v3.1
       
    36  */
       
    37 class CSatNetworkRegStatusMonitor : public CActive
       
    38     {
       
    39 
       
    40 public:
       
    41 
       
    42     static CSatNetworkRegStatusMonitor* NewL( MSatMultiModeApi& aPhone );
       
    43 
       
    44     virtual ~CSatNetworkRegStatusMonitor();
       
    45 
       
    46     /**
       
    47      * Activate network registration status monitor.
       
    48      */
       
    49     void Start();
       
    50 
       
    51     /**
       
    52      * Fetch current network registration status.
       
    53      * On error returns ERegistrationUnknown.
       
    54      *
       
    55      * @return Current network registration status.
       
    56      */
       
    57     RMobilePhone::TMobilePhoneRegistrationStatus CurrentValue();
       
    58 
       
    59 protected:
       
    60 
       
    61     /**
       
    62      * From CActive
       
    63      * Implements cancellation of an outstanding request.
       
    64      */
       
    65     void DoCancel();
       
    66 
       
    67     /**
       
    68      * From CActive
       
    69      * Handles an active object's request completion event.
       
    70      */
       
    71     void RunL();
       
    72 
       
    73 private:
       
    74 
       
    75     CSatNetworkRegStatusMonitor( MSatMultiModeApi& aPhone );
       
    76 
       
    77 private: // data
       
    78 
       
    79     /**
       
    80      * Current value of network registration status.
       
    81      */
       
    82     RMobilePhone::TMobilePhoneRegistrationStatus iRegistrationStatus;
       
    83 
       
    84     /**
       
    85      * iRegistrationStatus first value has not yet been got
       
    86      * after starting this monitor.
       
    87      */
       
    88     TBool iWaitingRegistrationStatus;
       
    89 
       
    90     /**
       
    91      * Blocker for synchronous requests.
       
    92      */
       
    93     CActiveSchedulerWait iWait;
       
    94 
       
    95     /**
       
    96      * Phone instance.
       
    97      * Not own.
       
    98      */
       
    99     MSatMultiModeApi& iPhone;
       
   100 
       
   101     };
       
   102 
       
   103 #endif // CSATNETWORKREGSTATUSMONITOR_H