xdmprotocols/XcapProtocol/XcapUtils/inc/XcapEarlyIms.h
changeset 0 c8caa15ef882
child 22 04fe29633490
equal deleted inserted replaced
-1:000000000000 0:c8caa15ef882
       
     1 /*
       
     2 * Copyright (c) 2005 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:   CXcapEarlyIms
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __XCAPEARLYIMS__
       
    22 #define __XCAPEARLYIMS__
       
    23 
       
    24 #include <etelmm.h>
       
    25 
       
    26 //COMMON CONSTANTS
       
    27 _LIT( KUtilsLogDir,                             "XDM" );
       
    28 _LIT( KUtilsLogFile,                            "XcapUtils.txt" );
       
    29 _LIT8( KXcapFakeImpu,                            "IMSI@FakeImpu.ims.3gpp.invalid" );
       
    30 const TInt KUtilsLogBufMaxSize                  = 2000;
       
    31 
       
    32 
       
    33 //For testing of EarlyIms in WINSCW
       
    34 //#define __FAKE_IMPU__
       
    35 
       
    36 //FORWARD DECLARATIONS
       
    37 class MXcapEarlyImsObs;
       
    38 class CAsyncRetrieveAuthorizationInfo;
       
    39 
       
    40 // CLASS DECLARATION
       
    41 class CXcapEarlyIms : public CActive
       
    42 
       
    43     {
       
    44     public:  // Constructors and destructor
       
    45         
       
    46         /**
       
    47         * Symbian OS default constructor.
       
    48         * @return CXcapEarlyIms New instance
       
    49         */     
       
    50         IMPORT_C static CXcapEarlyIms* NewL();
       
    51         
       
    52         /**
       
    53         * Symbian OS default constructor.
       
    54         * @return CXcapEarlyIms New instance
       
    55         */     
       
    56         IMPORT_C void RequestSimDataL( MXcapEarlyImsObs* aObserver );
       
    57         
       
    58         /**
       
    59         * Symbian OS default constructor.
       
    60         * @return CXcapEarlyIms New instance
       
    61         */
       
    62         IMPORT_C TPtrC8 PublicIDL();
       
    63         
       
    64         /**
       
    65         * Destructor.
       
    66         */      
       
    67         IMPORT_C virtual ~CXcapEarlyIms();
       
    68     
       
    69     #ifdef _DEBUG
       
    70         
       
    71         /**
       
    72         * Clean the log file
       
    73         * @return void
       
    74         */
       
    75         void CXcapEarlyIms::DeleteLogFileL();
       
    76         
       
    77         /**
       
    78         * A global logging function for 8 bit data.
       
    79         * @param aCommand command to be handled
       
    80         */
       
    81         static void WriteToLog( TRefByValue<const TDesC8> aFmt,... );
       
    82     
       
    83     #endif //_DEBUG
       
    84          
       
    85     private:
       
    86         
       
    87         /**
       
    88         * C++ default constructor is private.
       
    89         */      
       
    90         CXcapEarlyIms();
       
    91 
       
    92         /**
       
    93         * Symbian OS second-phase constructor.
       
    94         * @return void
       
    95         */     
       
    96         void ConstructL();
       
    97         
       
    98         /**
       
    99         * From CActive
       
   100         * A request has completed
       
   101         * @return void
       
   102         */ 
       
   103         void RunL();
       
   104         
       
   105         /**
       
   106         * From CActive
       
   107         * Cancel an outstanding request.
       
   108         * @return void
       
   109         */ 
       
   110         void DoCancel();
       
   111         
       
   112         /**
       
   113         * Get the module name
       
   114         * @param TDes& Module name on return
       
   115         * @return void
       
   116         */ 
       
   117         void ModuleNameL( TDes& aModuleName ) const;
       
   118         
       
   119         /**
       
   120         * Find out the type of the SIM card
       
   121         * and its application
       
   122         * @return void
       
   123         */ 
       
   124         void SelectSimTypeL();
       
   125         
       
   126         /**
       
   127         * Derive IMPU and IMPI from the values
       
   128         * retrieved from the SIM card
       
   129         * @return TPtrC8 User's Public ID
       
   130         */
       
   131         TPtrC8 DeriveL();
       
   132            
       
   133     private: //Data
       
   134     
       
   135     
       
   136         enum TRequestPhase
       
   137             {
       
   138             TRequestIdle = 0,
       
   139             TRequestAuth,
       
   140             TRequestNetwork,
       
   141             TRequestUsimAuth
       
   142             };
       
   143         
       
   144         enum TXcapSimType
       
   145             {
       
   146             ESimTypeGsm = 0,
       
   147             ESimTypeCdma,
       
   148             ESimTypeWcdma,
       
   149             ESimTypeUnknown
       
   150             };
       
   151         
       
   152         TBool                                             iRequestComplete;
       
   153         HBufC8*                                           iImpu;
       
   154         HBufC8*                                           iImpi;
       
   155         RTelServer                                        iServer;
       
   156         RMobilePhone                                      iPhone;
       
   157         TXcapSimType                                      iSimType;
       
   158         TRequestPhase                                     iRequestPhase;
       
   159         MXcapEarlyImsObs*                                 iObserver;
       
   160         CAsyncRetrieveAuthorizationInfo*                  iRetriever;
       
   161         RMobilePhone::CImsAuthorizationInfoV5*            iAuthData;
       
   162         RMobilePhone::TMobilePhoneSubscriberId            iImsi;
       
   163         RMobilePhone::TMobilePhoneNetworkCountryCode      iCountryCode;
       
   164         RMobilePhone::TMobilePhoneNetworkIdentity         iNetworkCode;
       
   165         TPckgBuf<RMobilePhone::TMobilePhoneNetworkInfoV1> iNetworkInfoPckg;
       
   166     };
       
   167 
       
   168 #endif
       
   169 
       
   170 // End of File