|
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 static CCookieClientDataArray* GetInstance(); |
|
30 |
|
31 /* Reference Count method |
|
32 * |
|
33 */ |
|
34 inline void Ref(){++iRefCount;} |
|
35 |
|
36 /*Dereference count method and will delete the CCookieClientDataArray object once the iRefCount is zero |
|
37 * |
|
38 */ |
|
39 void DeRef(); |
|
40 |
|
41 /* Destructor |
|
42 * |
|
43 */ |
|
44 ~CCookieClientDataArray(); |
|
45 |
|
46 /* Constructor |
|
47 * |
|
48 */ |
|
49 CCookieClientDataArray(); |
|
50 |
|
51 /* Finds the address of CCookieClientData object from the array based on group id and appuid |
|
52 * @param aGroupId Indicates group id |
|
53 * @param aWidgetUid Indicates appuid |
|
54 */ |
|
55 CCookieClientData* Find(const TUint32& aGroupId,const TUint32& aWidgetUid); |
|
56 |
|
57 /* Finds the Index of CCookieClientData object from the array based on group id and appuid |
|
58 * @param aGroupId Indicates Group Id |
|
59 * @param aWidgetUid Indicates Appuid |
|
60 * @param aIndex On return of the method,it indicates the index no where the intended |
|
61 * CCookieClientData Object is present |
|
62 */ |
|
63 TInt FindIndex(const TUint32& aGroupId, const TUint32& aWidgetUid,TInt& aIndex ); |
|
64 |
|
65 /* Adding CCookieClientData object in to the array. |
|
66 * @param aCookieClientData Indiactes the address of CCookieClientData Object |
|
67 */ |
|
68 void AddClientGroupDataL(CCookieClientData* aCookieClientData); |
|
69 |
|
70 /* Returns the CCookieClientData object from the array based on index no. |
|
71 * @param aIndex Indiactes index no. |
|
72 */ |
|
73 CCookieClientData* At(TInt aIndex) const; |
|
74 |
|
75 /* Subscripting operator |
|
76 * |
|
77 */ |
|
78 CCookieClientData* operator[](TInt aIndex) const; |
|
79 |
|
80 /* Returns the no of CCookieClientData object in the array |
|
81 * |
|
82 */ |
|
83 TInt Count()const; |
|
84 |
|
85 /* Returns the cookiearray from the array based on the index no. |
|
86 * @param aIndex indeicates the index no |
|
87 */ |
|
88 CCookieArray* CookieArray(TInt aIndex); |
|
89 |
|
90 /* Removes a CCookieClientData object from the array based on index no. |
|
91 * |
|
92 */ |
|
93 void Remove(TInt aIndex); |
|
94 |
|
95 /* Compresses the array |
|
96 * |
|
97 */ |
|
98 void Compress(); |
|
99 |
|
100 /* Deletes a CCookieClientData object from the array based on appuid |
|
101 * @param aAppUid Indicates appuid of a Secure Widget. |
|
102 */ |
|
103 TInt DestroyClientData(const TUint32 aAppUid); |
|
104 protected: |
|
105 |
|
106 private: |
|
107 /* Constructor |
|
108 * |
|
109 */ |
|
110 CCookieClientDataArray(const CCookieClientDataArray&); |
|
111 |
|
112 /* Assignment operator |
|
113 * |
|
114 */ |
|
115 CCookieClientDataArray& operator=(const CCookieClientDataArray&); |
|
116 public: |
|
117 |
|
118 protected: |
|
119 |
|
120 private: |
|
121 TInt iRefCount; |
|
122 RPointerArray<CCookieClientData>* iCookieClientData; |
|
123 }; |
|
124 |
|
125 |
|
126 #endif /* COOKIECLIENTDATAARRAY_H_ */ |