sapi_applicationmanager/inc/appinfomap.h
changeset 0 14df0fbfcc4e
equal deleted inserted replaced
-1:000000000000 0:14df0fbfcc4e
       
     1 /*
       
     2 * Copyright (c) 2007-2007 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 the License "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 CLiwMap type
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __CAPPINFOMAP_H
       
    20 #define __CAPPINFOMAP_H
       
    21 
       
    22 #include <Liwgenericparam.h> 
       
    23 
       
    24 class MInfoMap;
       
    25 
       
    26 /**
       
    27  *  This class implements the abstract methods of CLiwIterable   
       
    28  *  class so that the user may iterate over the result 
       
    29  *  
       
    30  *  @since Series60 v3.2
       
    31  */
       
    32 NONSHARABLE_CLASS( CAppInfoMap ) : public CLiwMap
       
    33     {
       
    34 
       
    35 public:
       
    36        
       
    37     /**
       
    38      * Two-phased constructor.
       
    39      * @param aIter holds a reference to the item list 
       
    40      * @return A pointer of type CAppItemsList
       
    41      */
       
    42      static CAppInfoMap* NewL( MInfoMap* aIter );
       
    43     
       
    44     /**
       
    45     * Destructor.
       
    46     */
       
    47     ~CAppInfoMap();
       
    48 
       
    49     /**
       
    50     * Inserts a key-value pair element to the map collection. A default
       
    51     * implementation is provided in \c CLiwDefaultMap.
       
    52     *  
       
    53     * @param aKey the key to be stored
       
    54     * @param aValue the value associated with the key to be stored
       
    55     *
       
    56     * @see CLiwDefaultMap::InsertL
       
    57    */
       
    58     virtual void InsertL(const TDesC8& aKey, const TLiwVariant& aValue);
       
    59  
       
    60     /**
       
    61     * Finds a value stored in the map collection based on the key. 
       
    62     *  
       
    63     * @param aKey the key to be searched
       
    64     * @param aFndValue the value associated with the found key
       
    65     *
       
    66     * @return false if there is no key stored; true otherwise
       
    67     *
       
    68     */
       
    69     virtual TBool FindL(const TDesC8& aKey, TLiwVariant& aFndValue) const;
       
    70   
       
    71     /**
       
    72     * Returns the number of key-value pair stored in the map collection. 
       
    73     *  
       
    74     * @return the number of key-value pair stored in the map collection
       
    75     *
       
    76     */
       
    77     virtual TInt Count() const ;
       
    78   
       
    79     /**
       
    80     * Returns the key stored at the passed index. 
       
    81     *  
       
    82     * @param aIndex the index of the key to be found
       
    83     * @param aFndKey the key found at the passed index
       
    84     *
       
    85     * @return true if a key-value entry is found at the passed index;
       
    86     * false otherwise
       
    87     *
       
    88     * 
       
    89     */
       
    90     virtual TBool AtL(TInt aIndex, TDes8& aFndKey) const;
       
    91   
       
    92     /**
       
    93     * Removes a key from the map collection. A default
       
    94     * implementation is provided in \c CLiwDefaultMap.
       
    95     *  
       
    96     * @param aKey the key to be removed from the map
       
    97     *
       
    98     */
       
    99     
       
   100     
       
   101     /**
       
   102     * Removes a key from the map collection. A default
       
   103     * implementation is provided in \c CLiwDefaultMap.
       
   104     *  
       
   105     * @param aKey the key to be removed from the map
       
   106     *
       
   107     * @see CLiwDefaultMap::Remove
       
   108    */
       
   109     virtual void Remove(const TDesC8& aKey);
       
   110   
       
   111     /**
       
   112     * Default implementation of equality operator.
       
   113     *  
       
   114     * @param aMap the map to be compared
       
   115     *
       
   116     * @see CLiwDefaultMap::operator==
       
   117     * 
       
   118     */
       
   119     virtual TBool operator==(const CLiwMap& aMap) const;
       
   120 
       
   121 private:
       
   122     
       
   123      /**
       
   124      * Parameterised constructor
       
   125      * @since  Series60 v3.2
       
   126      * @param  aIter holds a reference to the item list model
       
   127      */
       
   128     
       
   129      CAppInfoMap( MInfoMap* aIter );
       
   130     
       
   131 private: // data
       
   132 
       
   133      /**
       
   134      * A pointer to Iterator of core class
       
   135      */
       
   136      MInfoMap* iMap;
       
   137    
       
   138     };
       
   139 
       
   140 #endif // __CAPPINFOMAP_H