omaprovisioning/provisioning/ProvisioningSC/Inc/CWPProvisioningSC.h
changeset 0 b497e44ab2fc
equal deleted inserted replaced
-1:000000000000 0:b497e44ab2fc
       
     1 /*
       
     2 * Copyright (c) 2002 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:  Reads provisioning settings from sim cards
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CWPPROVISIONINGSC_H
       
    20 #define CWPPROVISIONINGSC_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include "MWPWimObserver.h"
       
    25 // CONSTANTS
       
    26 const TInt KImsiNumberLength = 15;
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CWPWimHandler;
       
    30 class CWPImsiDbHandler;
       
    31 
       
    32 // CLASS DECLARATION
       
    33 /**
       
    34 *  ProvisioningSC detects a new SIM and handles the
       
    35 *  contained OMA provisioning document 
       
    36 *  @since 2.6
       
    37 */
       
    38 class CWPProvisioningSC : public CBase, public MWPWimObserver
       
    39     {
       
    40     public:  // Constructors and destructor
       
    41         
       
    42         /**
       
    43         * Two-phased constructor.
       
    44         */
       
    45         static CWPProvisioningSC* NewL();
       
    46         /**
       
    47         * Second two-phased constructor.
       
    48         */ 
       
    49 
       
    50 		static CWPProvisioningSC* NewLC();
       
    51         /**
       
    52         * Destructor.
       
    53         */
       
    54         virtual ~CWPProvisioningSC();
       
    55 
       
    56     public: // New functions
       
    57         
       
    58 		/**
       
    59         * Checks if a provisioning document is stored in the
       
    60 		* smart card and reads it. Calls back the observer.
       
    61         * @since 2.6
       
    62         * @return ETrue if the file has not been already read
       
    63         */
       
    64 		TBool ReadFile();
       
    65 
       
    66 		
       
    67 	// from base classes
       
    68 	private: 
       
    69 
       
    70 		// from MWPWimObserver
       
    71 		void ReadCompletedL();
       
    72 		void ReadCancelledL();
       
    73 		void ReadErrorL();
       
    74         
       
    75     private:
       
    76         /**
       
    77         * C++ default constructor.
       
    78         */
       
    79         CWPProvisioningSC();
       
    80 
       
    81         /**
       
    82         * By default Symbian 2nd phase constructor is private.
       
    83         */
       
    84         void ConstructL();
       
    85 
       
    86 		/**
       
    87         * Reads the imsi number of the current sim card
       
    88 		* and checks if it exists already in shared data
       
    89         * @since 2.6
       
    90         * @param aPhoneImsi modified to the current sim
       
    91         * @return ETrue if imsi was not found in shared data
       
    92         */
       
    93 		TBool ProcessImsiL( TDes& aPhoneImsi);
       
    94 
       
    95 		/**
       
    96         * Displays a memory low note
       
    97         * @since 2.6
       
    98         */
       
    99 		void ShowMemoryLowNoteL();
       
   100 
       
   101 		/**
       
   102         * Stores the provisioning document into inbox
       
   103 		* if appropriate.
       
   104         * @since 2.6
       
   105 		* @param provDoc to be stored
       
   106         */
       
   107 		void StoreDocL( TDesC8& aProvDoc );
       
   108 
       
   109     private:    // Data
       
   110 		HBufC8* iProvisioningDoc;// owned
       
   111 		HBufC* iImsiNumbers; // owned
       
   112 		CWPWimHandler* iWimHandler; // owned
       
   113 		CWPImsiDbHandler* iImsiHandler;
       
   114 		TBuf<KImsiNumberLength> iPhoneImsi;
       
   115     private:    // Friend classes
       
   116 		friend class T_CWPProvisioningSC;
       
   117     };
       
   118 
       
   119 #endif      // CWPPROVISIONINGSC_H   
       
   120              
       
   121 // End of File