javaextensions/satsa/apdu/src.s60/cstsfile.h
branchRCL_3
changeset 14 04becd199f91
equal deleted inserted replaced
13:f5050f1da672 14:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 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:
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CSTSFILE_H
       
    20 #define CSTSFILE_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include "cstsasn1sequence.h"
       
    24 
       
    25 namespace java
       
    26 {
       
    27 namespace satsa
       
    28 {
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 class MSTSASN1Module;
       
    32 class CSTSFileDataManager;
       
    33 
       
    34 // CLASS DECLARATION
       
    35 /**
       
    36  *  Abstract card file class for handling file selection, reading and data
       
    37  *  decoding.
       
    38  *
       
    39  *  @since 3.0
       
    40  */
       
    41 NONSHARABLE_CLASS(CSTSFile): public CSTSASN1Sequence
       
    42 {
       
    43 public: // Constructors and destructor
       
    44 
       
    45     /**
       
    46      * Destructor.
       
    47      */
       
    48     virtual ~CSTSFile();
       
    49 
       
    50 public: // New functions
       
    51 
       
    52     /**
       
    53      * Reads file and decodes it's data and appends decoded data to
       
    54      * array.
       
    55      * @since 3.0
       
    56      * @param aMaxValidDataAmount Maximum amount of valid data which
       
    57      * will be appended to array.
       
    58      */
       
    59     void ReadL(TInt aMaxValidDataAmount);
       
    60 
       
    61     /**
       
    62      * Getter for amount of found suitable records
       
    63      * @since 3.0
       
    64      * @return Amount of found records
       
    65      */
       
    66     TInt FoundRecords() const;
       
    67 
       
    68 public: // Functions from base classes
       
    69 
       
    70 
       
    71     /**
       
    72      * From MSTSASN1Module
       
    73      * @since 3.0
       
    74      * @param aRawData raw-data to be parsed in this instance
       
    75      */
       
    76     void DecodeL(const TDesC8& aRawData);
       
    77 
       
    78 protected: //New fuctions
       
    79 
       
    80     /**
       
    81      * C++ default constructor.
       
    82      */
       
    83     CSTSFile();
       
    84 
       
    85     /**
       
    86      * Decodes current row and appends decoded object to array, if
       
    87      * it is wanted object. Derived class must implement this.
       
    88      * @since 3.0
       
    89      * @param aRowData Row data in bytes
       
    90      * @param aMaxValidDataAmount Maximum amount of valid data which
       
    91      * will be appended to array. Must be set to zero if all found
       
    92      * data can be appended.
       
    93      * @return True if all valid data is found, EFalse if not
       
    94      */
       
    95     virtual TBool DecodeAndAppendRowL(
       
    96         const TDesC8& aRowData,
       
    97         TInt aMaxValidDataAmount) = 0;
       
    98 
       
    99     /**
       
   100      * Resets readed file data which is saved to member variable.
       
   101      * Derived class must implement this.
       
   102      * @since 3.0
       
   103      */
       
   104     virtual void ResetData() = 0;
       
   105 
       
   106     /**
       
   107      * Gets content of the file. Derived class must implement this.
       
   108      * @since 3.0
       
   109      */
       
   110     virtual const TDesC8& RetrieveContentL() = 0;
       
   111 
       
   112 private: //New fuctions
       
   113 
       
   114 protected: // Data
       
   115 
       
   116     TPtrC8 iPath;
       
   117 
       
   118     CSTSFileDataManager* iFileDataManager; //not owned
       
   119 
       
   120     TUint16 iFileSize;
       
   121 
       
   122     TInt iFoundRecords;
       
   123 
       
   124 private: // Data
       
   125 
       
   126     HBufC8 * iDataBuf; //owned
       
   127     TInt iMaxValidDataAmount;
       
   128 
       
   129 };
       
   130 
       
   131 } // namespace satsa
       
   132 } // namespace java
       
   133 #endif // CSTSFILE_H
       
   134 // End of File
       
   135