videocollection/inc/videocollectioncommon.h
branchRCL_3
changeset 56 839377eedc2b
equal deleted inserted replaced
54:315810614048 56:839377eedc2b
       
     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 		KeyFilePath,
       
    39         KeyLast,
       
    40         KeyNumberOfItems,
       
    41         KeyTitle
       
    42     };
       
    43     
       
    44     /**
       
    45     * Keys for the metadata map fetched from video model.
       
    46     * These are strings, because QVariant only supports QMap<QString, QVariant>
       
    47     */
       
    48     const char* const MetaKeyDate = "MetaKeyDate";
       
    49     const char* const MetaKeyDurationString = "MetaKeyDurationString";
       
    50     const char* const MetaKeySizeString = "MetaKeySizeString";
       
    51     const char* const MetaKeyStarRating = "MetaKeyStarRating";
       
    52     const char* const MetaKeyDRMInfo = "MetaKeyDRMInfo";
       
    53     const char* const MetaKeyServiceURL = "MetaKeyServiceURL";
       
    54     const char* const MetaKeyDescription = "MetaKeyDescription";
       
    55     const char* const MetaKeyModifiedDate = "MetaKeyModifiedDate";
       
    56     const char* const MetaKeyShotLocation = "MetaKeyShotLocation";
       
    57     const char* const MetaKeyAuthor = "MetaKeyAuthor";
       
    58     const char* const MetaKeyCopyright = "MetaKeyCopyright";
       
    59     const char* const MetaKeyAudioType = "MetaKeyAudioType";
       
    60     const char* const MetaKeyLanguageString = "MetaKeyLanguageString";
       
    61     const char* const MetaKeyKeywords = "MetaKeyKeywords";
       
    62     const char* const MetaKeyVideoResolutionString = "MetaKeyVideoResolutionString";
       
    63     const char* const MetaKeyBitRate = "MetaKeyBitRate";
       
    64     const char* const MetaKeyFormat = "MetaKeyFormat";
       
    65     const char* const MetaKeyFileName = "MetaKeyFileName";
       
    66     const char* const MetaKeyFilePath = "MetaKeyFilePath";
       
    67     const char* const MetaKeyVideoTitle = "MetaKeyVideoTitle";
       
    68     
       
    69     enum VideoItemStatus
       
    70     {
       
    71         StatusNone = 0,
       
    72         StatusDeleted
       
    73     };
       
    74     
       
    75     /**
       
    76      * Labels for the different details. Needs to be in the same
       
    77      * order than the VideoDetailLabelKeys.
       
    78      */
       
    79     const char * const VideoDetailLabels[] = {
       
    80             QT_TR_NOOP("txt_videos_list_title"),
       
    81             QT_TR_NOOP("txt_videos_list_filename"),
       
    82             QT_TR_NOOP("txt_videos_list_file_path"),
       
    83     		QT_TR_NOOP("txt_videos_list_drm"),
       
    84             QT_TR_NOOP("txt_videos_list_service"),
       
    85             QT_TR_NOOP("txt_videos_list_description"),
       
    86             QT_TR_NOOP("txt_videos_list_duration"),
       
    87             QT_TR_NOOP("txt_videos_list_date"),
       
    88             QT_TR_NOOP("txt_videos_list_modified"),
       
    89             QT_TR_NOOP("txt_videos_list_location"),
       
    90             QT_TR_NOOP("txt_videos_list_author"),
       
    91             QT_TR_NOOP("txt_videos_list_copyright"),
       
    92             QT_TR_NOOP("txt_videos_list_audio_type"),
       
    93             QT_TR_NOOP("txt_videos_list_language"),
       
    94             QT_TR_NOOP("txt_videos_list_keywords"),
       
    95             QT_TR_NOOP("txt_videos_list_file_size"),
       
    96             QT_TR_NOOP("txt_videos_list_resolution"),
       
    97             QT_TR_NOOP("txt_videos_list_format"),
       
    98             QT_TR_NOOP("txt_videos_list_bitrate")            
       
    99 };
       
   100 
       
   101     /**
       
   102      * Order of keys in the labels const array.
       
   103      */
       
   104     const char * const VideoDetailLabelKeys[] = {
       
   105             MetaKeyVideoTitle,
       
   106             MetaKeyFileName,
       
   107             MetaKeyFilePath,
       
   108             MetaKeyDRMInfo,
       
   109             MetaKeyServiceURL,
       
   110             MetaKeyDescription,
       
   111             MetaKeyDurationString,
       
   112             MetaKeyDate,
       
   113             MetaKeyModifiedDate,
       
   114             MetaKeyShotLocation,
       
   115             MetaKeyAuthor,
       
   116             MetaKeyCopyright,
       
   117             MetaKeyAudioType,
       
   118             MetaKeyLanguageString,
       
   119             MetaKeyKeywords,
       
   120             MetaKeySizeString,
       
   121             MetaKeyVideoResolutionString,
       
   122             MetaKeyFormat,
       
   123             MetaKeyBitRate            
       
   124     };
       
   125     
       
   126     /**
       
   127      * Collection level app browsed to
       
   128      */
       
   129     enum TCollectionLevels
       
   130     {
       
   131         ELevelInvalid 	  = -1,
       
   132     	ELevelCategory 	  = 2,
       
   133         ELevelVideos   	  = 3,
       
   134         ELevelDefaultColl = 4,
       
   135         ELevelAlbum    	  = 5
       
   136     };
       
   137     
       
   138     /**
       
   139      * Container path levels.
       
   140      */
       
   141     enum ContainerPathLevels
       
   142     {
       
   143         PathLevelCategories = 1,
       
   144         PathLevelVideos = 2
       
   145     };
       
   146     
       
   147     /**
       
   148      * Collection related asyncronous 
       
   149      * operations status codes
       
   150      */
       
   151     enum VideoCollectionAsyncStatus
       
   152     {
       
   153         statusSingleDeleteFail = 1,
       
   154         statusMultipleDeleteFail,
       
   155         statusDeleteInProgress,
       
   156         statusDeleteSucceed,
       
   157         statusSingleRemoveFail,
       
   158         statusMultiRemoveFail,
       
   159         statusRemoveSucceed,
       
   160         statusVideosAddedToCollection,
       
   161         statusAllVideosAlreadyInCollection,
       
   162         statusVideosRemovedFromCollection
       
   163     };
       
   164 
       
   165     enum TModelType
       
   166     {
       
   167     	EModelTypeInvalid,
       
   168     	EModelTypeAllVideos,
       
   169     	EModelTypeCollections,
       
   170     	EModelTypeCollectionContent,
       
   171     	EModelTypeGeneric
       
   172     };
       
   173 
       
   174     /**
       
   175      * Utility macro to trace heap consumption.
       
   176      */
       
   177 #ifdef _DEBUG
       
   178     #define TRACE_HEAP(prefix)\
       
   179     {\
       
   180         int totalAllocSpace = 0;\
       
   181         User::AllocSize( totalAllocSpace );\
       
   182         qDebug("[VIDEOCOLLECTION][HEAP]: %s, Total allocated space : %d",\
       
   183             prefix,\
       
   184             totalAllocSpace);\
       
   185     }
       
   186 #else
       
   187     #define TRACE_HEAP(prefix)
       
   188 #endif
       
   189 }
       
   190 #endif	// __VIDEOCOLLECTIONCOMMON_H__