author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 24 Nov 2009 08:56:33 +0200 | |
changeset 33 | 50974a8b132e |
parent 19 | 989d2f495d90 |
permissions | -rw-r--r-- |
19 | 1 |
/* |
2 |
* Copyright (c) 2007-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 the License "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: Holds information common to all media types |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
||
33
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
20 |
#include <MCLFItem.h> |
19 | 21 |
#include <pathinfo.h> |
22 |
#include <liwvariant.h> |
|
23 |
||
24 |
||
25 |
#include "mgmediaitem.h" |
|
26 |
||
27 |
// Keys // used by service class and iterator |
|
28 |
_LIT8( KMgFileName, "FileName" ); |
|
29 |
_LIT8( KMgFileExtension, "FileExtension" ); |
|
30 |
_LIT8( KMgDrive, "Drive" ); |
|
31 |
_LIT8( KMgFileSize, "FileSize" ); |
|
32 |
_LIT8( KMgFileDate, "FileDate" ); |
|
33 |
_LIT8( KMgMediaType, "MediaType" ); |
|
34 |
_LIT8( KMgMimeType, "MimeType" ); |
|
35 |
||
36 |
||
37 |
_LIT(EMgPhoneMemory,"C:"); |
|
38 |
_LIT(EMgMmc,"E:"); |
|
39 |
// --------------------------------------------------------------------------- |
|
40 |
// CMgMediaItem::FillCommonAttributes |
|
41 |
// Fills the attributes common to all media types |
|
42 |
// --------------------------------------------------------------------------- |
|
43 |
// |
|
44 |
||
45 |
void CMgMediaItem::FillCommonAttributes(CLiwDefaultMap* aOutputMap, const MCLFItem& aClfItem) |
|
46 |
{ |
|
47 |
TPtrC fullName; |
|
48 |
TPtrC name; |
|
49 |
TPtrC ext; |
|
50 |
TTime time; |
|
51 |
TBuf<2> memory; |
|
52 |
TInt32 size; |
|
53 |
TPtrC mimeType; |
|
54 |
TInt32 mediaType; |
|
55 |
if( aClfItem.GetField( ECLFFieldIdFileNameAndPath, fullName ) |
|
56 |
== KErrNone ) |
|
57 |
{ |
|
58 |
name.Set( TParsePtrC( fullName ).Name() ); |
|
59 |
ext.Set( TParsePtrC( fullName ).Ext() ); |
|
60 |
if( fullName.Length() > 0 ) |
|
61 |
{ |
|
62 |
TCharF mmcMemory( PathInfo::MemoryCardRootPath()[0] ); |
|
63 |
TCharF itemPath( fullName[0] ); |
|
64 |
if( mmcMemory == itemPath ) |
|
65 |
{ // by default phone memory |
|
66 |
memory = EMgMmc; |
|
67 |
} |
|
68 |
else |
|
69 |
{ |
|
70 |
memory = EMgPhoneMemory; |
|
71 |
} |
|
72 |
} |
|
73 |
} |
|
74 |
aClfItem.GetField( ECLFFieldIdMimeType, mimeType ); |
|
75 |
aClfItem.GetField( ECLFFieldIdFileSize, size ); |
|
76 |
aClfItem.GetField( ECLFFieldIdFileDate, time ); |
|
77 |
aClfItem.GetField( ECLFFieldIdMediaType, mediaType ); |
|
78 |
// insert all above attribute in map |
|
79 |
aOutputMap->InsertL(KMgFileName,TLiwVariant(name)); |
|
80 |
aOutputMap->InsertL(KMgFileExtension,TLiwVariant(ext)); |
|
81 |
aOutputMap->InsertL(KMgDrive,TLiwVariant(memory)); |
|
82 |
aOutputMap->InsertL(KMgMimeType,TLiwVariant(mimeType)); |
|
83 |
aOutputMap->InsertL(KMgMediaType,TLiwVariant(mediaType)); |
|
84 |
//aOutputMap->InsertL(KMgFileDate,TLiwVariant(time)); |
|
85 |
aOutputMap->InsertL(KMgFileSize,TLiwVariant(size)); |
|
86 |
||
87 |
} |
|
88 |
||
89 |
||
90 |
||
91 |
||
92 |