httpfilters/cookie/ManagerInc/CookieClientDataArray.h
changeset 27 974c3ee9bf20
equal deleted inserted replaced
23:ea9c9681bbaf 27:974c3ee9bf20
       
     1 /*
       
     2  * CookieClientDataArray.h
       
     3  *
       
     4  *  Created on: Dec 18, 2009
       
     5  *      Author: mohanti
       
     6  */
       
     7 
       
     8 #ifndef COOKIECLIENTDATAARRAY_H_
       
     9 #define COOKIECLIENTDATAARRAY_H_
       
    10 
       
    11 //System Includes
       
    12 
       
    13 //User Includes
       
    14 
       
    15 //Forward Class Declaration
       
    16 class CCookieClientData;
       
    17 class CCookieArray;
       
    18 
       
    19 //This class holds an array of CCookieClientdata objects.
       
    20 //This a singleton class and is allocated in the Thread local storage(TLS)
       
    21 
       
    22 NONSHARABLE_CLASS( CCookieClientDataArray ):public CBase
       
    23     {
       
    24 public:
       
    25     
       
    26     /* Constructor 
       
    27      * 
       
    28      */
       
    29 
       
    30      static CCookieClientDataArray* New();
       
    31 
       
    32 	/* Initialization
       
    33      *
       
    34 	 */
       
    35 	void Init();
       
    36          
       
    37     ~CCookieClientDataArray();
       
    38     
       
    39     /* Constructor
       
    40      * 
       
    41      */
       
    42     CCookieClientDataArray();
       
    43 
       
    44     /* Finds the address of CCookieClientData object from the array based on group id and appuid
       
    45      * @param aGroupId Indicates group id
       
    46      * @param aWidgetUid Indicates appuid
       
    47      */
       
    48     CCookieClientData*  Find(const TUint32& aGroupId,const TUint32& aWidgetUid);
       
    49     
       
    50     /* Finds the Index of CCookieClientData object from the array based on group id and appuid
       
    51      * @param aGroupId Indicates Group Id 
       
    52      * @param aWidgetUid Indicates Appuid
       
    53      * @param aIndex On return of the method,it indicates the index no where the intended 
       
    54      *        CCookieClientData Object is present
       
    55      */
       
    56     TInt FindIndex(const TUint32& aGroupId, const TUint32& aWidgetUid,TInt& aIndex );
       
    57 
       
    58     /* Adding CCookieClientData object in to the array.
       
    59      * @param aCookieClientData Indiactes the address of CCookieClientData Object
       
    60      */
       
    61     void AddClientGroupDataL(CCookieClientData* aCookieClientData);
       
    62     
       
    63     /* Returns the CCookieClientData object from the array based on index no.
       
    64      * @param aIndex Indiactes index no.
       
    65      */
       
    66     CCookieClientData* At(TInt aIndex) const;
       
    67     
       
    68     /* Subscripting operator
       
    69      * 
       
    70      */
       
    71     CCookieClientData* operator[](TInt aIndex) const;
       
    72     
       
    73     /* Returns the no of CCookieClientData object in the array
       
    74      * 
       
    75      */
       
    76     TInt Count()const;
       
    77     
       
    78     /* Returns the cookiearray from the array based on the index no.
       
    79      * @param aIndex indeicates the index no
       
    80      */
       
    81     CCookieArray* CookieArray(TInt aIndex); 
       
    82     
       
    83     /* Removes a CCookieClientData object from the array based on index no.
       
    84      * 
       
    85      */
       
    86     void Remove(TInt aIndex);
       
    87     
       
    88     /* Compresses the array
       
    89      * 
       
    90      */
       
    91     void Compress();
       
    92     
       
    93     /* Deletes a CCookieClientData object from the array based on appuid 
       
    94      * @param aAppUid Indicates appuid of a Secure Widget.
       
    95      */
       
    96     TInt DestroyClientData(const TUint32 aAppUid);
       
    97 protected:
       
    98     
       
    99 private:
       
   100 
       
   101     /* Constructor
       
   102      * 
       
   103      */
       
   104     CCookieClientDataArray(const CCookieClientDataArray&);
       
   105     
       
   106     /* Assignment operator
       
   107      * 
       
   108      */
       
   109     CCookieClientDataArray& operator=(const CCookieClientDataArray&);
       
   110 public:
       
   111     
       
   112 protected:
       
   113     
       
   114 private:
       
   115     RPointerArray<CCookieClientData>* iCookieClientData;
       
   116     };
       
   117 
       
   118 
       
   119 #endif /* COOKIECLIENTDATAARRAY_H_ */