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