wim/WimPlugin/inc/WimCertStoreMappings.h
changeset 0 164170e6151a
equal deleted inserted replaced
-1:000000000000 0:164170e6151a
       
     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:  Implements a class managing mapping entries which contain
       
    15 *                information of certificates with trusted settings
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef WIMCERTSTOREMAPPINGS_H
       
    21 #define WIMCERTSTOREMAPPINGS_H
       
    22 
       
    23 // INCLUDES 
       
    24 
       
    25 #include "WimCertStoreMapping.h"
       
    26 #include <s32file.h>
       
    27 
       
    28 // CLASS DECLARATION
       
    29 
       
    30 /**
       
    31 * This class manages the entries in an internal array
       
    32 * where the data of the certificate is stored.
       
    33 *
       
    34 *
       
    35 *  @lib   WimPlugin
       
    36 *  @since Series60 2.1
       
    37 */
       
    38 class CWimCertStoreMappings : public CBase
       
    39     {
       
    40     public: 
       
    41 
       
    42         /**
       
    43         * Constructor
       
    44         */
       
    45         static CWimCertStoreMappings* NewL();
       
    46 
       
    47         /**
       
    48         * Destructor
       
    49         */
       
    50         ~CWimCertStoreMappings();
       
    51 
       
    52     public: 
       
    53 
       
    54         /**
       
    55         * Returns the count of mapping entries in the array
       
    56         * @return A integer value
       
    57         */
       
    58         TInt Count() const;
       
    59 
       
    60         /**
       
    61         * Adds a new mapping entry in the array
       
    62         * @param  aEntry (IN) One mapping entry
       
    63         * @return void
       
    64         */
       
    65         void AddL( const CWimCertStoreMapping* aEntry );
       
    66 
       
    67         /**
       
    68         * Removes an mapping entry from the array
       
    69         * @param   aEntry The entry to delete
       
    70         * @return  KErrNotFound if aEntry is not found in the array 
       
    71         *          KErrNone is the entry was successfully deleted.
       
    72         */
       
    73         //TInt Remove( const CCTCertInfo& aEntry );
       
    74 
       
    75         /**
       
    76         * Updates a new entry in the array
       
    77         * @param  aEntry (IN) One certificate info
       
    78         * @return void
       
    79         */
       
    80         void UpdateL( const CCTCertInfo& aEntry );
       
    81 
       
    82         /**
       
    83         * Returns the index in the array. The function goes through
       
    84         * the array entries and returns the index of the first entry whose 
       
    85         * label matches the label of aEntry.
       
    86         * @param   aEntry The certificate info in the mapping entry
       
    87         *          we want the index of.
       
    88         * @return  The index of mapping entry in the array.
       
    89         */
       
    90         TInt Index( const CCTCertInfo& aEntry );
       
    91 
       
    92         /**
       
    93         * Returns one mapping entry from the array. 
       
    94         * @param   aIndex The index of the mapping
       
    95         * @return  The mapping from the array.
       
    96         */
       
    97         CWimCertStoreMapping* Mapping( TInt aIndex );
       
    98     
       
    99         /**
       
   100         * Returns certificate info from the array in the given index. 
       
   101         * @param   aIndex The index of the certificate info
       
   102         * @return  The certificate from the array.
       
   103         */
       
   104         const CCTCertInfo& Entry( TInt aIndex );
       
   105 
       
   106         /**
       
   107         * Returns certificate info from the array using given handle. 
       
   108         * @param   aHandle The handle of the mapping
       
   109         * @return  The certificate from the array.
       
   110         */
       
   111         const CCTCertInfo& EntryByHandleL( TInt aHandle ) const;
       
   112 
       
   113         /**
       
   114         * Returns next available handle that can be used for 
       
   115         * adding a new mapping in to the array
       
   116         * @return  A integer value of new handle.
       
   117         */
       
   118         //TInt NextHandle() const;
       
   119 
       
   120     private:
       
   121 
       
   122         /**
       
   123         *   Second phase constructor
       
   124         */
       
   125         void ConstructL();
       
   126 
       
   127         /**
       
   128         *   Default constructor
       
   129         */
       
   130         CWimCertStoreMappings();
       
   131 
       
   132         // An internal array of mapping entries
       
   133         RPointerArray<CWimCertStoreMapping> iMappings;
       
   134     };
       
   135 
       
   136 #endif // WIMCERTSTOREMAPPINGS_H
       
   137 
       
   138 // End of file