|
1 /* |
|
2 * Copyright (c) 2009 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: definition of common data for video collection components |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __VIDEOCOLLECTIONCOMMON_H__ |
|
19 #define __VIDEOCOLLECTIONCOMMON_H__ |
|
20 |
|
21 |
|
22 #include <qobject.h> |
|
23 #include <qhash.h> |
|
24 #include <mpxitemid.h> |
|
25 |
|
26 namespace VideoCollectionCommon |
|
27 { |
|
28 /** |
|
29 * enums indicating keys for the detail data |
|
30 * fetched from video model |
|
31 */ |
|
32 enum VideoDetailKey |
|
33 { |
|
34 KeyUndefined = Qt::UserRole, |
|
35 KeyDateTime, |
|
36 KeySizeValue, |
|
37 KeyStatus, |
|
38 KeyMetaData, |
|
39 KeyFilePath, |
|
40 KeyLast |
|
41 }; |
|
42 |
|
43 /** |
|
44 * Keys for the metadata map fetched from video model. |
|
45 * These are strings, because QVariant only supports QMap<QString, QVariant> |
|
46 */ |
|
47 const char* const MetaKeyDate = "MetaKeyDate"; |
|
48 const char* const MetaKeyDurationString = "MetaKeyDurationString"; |
|
49 const char* const MetaKeySizeString = "MetaKeySizeString"; |
|
50 const char* const MetaKeyStarRating = "MetaKeyStarRating"; |
|
51 const char* const MetaKeyDRMInfo = "MetaKeyDRMInfo"; |
|
52 const char* const MetaKeyServiceURL = "MetaKeyServiceURL"; |
|
53 const char* const MetaKeyDescription = "MetaKeyDescription"; |
|
54 const char* const MetaKeyModifiedDate = "MetaKeyModifiedDate"; |
|
55 const char* const MetaKeyShotLocation = "MetaKeyShotLocation"; |
|
56 const char* const MetaKeyAuthor = "MetaKeyAuthor"; |
|
57 const char* const MetaKeyCopyright = "MetaKeyCopyright"; |
|
58 const char* const MetaKeyAudioType = "MetaKeyAudioType"; |
|
59 const char* const MetaKeyLanguageString = "MetaKeyLanguageString"; |
|
60 const char* const MetaKeyKeywords = "MetaKeyKeywords"; |
|
61 const char* const MetaKeyVideoResolutionString = "MetaKeyVideoResolutionString"; |
|
62 const char* const MetaKeyBitRate = "MetaKeyBitRate"; |
|
63 const char* const MetaKeyFormat = "MetaKeyFormat"; |
|
64 |
|
65 enum VideoItemStatus |
|
66 { |
|
67 StatusNone = 0, |
|
68 StatusDeleted |
|
69 }; |
|
70 |
|
71 /** |
|
72 * Labels for the different details. Needs to be in the same |
|
73 * order than the VideoDetailLabelKeys. |
|
74 */ |
|
75 const char * const VideoDetailLabels[] = { |
|
76 QT_TR_NOOP("txt_videos_list_drm"), |
|
77 QT_TR_NOOP("Service:"), //TODO: localisation |
|
78 QT_TR_NOOP("txt_videos_list_description"), |
|
79 QT_TR_NOOP("txt_videos_list_duration"), |
|
80 QT_TR_NOOP("txt_videos_list_date"), |
|
81 QT_TR_NOOP("txt_videos_list_modified"), |
|
82 QT_TR_NOOP("txt_videos_list_location"), |
|
83 QT_TR_NOOP("txt_videos_list_author"), |
|
84 QT_TR_NOOP("txt_videos_list_copyright"), |
|
85 QT_TR_NOOP("Audio Type:"), //TODO: localisation |
|
86 QT_TR_NOOP("txt_videos_list_language"), |
|
87 QT_TR_NOOP("txt_videos_list_keywords"), |
|
88 QT_TR_NOOP("txt_videos_list_file_size"), |
|
89 QT_TR_NOOP("txt_videos_list_resolution"), |
|
90 QT_TR_NOOP("txt_videos_list_format"), |
|
91 QT_TR_NOOP("txt_videos_list_bitrate") |
|
92 }; |
|
93 |
|
94 /** |
|
95 * Order of keys in the labels const array. |
|
96 */ |
|
97 const char * const VideoDetailLabelKeys[] = { |
|
98 MetaKeyDRMInfo, |
|
99 MetaKeyServiceURL, |
|
100 MetaKeyDescription, |
|
101 MetaKeyDurationString, |
|
102 MetaKeyDate, |
|
103 MetaKeyModifiedDate, |
|
104 MetaKeyShotLocation, |
|
105 MetaKeyAuthor, |
|
106 MetaKeyCopyright, |
|
107 MetaKeyAudioType, |
|
108 MetaKeyLanguageString, |
|
109 MetaKeyKeywords, |
|
110 MetaKeySizeString, |
|
111 MetaKeyVideoResolutionString, |
|
112 MetaKeyFormat, |
|
113 MetaKeyBitRate |
|
114 }; |
|
115 |
|
116 /** |
|
117 * Collection level app browsed to |
|
118 */ |
|
119 enum TCollectionLevels |
|
120 { |
|
121 ELevelInvalid = -1, |
|
122 ELevelCategory = 2, |
|
123 ELevelVideos = 3, |
|
124 ELevelDefaultColl = 4, |
|
125 ELevelAlbum = 5 |
|
126 }; |
|
127 |
|
128 /** |
|
129 * Container path levels. |
|
130 */ |
|
131 enum ContainerPathLevels |
|
132 { |
|
133 PathLevelCategories = 1, |
|
134 PathLevelVideos = 2 |
|
135 }; |
|
136 |
|
137 /** |
|
138 * Collection related asyncronous |
|
139 * operations status codes |
|
140 */ |
|
141 enum VideoCollectionAsyncStatus |
|
142 { |
|
143 statusSingleDeleteFail = 1, |
|
144 statusMultipleDeleteFail, |
|
145 statusDeleteInProgress, |
|
146 statusDeleteSucceed, |
|
147 statusSingleRemoveFail, |
|
148 statusMultiRemoveFail, |
|
149 statusRemoveSucceed, |
|
150 statusVideosAddedToCollection, |
|
151 statusAllVideosAlreadyInCollection, |
|
152 statusVideosRemovedFromCollection |
|
153 }; |
|
154 |
|
155 /** |
|
156 * Utility macro to trace heap consumption. |
|
157 */ |
|
158 #ifdef _DEBUG |
|
159 #define TRACE_HEAP(prefix)\ |
|
160 {\ |
|
161 int totalAllocSpace = 0;\ |
|
162 User::AllocSize( totalAllocSpace );\ |
|
163 qDebug("[VIDEOCOLLECTION][HEAP]: %s, Total allocated space : %d",\ |
|
164 prefix,\ |
|
165 totalAllocSpace);\ |
|
166 } |
|
167 #else |
|
168 #define TRACE_HEAP(prefix) |
|
169 #endif |
|
170 } |
|
171 #endif // __VIDEOCOLLECTIONCOMMON_H__ |