1 /* |
|
2 * Copyright (c) 2006-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 "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: Capsulating sql items |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 #ifndef __CMSQLGENERICITEM_H |
|
24 #define __CMSQLGENERICITEM_H |
|
25 |
|
26 // INCLUDES |
|
27 #include <e32base.h> |
|
28 #include "cmsqlbaseitem.h" |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class CCmSqlItemResource; |
|
32 |
|
33 /** |
|
34 * CCmSqlGenericItem class |
|
35 * Capsulating sql items |
|
36 * @lib cmcommon.lib |
|
37 * @since S60 v3.0 |
|
38 */ |
|
39 class CCmSqlGenericItem : public CCmSqlBaseItem |
|
40 { |
|
41 |
|
42 public: |
|
43 |
|
44 /* Constructors and destructor. */ |
|
45 |
|
46 /** |
|
47 * Creates new CCmSqlGenericItem class. |
|
48 * @param Nonw |
|
49 * @return pointer to CCmSqlGenericItem class |
|
50 */ |
|
51 IMPORT_C static CCmSqlGenericItem* NewL(); |
|
52 |
|
53 /** |
|
54 * Creates new CCmSqlGenericItem class and |
|
55 * leaves the instance in the cleanup stack. |
|
56 * @return pointer to CCmSqlGenericItem class |
|
57 */ |
|
58 IMPORT_C static CCmSqlGenericItem* NewLC(); |
|
59 |
|
60 /** |
|
61 * Destructor. |
|
62 */ |
|
63 IMPORT_C virtual ~CCmSqlGenericItem(); |
|
64 |
|
65 public: |
|
66 |
|
67 /** |
|
68 * Sets size of the item |
|
69 * @since Series 60 3.1 |
|
70 * @param aSize, size in bytes |
|
71 * @return None |
|
72 */ |
|
73 IMPORT_C void SetSize( const TInt aSize ); |
|
74 |
|
75 /** |
|
76 * Sets title of the item |
|
77 * @since Series 60 3.1 |
|
78 * @param aTitle, Metadata title |
|
79 * @return None |
|
80 */ |
|
81 IMPORT_C void SetTitleL( const TDesC8& aTitle ); |
|
82 |
|
83 /** |
|
84 * Sets date |
|
85 * @since Series 60 3.1 |
|
86 * @param aDate, date |
|
87 * @return None |
|
88 */ |
|
89 IMPORT_C void SetDate( const TTime& aDate ); |
|
90 |
|
91 /** |
|
92 * Sets harvesting time |
|
93 * @since Series 60 3.1 |
|
94 * @param aHarvestDate, harvesting time |
|
95 * @return None |
|
96 */ |
|
97 IMPORT_C void SetHarvestDate( const TTime& aHarvestDate ); |
|
98 |
|
99 /** |
|
100 * Sets upnp class id |
|
101 * @since Series 60 3.1 |
|
102 * @param aUpnpclassId, id values of the upnp class |
|
103 * @return None |
|
104 */ |
|
105 IMPORT_C void SetUpnpclassId( const TInt64 aUpnpclassId ); |
|
106 |
|
107 /** |
|
108 * Sets upnp profile id |
|
109 * @since Series 60 3.1 |
|
110 * @param aUpnpProfileId, id values of the upnp profile |
|
111 * @return None |
|
112 */ |
|
113 IMPORT_C void SetUpnpProfileId( const TInt64 aUpnpProfileId ); |
|
114 |
|
115 /** |
|
116 * Sets Item uri |
|
117 * @since Series 60 3.1 |
|
118 * @param aUri, Item uri |
|
119 * @return None |
|
120 */ |
|
121 IMPORT_C void SetUriL( const TDesC8& aUri ); |
|
122 |
|
123 /** |
|
124 * Sets media type of the item |
|
125 * @since Series 60 3.1 |
|
126 * @param aMType, media type |
|
127 * @return None |
|
128 */ |
|
129 IMPORT_C void SetMediaType( const TCmMediaType aMType ); |
|
130 |
|
131 /** |
|
132 * Creates new resource for the item |
|
133 * @since Series 60 3.1 |
|
134 * @param aUri, uri of the resource |
|
135 * @param aSize, size of the resource |
|
136 * @param aDuration, duration of the resource |
|
137 * @param aBitrate, bitrate of the resource |
|
138 * @param aResolutionId, id to right resolution |
|
139 * @return None |
|
140 */ |
|
141 IMPORT_C void NewResourceL( const TDesC8& aUri, |
|
142 const TInt aSize, const TInt aDuration, const TInt aBitrate, |
|
143 const TInt64 aResolutionId ); |
|
144 |
|
145 /** |
|
146 * Gets size of the item |
|
147 * @since Series 60 3.1 |
|
148 * @return Size |
|
149 */ |
|
150 IMPORT_C TInt Size() const; |
|
151 |
|
152 /** |
|
153 * Gets Title of the item |
|
154 * @since Series 60 3.1 |
|
155 * @return Title |
|
156 */ |
|
157 IMPORT_C TDesC8& Title() const; |
|
158 |
|
159 /** |
|
160 * Gets date |
|
161 * @since Series 60 3.1 |
|
162 * @return Date |
|
163 */ |
|
164 IMPORT_C TTime Date() const; |
|
165 |
|
166 /** |
|
167 * Gets harvest date |
|
168 * @since Series 60 3.1 |
|
169 * @return Harvesting date |
|
170 */ |
|
171 IMPORT_C TTime HarvestDate() const; |
|
172 |
|
173 /** |
|
174 * Gets upnp class id |
|
175 * @since Series 60 3.1 |
|
176 * @return Upnp class id |
|
177 */ |
|
178 IMPORT_C TInt64 UpnpclassId() const; |
|
179 |
|
180 /** |
|
181 * Gets upnp profile id |
|
182 * @since Series 60 3.1 |
|
183 * @param None |
|
184 * @return Upnp profile id |
|
185 */ |
|
186 IMPORT_C TInt64 UpnpProfileId( ) const; |
|
187 |
|
188 /** |
|
189 * Gets item uri |
|
190 * @since Series 60 3.1 |
|
191 * @return Item uri |
|
192 */ |
|
193 IMPORT_C TDesC8& Uri() const; |
|
194 |
|
195 /** |
|
196 * Gets media type |
|
197 * @since Series 60 3.1 |
|
198 * @return Media type |
|
199 */ |
|
200 IMPORT_C TCmMediaType MediaType() const; |
|
201 |
|
202 /** |
|
203 * Gets count of resources |
|
204 * @since Series 60 3.1 |
|
205 * @return Resource count |
|
206 */ |
|
207 IMPORT_C TInt ResourceCount() const; |
|
208 |
|
209 /** |
|
210 * Gets resource data |
|
211 * @since Series 60 3.1 |
|
212 * @param aUri, uri of the resource |
|
213 * @param aSize, size of the resource |
|
214 * @param aDuration, duration of the resource |
|
215 * @param aBitrate, bitrate of the resource |
|
216 * @param aResolutionId, resolution id of the resource |
|
217 * @param aIndex, index of the resource |
|
218 * @return None |
|
219 */ |
|
220 IMPORT_C void GetResource( TDesC8& aUri, TInt& aSize, |
|
221 TInt& aDuration, TInt& aBitrate, TInt64& aResolutionId, TInt aIndex ); |
|
222 |
|
223 protected: |
|
224 |
|
225 /** |
|
226 * Constructor. |
|
227 */ |
|
228 CCmSqlGenericItem(); |
|
229 |
|
230 /** |
|
231 * Second-phase constructor. |
|
232 */ |
|
233 void ConstructL(); |
|
234 |
|
235 |
|
236 protected: // data |
|
237 |
|
238 // Size of the item in bytes |
|
239 TInt iSize; |
|
240 |
|
241 // Title |
|
242 HBufC8* iTitle; // owned |
|
243 |
|
244 // Date |
|
245 TTime iDate; |
|
246 |
|
247 // Date |
|
248 TTime iHarvestDate; |
|
249 |
|
250 // Upnp class id |
|
251 TInt64 iUpnpclassId; |
|
252 |
|
253 // Upnp profile id |
|
254 TInt64 iUpnpProfileId; |
|
255 |
|
256 // Search id |
|
257 TInt64 iSearchId; |
|
258 |
|
259 // Uri |
|
260 HBufC8* iUri; // owned |
|
261 |
|
262 // Media type |
|
263 TCmMediaType iMType; |
|
264 |
|
265 // Resource array |
|
266 RPointerArray<CCmSqlItemResource> iResources; // items owned |
|
267 |
|
268 }; |
|
269 |
|
270 #endif // __CMSQLGENERICITEM_H |
|