187 } |
184 } |
188 //Size property |
185 //Size property |
189 CMdEPropertyDef& sizePropDef = aObjectDef.GetPropertyDefL(MdeConstants::Object::KSizeProperty); |
186 CMdEPropertyDef& sizePropDef = aObjectDef.GetPropertyDefL(MdeConstants::Object::KSizeProperty); |
190 if(aObject.Property( sizePropDef, property )!= KErrNotFound) |
187 if(aObject.Property( sizePropDef, property )!= KErrNotFound) |
191 { |
188 { |
192 //Add field to document |
189 //Add field to document |
193 if( property->Def().PropertyType() == EPropertyUint32 ) |
190 CMdEUint32Property& sizeProperty = static_cast < CMdEUint32Property& > (*property ); |
194 { |
191 TBuf<32> buf; |
195 CMdEUint32Property& sizeProperty = static_cast < CMdEUint32Property& > (*property ); |
192 buf.Format(_L("%u"), sizeProperty.Value()); |
196 TBuf<32> buf; |
193 AddFiledtoDocumentL(*index_item, |
197 buf.Format(_L("%u"), sizeProperty.Value()); |
194 MdeConstants::Object::KSizeProperty, |
198 AddFiledtoDocumentL(*index_item, |
195 buf, |
199 MdeConstants::Object::KSizeProperty, |
196 CDocumentField::EStoreYes | CDocumentField::EIndexUnTokenized); |
200 buf, |
197 AddToFieldExcerptL(buf); |
201 CDocumentField::EStoreYes | CDocumentField::EIndexUnTokenized); |
|
202 AddToFieldExcerptL(buf); |
|
203 } |
|
204 } |
198 } |
205 //Get resolution property |
199 //Get resolution property |
206 CMdEPropertyDef& resolutionPropDef = aObjectDef.GetPropertyDefL(MdeConstants::MediaObject::KResolutionUnitProperty ); |
200 CMdEPropertyDef& resolutionPropDef = aObjectDef.GetPropertyDefL(MdeConstants::MediaObject::KResolutionUnitProperty ); |
207 if(aObject.Property( resolutionPropDef, property ) != KErrNotFound) |
201 if(aObject.Property( resolutionPropDef, property ) != KErrNotFound) |
208 { |
202 { |
209 //Add field to document |
203 //Add field to document |
210 if( property->Def().PropertyType() == EPropertyUint16 ) |
204 CMdEUint16Property& resolutionProperty = static_cast < CMdEUint16Property& > (*property ); |
211 { |
205 TBuf<32> buf; |
212 CMdEUint16Property& resolutionProperty = static_cast < CMdEUint16Property& > (*property ); |
206 buf.Format(_L("%d"), resolutionProperty.Value()); |
213 TBuf<32> buf; |
207 AddFiledtoDocumentL(*index_item, |
214 buf.Format(_L("%d"), resolutionProperty.Value()); |
208 MdeConstants::MediaObject::KResolutionUnitProperty, |
215 AddFiledtoDocumentL(*index_item, |
209 buf, |
216 MdeConstants::MediaObject::KResolutionUnitProperty, |
210 CDocumentField::EStoreYes | CDocumentField::EIndexUnTokenized); |
217 buf, |
211 |
218 CDocumentField::EStoreYes | CDocumentField::EIndexUnTokenized); |
|
219 } |
|
220 } |
212 } |
221 //Get legal property |
213 //Get legal property |
222 CMdEPropertyDef& legalPropDef = aObjectDef.GetPropertyDefL(MdeConstants::MediaObject::KLegalProperty ); |
214 CMdEPropertyDef& legalPropDef = aObjectDef.GetPropertyDefL(MdeConstants::MediaObject::KLegalProperty ); |
223 if(aObject.Property( legalPropDef, property ) != KErrNotFound) |
215 if(aObject.Property( legalPropDef, property ) != KErrNotFound) |
224 { |
216 { |
225 //Add field to document |
217 //Add field to document |
226 CMdETextProperty* textProperty = static_cast< CMdETextProperty* > (property ); |
218 CMdETextProperty* textProperty = static_cast< CMdETextProperty* > (property ); |
227 AddFiledtoDocumentL(*index_item, |
219 AddFiledtoDocumentL(*index_item, |
228 MdeConstants::MediaObject::KLegalProperty, |
220 MdeConstants::MediaObject::KLegalProperty, |
229 textProperty->Value()); |
221 textProperty->Value()); |
|
222 AddToFieldExcerptL(textProperty->Value()); |
230 } |
223 } |
231 //Get track property |
224 //Get track property |
232 CMdEPropertyDef& trackPropDef = aObjectDef.GetPropertyDefL(MdeConstants::MediaObject::KTrackProperty ); |
225 CMdEPropertyDef& trackPropDef = aObjectDef.GetPropertyDefL(MdeConstants::MediaObject::KTrackProperty ); |
233 if(aObject.Property( trackPropDef, property ) != KErrNotFound) |
226 if(aObject.Property( trackPropDef, property ) != KErrNotFound) |
234 { |
227 { |
235 //Add field to document |
228 //Add field to document |
236 if( property->Def().PropertyType() == EPropertyUint16 ) |
229 CMdEUint16Property& trackProperty = static_cast < CMdEUint16Property& > (*property ); |
237 { |
230 TBuf<32> buf; |
238 CMdEUint16Property& trackProperty = static_cast < CMdEUint16Property& > (*property ); |
231 buf.Format(_L("%d"), trackProperty.Value()); |
239 TBuf<32> buf; |
232 AddFiledtoDocumentL(*index_item, |
240 buf.Format(_L("%d"), trackProperty.Value()); |
233 MdeConstants::MediaObject::KTrackProperty, |
241 AddFiledtoDocumentL(*index_item, |
234 buf); |
242 MdeConstants::MediaObject::KTrackProperty, |
235 |
243 buf); |
|
244 } |
|
245 } |
236 } |
246 // Capturedate property |
237 // Capturedate property |
247 CMdEPropertyDef& captureDatePropDef = aObjectDef.GetPropertyDefL(MdeConstants::MediaObject::KCaptureDateProperty); |
238 CMdEPropertyDef& captureDatePropDef = aObjectDef.GetPropertyDefL(MdeConstants::MediaObject::KCaptureDateProperty); |
248 if(aObject.Property( captureDatePropDef, property ) != KErrNotFound) |
239 if(aObject.Property( captureDatePropDef, property ) != KErrNotFound) |
249 { |
240 { |
250 //Add field to document |
241 //Add field to document |
251 if(EPropertyTime == property->Def().PropertyType()) |
242 CMdETimeProperty& timeProperty = static_cast < CMdETimeProperty& > (*property); |
252 { |
243 TDateTime time = timeProperty.Value().DateTime(); |
253 CMdETimeProperty& timeProperty = static_cast < CMdETimeProperty& > (*property); |
244 TBuf<32> buf; |
254 TDateTime time = timeProperty.Value().DateTime(); |
245 buf.Format( KFormatDateTime, time.Year(), |
255 TBuf<32> buf; |
246 time.Month() + 1, |
256 buf.Format( KFormatDateTime, time.Year(), |
247 time.Day() + 1, |
257 time.Month() + 1, |
248 time.Hour(), |
258 time.Day() + 1, |
249 time.Minute()); |
259 time.Hour(), |
250 |
260 time.Minute()); |
251 AddFiledtoDocumentL(*index_item, |
261 |
252 MdeConstants::MediaObject::KCaptureDateProperty, |
262 AddFiledtoDocumentL(*index_item, |
253 buf, |
263 MdeConstants::MediaObject::KCaptureDateProperty, |
254 CDocumentField::EStoreYes | CDocumentField::EIndexUnTokenized); |
264 buf, |
255 //Format for excerpt field |
265 CDocumentField::EStoreYes | CDocumentField::EIndexUnTokenized); |
256 buf.Format( KExcerptFormat, time.Year(), |
266 //Format for excerpt field |
257 time.Month() + 1, |
267 buf.Format( KExcerptFormat, time.Year(), |
258 time.Day() + 1, |
268 time.Month() + 1, |
259 time.Hour(), |
269 time.Day() + 1, |
260 time.Minute()); |
270 time.Hour(), |
261 AddToFieldExcerptL(buf); |
271 time.Minute()); |
|
272 AddToFieldExcerptL(buf); |
|
273 } |
|
274 } |
262 } |
275 //Get LastModifiedDate property |
263 //Get LastModifiedDate property |
276 CMdEPropertyDef& dateTimePropDef = aObjectDef.GetPropertyDefL(MdeConstants::Object::KLastModifiedDateProperty); |
264 CMdEPropertyDef& dateTimePropDef = aObjectDef.GetPropertyDefL(MdeConstants::Object::KLastModifiedDateProperty); |
277 if(aObject.Property( dateTimePropDef, property ) != KErrNotFound) |
265 if(aObject.Property( dateTimePropDef, property ) != KErrNotFound) |
278 { |
266 { |
279 //Add field to document |
267 //Add field to document |
280 if(EPropertyTime == property->Def().PropertyType()) |
268 CMdETimeProperty& timeProperty = static_cast < CMdETimeProperty& > (*property); |
281 { |
269 TDateTime time = timeProperty.Value().DateTime(); |
282 CMdETimeProperty& timeProperty = static_cast < CMdETimeProperty& > (*property); |
270 TBuf<32> buf; |
283 TDateTime time = timeProperty.Value().DateTime(); |
271 buf.Format( KFormatDateTime, time.Year(), |
284 TBuf<32> buf; |
272 time.Month() + 1, |
285 buf.Format( KFormatDateTime, time.Year(), |
273 time.Day() + 1, |
286 time.Month() + 1, |
274 time.Hour(), |
287 time.Day() + 1, |
|
288 time.Hour(), |
|
289 time.Minute()); |
|
290 |
|
291 AddFiledtoDocumentL(*index_item, |
|
292 MdeConstants::Object::KLastModifiedDateProperty, |
|
293 buf, |
|
294 CDocumentField::EStoreYes | CDocumentField::EIndexUnTokenized); |
|
295 //Format for excerpt field |
|
296 buf.Format( KExcerptFormat, time.Year(), |
|
297 time.Month() + 1, |
|
298 time.Day() + 1, |
|
299 time.Hour(), |
|
300 time.Minute()); |
275 time.Minute()); |
301 AddToFieldExcerptL(buf); |
276 |
302 } |
277 AddFiledtoDocumentL(*index_item, |
|
278 MdeConstants::Object::KLastModifiedDateProperty, |
|
279 buf, |
|
280 CDocumentField::EStoreYes | CDocumentField::EIndexUnTokenized); |
|
281 //Format for excerpt field |
|
282 buf.Format( KExcerptFormat, time.Year(), |
|
283 time.Month() + 1, |
|
284 time.Day() + 1, |
|
285 time.Hour(), |
|
286 time.Minute()); |
|
287 AddToFieldExcerptL(buf); |
303 } |
288 } |
304 //Get duration property |
289 //Get duration property |
305 CMdEPropertyDef& durationPropDef = aObjectDef.GetPropertyDefL(MdeConstants::MediaObject::KDurationProperty ); |
290 CMdEPropertyDef& durationPropDef = aObjectDef.GetPropertyDefL(MdeConstants::MediaObject::KDurationProperty ); |
306 if(aObject.Property( durationPropDef, property ) != KErrNotFound) |
291 if(aObject.Property( durationPropDef, property ) != KErrNotFound) |
307 { |
292 { |
308 //Add field to document |
293 //Add field to document |
309 if( property->Def().PropertyType() == EPropertyReal32 ) |
294 CMdEReal32Property& durationProperty = static_cast < CMdEReal32Property& > (*property ); |
310 { |
295 TBuf<32> buf; |
311 CMdEReal32Property& durationProperty = static_cast < CMdEReal32Property& > (*property ); |
296 buf.Format(_L("%f"), durationProperty.Value()); |
312 TBuf<32> buf; |
297 AddFiledtoDocumentL(*index_item, |
313 buf.Format(_L("%f"), durationProperty.Value()); |
298 MdeConstants::MediaObject::KDurationProperty, |
314 AddFiledtoDocumentL(*index_item, |
299 buf, |
315 MdeConstants::MediaObject::KDurationProperty, |
300 CDocumentField::EStoreYes | CDocumentField::EIndexUnTokenized); |
316 buf, |
|
317 CDocumentField::EStoreYes | CDocumentField::EIndexUnTokenized); |
|
318 } |
|
319 } |
301 } |
320 if( iExcerpt ) |
302 if( iExcerpt ) |
321 { |
303 { |
322 index_item->AddExcerptL(*iExcerpt); |
304 index_item->AddExcerptL(*iExcerpt); |
323 } |
305 } |