|
1 /* |
|
2 * Copyright (c) 2005 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: CXcapCacheIndexEntry |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __XCAPCACHEINDEXENTRY_H__ |
|
22 #define __XCAPCACHEINDEXENTRY_H__ |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32std.h> |
|
26 #include <s32file.h> |
|
27 //#include "XcapCacheClient.h" |
|
28 |
|
29 //CONSTANTS |
|
30 const TUint KCacheEntryETag = 0; |
|
31 const TUint KCacheXmlSize = 1; |
|
32 const TUint KCacheXmlFile = 2; |
|
33 const TUint KCacheLastAccess = 3; |
|
34 const TUint KCacheLastModified = 4; |
|
35 |
|
36 //ENUMS |
|
37 enum TCacheIndexEntry |
|
38 { |
|
39 EEntryETag = KCacheEntryETag, |
|
40 EEntryXmlSize = KCacheXmlSize, |
|
41 EEntryXmlFile = KCacheXmlFile, |
|
42 EEntryLastAccess = KCacheLastAccess, |
|
43 EEntryLastModified = KCacheLastModified |
|
44 }; |
|
45 |
|
46 //Specifies the cache file "protocol" |
|
47 const TText8* const KCacheEntryArray[] = { _S8( "etag" ), |
|
48 _S8( "size" ), |
|
49 _S8( "file" ), |
|
50 _S8( "access" ), |
|
51 _S8( "modify" ) |
|
52 }; |
|
53 |
|
54 //FORWARD DECLARATIONs |
|
55 class CXcapCacheEntryProperty; |
|
56 |
|
57 // CLASS DECLARATION |
|
58 NONSHARABLE_CLASS( CXcapCacheIndexEntry ) : public CBase |
|
59 { |
|
60 public: // Constructors and destructor |
|
61 |
|
62 /** |
|
63 * Returns the MIME type of the messages |
|
64 * @return TPtrC8 The MIME type of the messages |
|
65 */ |
|
66 static CXcapCacheIndexEntry* NewL( const TCacheEntryInfo* aHeader ); |
|
67 |
|
68 /** |
|
69 * Returns the MIME type of the messages |
|
70 * @return TPtrC8 The MIME type of the messages |
|
71 */ |
|
72 static CXcapCacheIndexEntry* NewL( TPtr8& aEntryData ); |
|
73 |
|
74 /** |
|
75 * Returns the MIME type of the messages |
|
76 * @return TPtrC8 The MIME type of the messages |
|
77 */ |
|
78 void UpdateEntryL( const TCacheEntryInfo* aHeader ); |
|
79 |
|
80 /** |
|
81 * Returns the MIME type of the messages |
|
82 * @return TPtrC8 The MIME type of the messages |
|
83 */ |
|
84 TTime LastAccess() const; |
|
85 |
|
86 /** |
|
87 * Returns the MIME type of the messages |
|
88 * @return TPtrC8 The MIME type of the messages |
|
89 */ |
|
90 TTime LastModified() const; |
|
91 |
|
92 /** |
|
93 * Returns the MIME type of the messages |
|
94 * @return TPtrC8 The MIME type of the messages |
|
95 */ |
|
96 TInt XmlSize() const; |
|
97 |
|
98 /** |
|
99 * Returns the MIME type of the messages |
|
100 * @return TPtrC8 The MIME type of the messages |
|
101 */ |
|
102 TPtrC8 ETag() const; |
|
103 |
|
104 /** |
|
105 * Returns the MIME type of the messages |
|
106 * @return TPtrC8 The MIME type of the messages |
|
107 */ |
|
108 TPtrC8 FileNameL() const; |
|
109 |
|
110 /** |
|
111 * Returns the MIME type of the messages |
|
112 * @return TPtrC8 The MIME type of the messages |
|
113 */ |
|
114 TPtrC FileName16L() const; |
|
115 |
|
116 /** |
|
117 * Returns the MIME type of the messages |
|
118 * @return TPtrC8 The MIME type of the messages |
|
119 */ |
|
120 HBufC8* PrintLC() const; |
|
121 |
|
122 /** |
|
123 * Returns the MIME type of the messages |
|
124 * @return TPtrC8 The MIME type of the messages |
|
125 */ |
|
126 ~CXcapCacheIndexEntry(); |
|
127 |
|
128 private: |
|
129 |
|
130 /** |
|
131 * Returns the MIME type of the messages |
|
132 * @return TPtrC8 The MIME type of the messages |
|
133 */ |
|
134 void ConstructL( const TCacheEntryInfo* aHeader ); |
|
135 |
|
136 /** |
|
137 * Returns the MIME type of the messages |
|
138 * @return TPtrC8 The MIME type of the messages |
|
139 */ |
|
140 void ConstructL( TPtr8& aEntryData ); |
|
141 |
|
142 /** |
|
143 * Returns the MIME type of the messages |
|
144 * @return TPtrC8 The MIME type of the messages |
|
145 */ |
|
146 CXcapCacheIndexEntry(); |
|
147 |
|
148 /** |
|
149 * Returns the MIME type of the messages |
|
150 * @return TPtrC8 The MIME type of the messages |
|
151 */ |
|
152 CXcapCacheEntryProperty* CreatePropertyL( const TInt aPropertyName, |
|
153 const TDesC8& aPropertyValue ); |
|
154 |
|
155 /** |
|
156 * Returns the MIME type of the messages |
|
157 * @return TPtrC8 The MIME type of the messages |
|
158 */ |
|
159 void CreateFromHeaderL( const TCacheEntryInfo* aHeader ); |
|
160 |
|
161 /** |
|
162 * Returns the MIME type of the messages |
|
163 * @return TPtrC8 The MIME type of the messages |
|
164 */ |
|
165 const CXcapCacheEntryProperty& FindProperty( const TInt aPropId ) const; |
|
166 |
|
167 /** |
|
168 * Returns the MIME type of the messages |
|
169 * @return TPtrC8 The MIME type of the messages |
|
170 */ |
|
171 TInt FindPropNameId( const TDesC8& aNameString ) const; |
|
172 |
|
173 /** |
|
174 * Returns the MIME type of the messages |
|
175 * @return TPtrC8 The MIME type of the messages |
|
176 */ |
|
177 HBufC8* HourStringLC(); |
|
178 |
|
179 /** |
|
180 * Returns the MIME type of the messages |
|
181 * @return TPtrC8 The MIME type of the messages |
|
182 */ |
|
183 void DeleteFileL( const TDesC8& aFileName ); |
|
184 |
|
185 /** |
|
186 * Second-phase constructor. |
|
187 */ |
|
188 HBufC8* StoreXmlFileLC( const TDesC8& aXmlData ); |
|
189 |
|
190 private: // Data |
|
191 |
|
192 RPointerArray<CXcapCacheEntryProperty> iPropertyList; |
|
193 }; |
|
194 |
|
195 #endif |
|
196 |
|
197 // End of File |