videocollection/inc/videocollectioncommon.h
author hgs
Tue, 05 Oct 2010 09:26:49 +0300
changeset 66 adb51f74b890
parent 58 d2b028fd1f7d
permissions -rw-r--r--
201039
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
30
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description:  definition of common data for video collection components
hgs
parents:
diff changeset
    15
*
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
#ifndef __VIDEOCOLLECTIONCOMMON_H__
hgs
parents:
diff changeset
    19
#define __VIDEOCOLLECTIONCOMMON_H__
hgs
parents:
diff changeset
    20
hgs
parents:
diff changeset
    21
34
hgs
parents: 30
diff changeset
    22
#include <qobject.h>
hgs
parents: 30
diff changeset
    23
#include <qhash.h>
hgs
parents: 30
diff changeset
    24
#include <mpxitemid.h>
30
hgs
parents:
diff changeset
    25
hgs
parents:
diff changeset
    26
namespace VideoCollectionCommon
hgs
parents:
diff changeset
    27
{
hgs
parents:
diff changeset
    28
    /**
hgs
parents:
diff changeset
    29
    * enums indicating keys for the detail data 
hgs
parents:
diff changeset
    30
    * fetched from video model
hgs
parents:
diff changeset
    31
    */
hgs
parents:
diff changeset
    32
    enum VideoDetailKey
hgs
parents:
diff changeset
    33
    {
hgs
parents:
diff changeset
    34
        KeyUndefined = Qt::UserRole,
hgs
parents:
diff changeset
    35
        KeyDateTime,
hgs
parents:
diff changeset
    36
		KeySizeValue,
hgs
parents:
diff changeset
    37
		KeyStatus,
hgs
parents:
diff changeset
    38
		KeyFilePath,
36
hgs
parents: 35
diff changeset
    39
        KeyLast,
hgs
parents: 35
diff changeset
    40
        KeyNumberOfItems,
hgs
parents: 35
diff changeset
    41
        KeyTitle
30
hgs
parents:
diff changeset
    42
    };
hgs
parents:
diff changeset
    43
    
hgs
parents:
diff changeset
    44
    /**
hgs
parents:
diff changeset
    45
    * Keys for the metadata map fetched from video model.
hgs
parents:
diff changeset
    46
    * These are strings, because QVariant only supports QMap<QString, QVariant>
hgs
parents:
diff changeset
    47
    */
hgs
parents:
diff changeset
    48
    const char* const MetaKeyDate = "MetaKeyDate";
hgs
parents:
diff changeset
    49
    const char* const MetaKeyDurationString = "MetaKeyDurationString";
hgs
parents:
diff changeset
    50
    const char* const MetaKeySizeString = "MetaKeySizeString";
hgs
parents:
diff changeset
    51
    const char* const MetaKeyStarRating = "MetaKeyStarRating";
hgs
parents:
diff changeset
    52
    const char* const MetaKeyDRMInfo = "MetaKeyDRMInfo";
hgs
parents:
diff changeset
    53
    const char* const MetaKeyServiceURL = "MetaKeyServiceURL";
hgs
parents:
diff changeset
    54
    const char* const MetaKeyDescription = "MetaKeyDescription";
hgs
parents:
diff changeset
    55
    const char* const MetaKeyModifiedDate = "MetaKeyModifiedDate";
hgs
parents:
diff changeset
    56
    const char* const MetaKeyShotLocation = "MetaKeyShotLocation";
hgs
parents:
diff changeset
    57
    const char* const MetaKeyAuthor = "MetaKeyAuthor";
hgs
parents:
diff changeset
    58
    const char* const MetaKeyCopyright = "MetaKeyCopyright";
hgs
parents:
diff changeset
    59
    const char* const MetaKeyAudioType = "MetaKeyAudioType";
hgs
parents:
diff changeset
    60
    const char* const MetaKeyLanguageString = "MetaKeyLanguageString";
hgs
parents:
diff changeset
    61
    const char* const MetaKeyKeywords = "MetaKeyKeywords";
hgs
parents:
diff changeset
    62
    const char* const MetaKeyVideoResolutionString = "MetaKeyVideoResolutionString";
hgs
parents:
diff changeset
    63
    const char* const MetaKeyBitRate = "MetaKeyBitRate";
hgs
parents:
diff changeset
    64
    const char* const MetaKeyFormat = "MetaKeyFormat";
50
hgs
parents: 36
diff changeset
    65
    const char* const MetaKeyFileName = "MetaKeyFileName";
hgs
parents: 36
diff changeset
    66
    const char* const MetaKeyFilePath = "MetaKeyFilePath";
hgs
parents: 36
diff changeset
    67
    const char* const MetaKeyVideoTitle = "MetaKeyVideoTitle";
30
hgs
parents:
diff changeset
    68
    
hgs
parents:
diff changeset
    69
    enum VideoItemStatus
hgs
parents:
diff changeset
    70
    {
hgs
parents:
diff changeset
    71
        StatusNone = 0,
hgs
parents:
diff changeset
    72
        StatusDeleted
hgs
parents:
diff changeset
    73
    };
hgs
parents:
diff changeset
    74
    
hgs
parents:
diff changeset
    75
    /**
hgs
parents:
diff changeset
    76
     * Labels for the different details. Needs to be in the same
hgs
parents:
diff changeset
    77
     * order than the VideoDetailLabelKeys.
hgs
parents:
diff changeset
    78
     */
hgs
parents:
diff changeset
    79
    const char * const VideoDetailLabels[] = {
50
hgs
parents: 36
diff changeset
    80
            QT_TR_NOOP("txt_videos_list_title"),
66
hgs
parents: 58
diff changeset
    81
            QT_TR_NOOP("txt_videos_list_file_name"),
50
hgs
parents: 36
diff changeset
    82
            QT_TR_NOOP("txt_videos_list_file_path"),
34
hgs
parents: 30
diff changeset
    83
    		QT_TR_NOOP("txt_videos_list_drm"),
36
hgs
parents: 35
diff changeset
    84
            QT_TR_NOOP("txt_videos_list_service"),
34
hgs
parents: 30
diff changeset
    85
            QT_TR_NOOP("txt_videos_list_description"),
hgs
parents: 30
diff changeset
    86
            QT_TR_NOOP("txt_videos_list_duration"),
hgs
parents: 30
diff changeset
    87
            QT_TR_NOOP("txt_videos_list_date"),
hgs
parents: 30
diff changeset
    88
            QT_TR_NOOP("txt_videos_list_modified"),
hgs
parents: 30
diff changeset
    89
            QT_TR_NOOP("txt_videos_list_location"),
hgs
parents: 30
diff changeset
    90
            QT_TR_NOOP("txt_videos_list_author"),
hgs
parents: 30
diff changeset
    91
            QT_TR_NOOP("txt_videos_list_copyright"),
36
hgs
parents: 35
diff changeset
    92
            QT_TR_NOOP("txt_videos_list_audio_type"),
34
hgs
parents: 30
diff changeset
    93
            QT_TR_NOOP("txt_videos_list_language"),
hgs
parents: 30
diff changeset
    94
            QT_TR_NOOP("txt_videos_list_keywords"),
hgs
parents: 30
diff changeset
    95
            QT_TR_NOOP("txt_videos_list_file_size"),
hgs
parents: 30
diff changeset
    96
            QT_TR_NOOP("txt_videos_list_resolution"),
hgs
parents: 30
diff changeset
    97
            QT_TR_NOOP("txt_videos_list_format"),
50
hgs
parents: 36
diff changeset
    98
            QT_TR_NOOP("txt_videos_list_bitrate")            
34
hgs
parents: 30
diff changeset
    99
};
30
hgs
parents:
diff changeset
   100
hgs
parents:
diff changeset
   101
    /**
hgs
parents:
diff changeset
   102
     * Order of keys in the labels const array.
hgs
parents:
diff changeset
   103
     */
hgs
parents:
diff changeset
   104
    const char * const VideoDetailLabelKeys[] = {
50
hgs
parents: 36
diff changeset
   105
            MetaKeyVideoTitle,
hgs
parents: 36
diff changeset
   106
            MetaKeyFileName,
hgs
parents: 36
diff changeset
   107
            MetaKeyFilePath,
30
hgs
parents:
diff changeset
   108
            MetaKeyDRMInfo,
hgs
parents:
diff changeset
   109
            MetaKeyServiceURL,
hgs
parents:
diff changeset
   110
            MetaKeyDescription,
hgs
parents:
diff changeset
   111
            MetaKeyDurationString,
hgs
parents:
diff changeset
   112
            MetaKeyDate,
hgs
parents:
diff changeset
   113
            MetaKeyModifiedDate,
hgs
parents:
diff changeset
   114
            MetaKeyShotLocation,
hgs
parents:
diff changeset
   115
            MetaKeyAuthor,
hgs
parents:
diff changeset
   116
            MetaKeyCopyright,
hgs
parents:
diff changeset
   117
            MetaKeyAudioType,
hgs
parents:
diff changeset
   118
            MetaKeyLanguageString,
hgs
parents:
diff changeset
   119
            MetaKeyKeywords,
hgs
parents:
diff changeset
   120
            MetaKeySizeString,
hgs
parents:
diff changeset
   121
            MetaKeyVideoResolutionString,
hgs
parents:
diff changeset
   122
            MetaKeyFormat,
50
hgs
parents: 36
diff changeset
   123
            MetaKeyBitRate            
30
hgs
parents:
diff changeset
   124
    };
hgs
parents:
diff changeset
   125
    
34
hgs
parents: 30
diff changeset
   126
    /**
hgs
parents: 30
diff changeset
   127
     * Collection level app browsed to
hgs
parents: 30
diff changeset
   128
     */
hgs
parents: 30
diff changeset
   129
    enum TCollectionLevels
hgs
parents: 30
diff changeset
   130
    {
hgs
parents: 30
diff changeset
   131
        ELevelInvalid 	  = -1,
hgs
parents: 30
diff changeset
   132
    	ELevelCategory 	  = 2,
hgs
parents: 30
diff changeset
   133
        ELevelVideos   	  = 3,
hgs
parents: 30
diff changeset
   134
        ELevelDefaultColl = 4,
hgs
parents: 30
diff changeset
   135
        ELevelAlbum    	  = 5
hgs
parents: 30
diff changeset
   136
    };
hgs
parents: 30
diff changeset
   137
    
hgs
parents: 30
diff changeset
   138
    /**
hgs
parents: 30
diff changeset
   139
     * Container path levels.
hgs
parents: 30
diff changeset
   140
     */
hgs
parents: 30
diff changeset
   141
    enum ContainerPathLevels
hgs
parents: 30
diff changeset
   142
    {
hgs
parents: 30
diff changeset
   143
        PathLevelCategories = 1,
hgs
parents: 30
diff changeset
   144
        PathLevelVideos = 2
hgs
parents: 30
diff changeset
   145
    };
30
hgs
parents:
diff changeset
   146
    
hgs
parents:
diff changeset
   147
    /**
hgs
parents:
diff changeset
   148
     * Collection related asyncronous 
hgs
parents:
diff changeset
   149
     * operations status codes
hgs
parents:
diff changeset
   150
     */
hgs
parents:
diff changeset
   151
    enum VideoCollectionAsyncStatus
hgs
parents:
diff changeset
   152
    {
hgs
parents:
diff changeset
   153
        statusSingleDeleteFail = 1,
hgs
parents:
diff changeset
   154
        statusMultipleDeleteFail,
34
hgs
parents: 30
diff changeset
   155
        statusDeleteInProgress,
hgs
parents: 30
diff changeset
   156
        statusDeleteSucceed,
hgs
parents: 30
diff changeset
   157
        statusSingleRemoveFail,
hgs
parents: 30
diff changeset
   158
        statusMultiRemoveFail,
hgs
parents: 30
diff changeset
   159
        statusRemoveSucceed,
hgs
parents: 30
diff changeset
   160
        statusVideosAddedToCollection,
35
hgs
parents: 34
diff changeset
   161
        statusAllVideosAlreadyInCollection,
hgs
parents: 34
diff changeset
   162
        statusVideosRemovedFromCollection
30
hgs
parents:
diff changeset
   163
    };
36
hgs
parents: 35
diff changeset
   164
34
hgs
parents: 30
diff changeset
   165
    /**
hgs
parents: 30
diff changeset
   166
     * Utility macro to trace heap consumption.
hgs
parents: 30
diff changeset
   167
     */
hgs
parents: 30
diff changeset
   168
#ifdef _DEBUG
hgs
parents: 30
diff changeset
   169
    #define TRACE_HEAP(prefix)\
hgs
parents: 30
diff changeset
   170
    {\
hgs
parents: 30
diff changeset
   171
        int totalAllocSpace = 0;\
hgs
parents: 30
diff changeset
   172
        User::AllocSize( totalAllocSpace );\
hgs
parents: 30
diff changeset
   173
        qDebug("[VIDEOCOLLECTION][HEAP]: %s, Total allocated space : %d",\
hgs
parents: 30
diff changeset
   174
            prefix,\
hgs
parents: 30
diff changeset
   175
            totalAllocSpace);\
hgs
parents: 30
diff changeset
   176
    }
hgs
parents: 30
diff changeset
   177
#else
hgs
parents: 30
diff changeset
   178
    #define TRACE_HEAP(prefix)
hgs
parents: 30
diff changeset
   179
#endif
30
hgs
parents:
diff changeset
   180
}
hgs
parents:
diff changeset
   181
#endif	// __VIDEOCOLLECTIONCOMMON_H__