adaptationlayer/tsy/nokiatsy_dll/inc/cmmphonebookoperationwrite.h
changeset 5 8ccc39f9d787
parent 0 63b37f68c1ce
child 7 fa67e03b87df
equal deleted inserted replaced
4:510c70acdbf6 5:8ccc39f9d787
    32 
    32 
    33 //  DATA TYPES
    33 //  DATA TYPES
    34     //none
    34     //none
    35 
    35 
    36 //  EXTERNAL DATA STRUCTURES
    36 //  EXTERNAL DATA STRUCTURES
       
    37 enum TPBWritePhases
       
    38     {
       
    39     EPBWritePhase_Read_Entry = 0,
       
    40     EPBWritePhase_Read_Ext_Entry,
       
    41     EPBWritePhase_Search_Ext_Entry,
       
    42     EPBWritePhase_Write_Entry,
       
    43     EPBWritePhase_Write_Ext_Entry,
       
    44     EPBWritePhase_Read_MBI_profile,
       
    45     EPBWritePhase_Write_MBI_profile,
       
    46     EPBWritePhase_complete
       
    47     };
       
    48 
    37 
    49 
    38 //  FUNCTION PROTOTYPES
    50 //  FUNCTION PROTOTYPES
    39     //none
    51     //none
    40 
    52 
    41 // CLASS DECLARATION
    53 // CLASS DECLARATION
    88         *
   100         *
    89         * @param aIpc Identify number of request.
   101         * @param aIpc Identify number of request.
    90         * @param aDataPackage Packaged data.
   102         * @param aDataPackage Packaged data.
    91         * @return KErrNone or error value.
   103         * @return KErrNone or error value.
    92         */
   104         */
    93         TInt CreateReq(
   105         TInt UICCCreateReq(
    94             TInt aIpc,
   106             TInt aIpc,
    95             const CMmDataPackage* aDataPackage );
   107             const CMmDataPackage* aDataPackage,
       
   108             TUint8 aTransId );
    96 
   109 
    97         /**
   110         /**
    98         * Handles SimPbResp ISI -message
   111         * Handles SimPbResp ISI -message
    99         *
   112         *
   100         * @param aIsiMessage
   113         * @param aIsiMessage
   101         * @param aComplete Indicates if request can remove from
   114         * @param aComplete Indicates if request can remove from
   102         *        operationlist or not.
   115         *        operationlist or not.
   103         * @return KErrNone or error value.
   116         * @return KErrNone or error value.
   104         */
   117         */
   105         TInt HandleSimPbRespL(
   118         TBool HandleUICCPbRespL(
   106             const TIsiReceiveC& aIsiMessage,
   119                 TInt aStatus,
   107             TBool& aComplete );
   120                 TUint8 aDetails,
   108 
   121                 const TDesC8& aFileData,
   109         /**
   122                 TInt aTransId );
   110         * Handles HandleWriteResp ISI -message
   123 
   111         *
   124         /**
   112         * @param aIsiMessage
   125         * Handles HandleWriteReadEntryResp aFileData
   113         * @param aComplete Indicates if request can remove from
   126         *
   114         *        operationlist or not.
   127         * @param aFileData
   115         * @return KErrNone or error value.
   128         * @param aTransId - Transaction id received
   116         */
   129         * @param aFileId - file id for main PB file
   117         TInt HandleWriteResp(
   130         * @param aFileIdExt - file Id for EXT fiel related to main PB file
   118             const TIsiReceiveC& aIsiMessage,
   131         * @ param aArrayIndex - Array index for the Array in which configuration data Stored
   119             TBool& aComplete );
   132         * @param aStatus - Response message status
   120 
   133         * @return complete 
   121         /**
   134         */
   122         * Handling write response at delete phase
   135         TInt HandleWriteReadEntryResp(
   123         *
   136             TInt aStatus,
   124         * @param aIsiMessage
   137             const TDesC8& aFileData,
   125         * @param aComplete Indicates if request can remove from
   138             TUint8 aTransId,
   126         *        operationlist or not.
   139             TUint16 aFileId,
   127         * @return KErrNone or error value.
   140             TUint16 aFileIdExt,
   128         */
   141             TUint8 aArrayIndex );
   129         TInt HandleWriteDeleteL(
   142 
   130             const TIsiReceiveC& aIsiMessage,
   143         /**
   131             TBool& aComplete );
   144         * Handles HandleWriteReadExtEntryResp aFileData
       
   145         *
       
   146         * @param aFileData
       
   147         * @param aTransId - Transaction id received
       
   148         * @param aFileId - file id for main PB file
       
   149         * @param aFileIdExt - file Id for EXT fiel related to main PB file
       
   150         * @ param aArrayIndex - Array index for the Array in which configuration data Stored
       
   151         * @param aStatus - Response message status
       
   152         * @return complete 
       
   153         */
       
   154         TInt HandleWriteReadExtEntryResp(
       
   155             TInt aStatus,
       
   156             const TDesC8& aFileData,
       
   157             TUint8 aTransId,
       
   158             TUint16 aFileId,
       
   159             TUint16 aFileIdExt);
       
   160 
       
   161         /**
       
   162         * Handles HandleWriteSearchExtEntryResp aFileData
       
   163         *
       
   164         * @param aFileData
       
   165         * @param aTransId - Transaction id received
       
   166         * @param aFileId - file id for main PB file
       
   167         * @param aFileIdExt - file Id for EXT fiel related to main PB file
       
   168         * @ param aArrayIndex - Array index for the Array in which configuration data Stored
       
   169         * @param aStatus - Response message status
       
   170         * @return complete 
       
   171         */
       
   172         TInt HandleWriteSearchExtEntryResp(
       
   173             TInt aStatus,
       
   174             const TDesC8& aFileData,
       
   175             TUint8 aTransId,
       
   176             TUint16 aFileId,
       
   177             TUint16 aFileIdExt );
       
   178         
       
   179         /**
       
   180         * Handles HandleWriteEntryResp aFileData
       
   181         *
       
   182         * @param aFileData
       
   183         * @param aTransId - Transaction id received
       
   184         * @param aFileId - file id for main PB file
       
   185         * @param aFileIdExt - file Id for EXT fiel related to main PB file
       
   186         * @ param aArrayIndex - Array index for the Array in which configuration data Stored
       
   187         * @param aStatus - Response message status
       
   188         * @return complete 
       
   189         */
       
   190         TInt HandleWriteEntryResp(
       
   191             TInt aStatus,
       
   192             TUint8 aTransId,
       
   193             TUint16 aFileId,
       
   194             TUint16 aFileIdExt );
       
   195 
       
   196         /**
       
   197         * Handles HandleWriteExtEntryResp aFileData
       
   198         *
       
   199         * @param aFileData
       
   200         * @param aTransId - Transaction id received
       
   201         * @param aFileId - file id for main PB file
       
   202         * @param aFileIdExt - file Id for EXT fiel related to main PB file
       
   203         * @ param aArrayIndex - Array index for the Array in which configuration data Stored
       
   204         * @param aStatus - Response message status
       
   205         * @return complete 
       
   206         */
       
   207         TInt HandleWriteExtEntryResp(
       
   208             TInt aStatus,
       
   209             TUint8 aTransId,
       
   210             TUint16 aFileId,
       
   211             TUint16 aFileIdExt);
       
   212         
       
   213         /**
       
   214         * Handles HandleWriteMBIReadResp aFileData
       
   215         *
       
   216         * @param aFileData
       
   217         * @param aTransId - Transaction id received
       
   218         * @param aFileId - file id for main PB file
       
   219         * @param aFileIdExt - file Id for EXT fiel related to main PB file
       
   220         * @ param aArrayIndex - Array index for the Array in which configuration data Stored
       
   221         * @param aStatus - Response message status
       
   222         * @return complete 
       
   223         */
       
   224         TInt HandleWriteMBIReadResp( 
       
   225                 TInt aStatus,
       
   226                 TUint8 aDetails,
       
   227                 TUint8 aTransId,
       
   228                 const TDesC8 &aFileData ); 
       
   229         
       
   230         
       
   231         /**
       
   232         * Handles HandleWriteMBIWriteResp aFileData
       
   233         *
       
   234         * @param aStatus
       
   235         * @param aDetails -
       
   236         * @param aTransId - Transaction id received
       
   237         * @return complete 
       
   238         */
       
   239         TInt HandleWriteMBIWriteResp(
       
   240                 TInt aStatus,
       
   241                 TUint8 aDetails );
   132 
   242 
   133         /**
   243         /**
   134         * Creates and sends ISI message in order to wite an entry to SIM
   244         * Creates and sends ISI message in order to wite an entry to SIM
   135         *
   245         *
   136         * @param aTraId Transaction id
   246         * @param aTraId Transaction id
   137         * @param aIndex Location index
   247         * @param aIndex Location index
   138         * @param aDataToWrite Entry to write
   248         * @param aDataToWrite Entry to write
   139         * @return KErrNone or error value
   249         * @return KErrNone or error value
   140         */
   250         */
   141         TInt SimPbReqWriteL(
   251         TInt UiccPbReqWriteL(
   142             TUint8 aTraId,
   252             TUint8 aTraId,
   143             TInt16 aIndex,
   253             TInt16 aIndex,
   144             CPhoneBookStoreEntry& aDataToWrite );
   254             CPhoneBookStoreEntry& aDataToWrite );
   145 
   255 
   146         /**
   256         /**
   147         * Creates and sends ISI message in order to wite an entry to SIM
   257         * Creates and sends ISI message in order to wite an entry to SIM
   148         *
   258         *
   149         * @param aTraId Transaction id
   259         * @param aTraId Transaction id
   150         * @param aIndex Location index
   260         * @param aIndex Location index
   151         * @return KErrNone or error value
   261         * @param aDataToWrite Entry to write
   152         */
   262         * @return KErrNone or error value
   153         TInt SimPbReqWriteDelete(
   263         */
   154             TUint8 aTraId,
   264         TInt UiccPBReqWriteEntry(
   155             const TInt16 aIndex );
   265                 TUint16 aFileId,
   156 
   266                 TUint8 aIndex,
   157         /**
   267                 TUint8 aTraId,
   158         * Compose 3G data if available
   268                 CPhoneBookStoreEntry& aDataToWrite );
   159         *
   269 
   160         * @param aDataToWrite Entry
   270         /**
   161         * @param aDataPtr Reference to data
   271         * Creates and sends ISI message in order to wite an ext to SIM
   162         * @param aErrVal error value
   272         * @param aFileId File Id
   163         * @return KErrNone or error value
   273         * @param aTraId Transaction id
   164         */
   274         * @param aIndex Location index
   165         TInt Compose3GDataL(
   275         * @param aFileId 
   166             CPhoneBookStoreEntry& aDataToWrite,
   276         * @param aDataToWrite Entry to write
   167             TDes8& aDataPtr
   277         * @return KErrNone or error value
   168 #ifdef INTERNAL_RD_USIM_PHONEBOOK_GAS_AND_AAS
   278         */
   169             ,TInt& aErrVal
   279         TInt UiccPbReqWriteExt(
   170 #endif // INTERNAL_RD_USIM_PHONEBOOK_GAS_AND_AAS
   280                 TUint8 aTraId,
   171              );
   281                 TUint8 aIndex,
   172 
   282                 TUint16 aFileId,
   173         /**
   283                 TUint16 aFileIdExt,
   174         * Count sublock length
   284                 CPhoneBookStoreEntry& aDataToWrite );
   175         *
   285 
   176         * @param aDataToWrite Entry to write
   286         /**
   177         * @param aNumOfSubblocks Number of subblocks
   287         * Creates and sends ISI message in order to read an existing entry Ext record from SIM
   178         * @param aMessageLength MessageLength
   288         *
   179         * @return None
   289         * @param aTraId Transaction id
   180         */
   290         * @param aIndex Location index
   181         void CountSublocksAndMessLength(
   291         * @param aFileId File id
   182             CPhoneBookStoreEntry& aDataToWrite,
   292         * @return KErrNone or error value
   183             TUint8& aNumOfSubblocks,
   293         */
   184             TInt& aMessageLength );
   294         TInt UiccPbReqWriteReadExt(
   185 
   295                 TUint16 aFileId,
   186         /**
   296                 TUint16 aFileIdExt,
   187         * Create SIM_DATA_SIZE_READ_REQ message.
   297                 TUint8 aIndex,
   188         *
   298                 TUint8 aTraId );
   189         * @param aTraId Transaction Id
   299 
   190         * @param aComplete
   300         /**
   191         * @return KErrNone or error value.
   301         * Creates and sends ISI message in order to read an existing entry from SIM
   192         */
   302         *
   193         TInt BuildSimDataSizeReadReqData(
   303         * @param aTraId Transaction id
   194             TUint8 aTraId,
   304         * @param aIndex Location index
   195             TBool& aComplete );
   305         * @param aFileId File id
   196 
   306         * @return KErrNone or error value
   197         /**
   307         */
   198         * Handling error situation
   308         TInt UiccPbReqWriteRead(
   199         *
   309                 TUint16 aFileId,
   200         * @param aIsiMessage ISI message
   310                 TUint8 aIndex,
   201         * @param aStatus Status from ISI message
   311                 TUint8 aTraId );
   202         * @param aSbStartOffSet Offset to data
   312 
   203         * @return KErrNone or error value.
   313         /**
   204         */
   314         * Creates and sends ISI message in order to delete EXT file record releted to PB entry
   205         TInt ErrorStatusHandling(
   315         * @param aTraId Transaction id
   206             const TIsiReceiveC& aIsiMessage,
   316         * @param aIndex Location index
   207             TUint8 aStatus,
   317         * @param aDataToWrite Entry to write
   208             TUint& aSbStartOffSet );
   318         * @return KErrNone or error value
   209 
   319         */
   210         /**
   320         TInt UiccPbReqWriteExtDelete(
   211         * Add tSIM_SB_NAME_NUMBER
   321                 TUint16 aFileId,
   212         *
   322                 TUint16 aFileIdExt,
   213         * @param aSubBlockId Subblock Id
   323                 TUint8 aIndex,
   214         * @param aLocation Location
   324                 TUint8 aTransId );
   215         * @param aName Reference to data name
   325         
   216         * @param aNumber Reference to data number
   326         /**
   217         * @param aDataToAppend Reference to data
   327         * Creates and sends ISI message in order to read MBI Profile form first record
   218         * @return None
   328         * @param aTraId Transaction id
   219         */
   329         * @param aIndex Location index
   220         void AddSimSbNameNumberSubBlock(
   330         * @param aDataToWrite Entry to write
   221             TUint16& aSubBlockId,
   331         * @return KErrNone or error value
   222             TInt16& aLocation,
   332         */
   223             TDesC& aName,
   333         TInt UiccPbReqReadMBI( TUint8 aIndex, TUint8 aTransId );
   224             TDesC& aNumber,
   334 
   225             TDes8& aDataToAppend );
   335         
   226 
   336         /**
   227         /**
   337         * Creates and sends ISI message in order to write MBI Profile form first record
   228         * Add tSIM_SB_TEXT_NUMBER
   338         * @param aTraId Transaction id
   229         *
   339         * @param aIndex Location index
   230         * @param aSubBlockId Reference to subblock data
   340         * @param aDataToWrite Entry to write
   231         * @param aLocation Location
   341         * @return KErrNone or error value
   232         * @param aText Reference to text data
   342         */
   233         * @param aDataToAppend Reference to data
   343         TInt UiccPBReqWriteMBIProfile( TUint8 aTransId, TUint8 aIndex, TUint8 aOperationType );
   234         * @return None
       
   235         */
       
   236         void AddSimSbTextSubBlock(
       
   237             const TUint16& aSubBlockId,
       
   238             TInt16& aLocation,
       
   239             TDesC& aText,
       
   240             TDes8& aDataToAppend );
       
   241 
       
   242         /**
       
   243         * Add tSIM_SB_NUMBER_NUMBER
       
   244         *
       
   245         * @param aLocation Location
       
   246         * @param aNumber Reference to number
       
   247         * @param aAasRecordNumber AAS number
       
   248         * @param aDataToAppend Reference to data
       
   249         * @return None
       
   250         */
       
   251         void AddSimSbNumberSubBlock( const TUint16& aSubBlockId,
       
   252             TInt16& aLocation,
       
   253             TDesC& aNumber,
       
   254 
       
   255 #ifdef INTERNAL_RD_USIM_PHONEBOOK_GAS_AND_AAS
       
   256             TUint8 aAasRecordNumber,
       
   257 #endif // INTERNAL_RD_USIM_PHONEBOOK_GAS_AND_AAS
       
   258             TDes8& aDataToAppend );
       
   259 #ifdef INTERNAL_RD_USIM_PHONEBOOK_GAS_AND_AAS
       
   260 
       
   261         /**
       
   262         * Add tSIM_SB_GROUP_NUMBER
       
   263         *
       
   264         * @param aSubBlockId
       
   265         * @param aGrpLocation
       
   266         * @param aGasLocations
       
   267         * @param aDataToAppend:
       
   268         * @return None
       
   269         */
       
   270         void AddSimSbGroupSubBlock( const TUint16& aSubBlockId,
       
   271             TInt16& aGrpLocation,
       
   272             CArrayFixFlat<TInt>* aGasLocations,
       
   273             TDes8& aDataToAppend );
       
   274 
       
   275         /**
       
   276         * Creates and sends ISI message in order to write alphastring to SIM.
       
   277         *
       
   278         * @param None
       
   279         * @return KErrNone or error value
       
   280         */
       
   281         TInt SimWriteAlphaStringReq();
       
   282 
       
   283         /**
       
   284         * Receives SIM_PB_RESP(SIM_PB_WRITE) ISI messages from phonet receiver
       
   285         *
       
   286         * @param aIsiMessage Reference to the received message.
       
   287         * @return KErrNone or error code
       
   288         */
       
   289         TInt SimWriteAlphaStringRespL( const TIsiReceiveC& aIsiMessage );
       
   290 #endif // INTERNAL_RD_USIM_PHONEBOOK_GAS_AND_AAS
       
   291 
       
   292 
       
   293     public:     // Data
   344     public:     // Data
   294         // None
   345         // None
   295 
   346 
   296     protected:  // Data
   347     protected:  // Data
   297         // none
   348         // none
   301         // Attribute to hold the write enty while delete -request is on
   352         // Attribute to hold the write enty while delete -request is on
   302         CPhoneBookStoreEntry* iPhoneBookEntry;
   353         CPhoneBookStoreEntry* iPhoneBookEntry;
   303 
   354 
   304         // Keep track on current write -phase
   355         // Keep track on current write -phase
   305         TPBWritePhases iCurrentWritePhase;
   356         TPBWritePhases iCurrentWritePhase;
       
   357         
       
   358         // Array to Store new EXT records
       
   359         RArray<TInt> iExtRecordArrayToBeWrite;
       
   360         
       
   361         // Array to store EXT record nos to be delete
       
   362        RArray<TInt> iExtRecordArrayToBeDelete; 
       
   363        
       
   364        // EXT record number to be read
       
   365        TInt iExtRecordNo;
       
   366        
       
   367        // Store the no of ext records already written
       
   368        TUint8 iExtRecordWritten;
       
   369        
       
   370        // Attribute Store the information if it is location search
       
   371        TBool iLocationSearch;
       
   372        
       
   373        // Attribute to store the information if delete EXT operation going on 
       
   374        TBool iExtDeleteOperation;
       
   375        
       
   376        // For Free Entry Search
       
   377        TInt iEntryToWrite;
       
   378        
       
   379        // To Store Entry to update List
       
   380        TPBEntry* iEntryToUpdateInList; 
       
   381        
       
   382        // to store the MBI operation
       
   383        TUint8 iMBIOperation;
   306 };
   384 };
   307 
   385 
   308 #endif // CMMPHONEBOOKOPERATIONWRITE_H
   386 #endif // CMMPHONEBOOKOPERATIONWRITE_H
   309 
   387 
   310 // End of file
   388 // End of file