serviceproviders/sapi_sysinfo/sysinfoservice/inc/sysnetworkrequest.h
changeset 19 989d2f495d90
child 53 29eae4b7c31b
equal deleted inserted replaced
14:a36b1e19a461 19:989d2f495d90
       
     1 /*
       
     2 * Copyright (c) 2005-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 the License "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:  describes system information notifiers.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __SYSNETWORKREQUEST_H__
       
    20 #define __SYSNETWORKREQUEST_H__
       
    21 
       
    22 //INCLUDES
       
    23 #include "activerequests.h"
       
    24 
       
    25 // FORWORD CLASS DECLARATION
       
    26 class RTelServer;
       
    27 class RMobilePhone;
       
    28 
       
    29 
       
    30 /**
       
    31 *  @ref CNetwork active object class to handle asynchronous network
       
    32 *   information requests.
       
    33 *
       
    34 *  @lib   sysinfoservice.lib
       
    35 *  @since 3.2
       
    36 */
       
    37 NONSHARABLE_CLASS(CNetwork): public CActiveRequest
       
    38     {
       
    39     public:
       
    40     // Enumeration of supported network request types.
       
    41     typedef enum { 
       
    42         ESignalStrength,
       
    43         EHomeNetworkInfo, 
       
    44         ECurrentNetworkInfo,
       
    45         ELocationAreaCode,
       
    46         ECellId,
       
    47         EBatteryStrength 
       
    48         }TNetInfoType;
       
    49 
       
    50     public:	// Constructors and destructor
       
    51     /**
       
    52     * Two-phased constructor.
       
    53     *
       
    54     * @return A new instance of this class.
       
    55     */    
       
    56     static CNetwork* NewL( const TSysRequest& aRequest,TInt aNetworkInfoType );
       
    57     /**
       
    58     * Destructor.
       
    59     */
       
    60     ~CNetwork();
       
    61 
       
    62     private:
       
    63     /**
       
    64     * C++ default constructor.
       
    65     */
       
    66     CNetwork( TSysRequest::TRequestType aReqType, TInt32 aTransID,
       
    67                     TInt aNetworkInfoType, ISystemObserver* aObsrver);
       
    68 
       
    69     /**
       
    70     * By default Symbian 2nd phase constructor is private.
       
    71     */
       
    72     void ConstructL( const TSysRequest& aRequest );
       
    73 
       
    74     public:	
       
    75     /**
       
    76     * Issues network request.
       
    77     */
       
    78     TInt Request();
       
    79 
       
    80     protected: // from CActive
       
    81     
       
    82     void RunL();
       
    83 
       
    84     void DoCancel();
       
    85 
       
    86     private:	// DATA
       
    87     //	Local copy of Entity.
       
    88     HBufC* 	        iEntity;
       
    89 
       
    90     //	Local copy of Key.
       
    91     HBufC* 	        iKey;
       
    92 
       
    93     // Session to the telephony server @ref RTelServer.
       
    94     RTelServer      iTelServer;
       
    95 
       
    96     //RMobilePhone handle.	
       
    97     RMobilePhone    iMobilePhone;
       
    98 
       
    99     //Network Request type.
       
   100     TNetInfoType    iNetworkInfoType;
       
   101 
       
   102     //Signal strength.
       
   103     TInt32          iSignalStrength;
       
   104 
       
   105     //Signal strength/Battery Threshold.
       
   106     TInt            iThreshold;
       
   107 
       
   108     //Network Information.
       
   109     RMobilePhone::TMobilePhoneNetworkInfoV1 iNetworkInfo;
       
   110 
       
   111     //packaged Network Information.
       
   112     RMobilePhone::TMobilePhoneNetworkInfoV1Pckg iNetworkInfoBuf;
       
   113 
       
   114     //mobile phone location area Information.
       
   115     RMobilePhone::TMobilePhoneLocationAreaV1    iArea;
       
   116 
       
   117     //LAC
       
   118     TUint           iLocationAreaCodeOld;
       
   119 
       
   120     //Cell ID
       
   121     TUint           iCellIdOld;
       
   122 
       
   123     //Battery Information.
       
   124     RMobilePhone::TMobilePhoneBatteryInfoV1     iBatteryInfo;
       
   125 
       
   126     //signal strength in scale of 0-7.
       
   127     TInt8           iBar;
       
   128 
       
   129     //Flag for Threshold.
       
   130     TBool           iIsThresholdSet;
       
   131     };
       
   132 
       
   133 
       
   134 // CLASS DECLARATION
       
   135 #endif __SYSNETWORKREQUEST_H__