34
|
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: Helper class for creating mediaobjects for testing VideoListDataModel class methods*
|
|
15 |
*/
|
|
16 |
|
|
17 |
|
|
18 |
#ifndef __TESTVIDEOLISTMEDIAFACTORY_H__
|
|
19 |
#define __TESTVIDEOLISTMEDIAFACTORY_H__
|
|
20 |
|
|
21 |
|
|
22 |
class CMPXMediaArray;
|
|
23 |
class CMPXMedia;
|
|
24 |
|
|
25 |
/**
|
|
26 |
* flag values for selecting wich details are created for items
|
|
27 |
*/
|
|
28 |
enum MediaDetailSelection
|
|
29 |
{
|
|
30 |
MediaDetailNone = 0x00,
|
|
31 |
MediaDetailRatingFlag = 0x01,
|
|
32 |
MediaDetailDateFlag = 0x02,
|
|
33 |
MediaDetailSizeFlag = 0x04,
|
|
34 |
MediaDetailDurationFlag = 0x08,
|
|
35 |
MediaDetailFilePathFlag = 0x10,
|
35
|
36 |
MediaDetailCategoryVideoCount = 0x20,
|
34
|
37 |
MediaDetailAll = 0xff
|
|
38 |
};
|
|
39 |
|
|
40 |
// const used for media creation
|
|
41 |
_LIT( KMediaTestNamePrefix, "MEDIATESTFILEPATH_%d" );
|
|
42 |
const QString gQTMediaNamePrefix = "MEDIATESTFILEPATH_";
|
|
43 |
|
|
44 |
_LIT( KMediaTestFilePathPrefix, "MEDIATESTFILEPATH_%d" );
|
|
45 |
const QString gQTMediaFilePathPrefix = "MEDIATESTFILEPATH_";
|
|
46 |
|
|
47 |
class MediaObjectFactory
|
|
48 |
{
|
|
49 |
|
|
50 |
public:
|
|
51 |
/**
|
|
52 |
* constructor.
|
|
53 |
*/
|
|
54 |
MediaObjectFactory();
|
|
55 |
|
|
56 |
/**
|
|
57 |
* destructor
|
|
58 |
*/
|
|
59 |
~MediaObjectFactory();
|
|
60 |
|
|
61 |
/**
|
|
62 |
* returns pointer to media-array
|
|
63 |
*/
|
|
64 |
CMPXMediaArray* mediaArray();
|
|
65 |
|
|
66 |
/**
|
|
67 |
* creates wanted amount of items with sekected details
|
|
68 |
*
|
|
69 |
* @param counr
|
|
70 |
* @param MediaDetailSelection flags
|
|
71 |
*/
|
|
72 |
void createMediaItems(int count, int mediaType = 0, MediaDetailSelection flags = MediaDetailAll);
|
|
73 |
|
|
74 |
/**
|
|
75 |
* deletes media-array
|
|
76 |
*/
|
|
77 |
void removeArray();
|
|
78 |
|
|
79 |
private:
|
|
80 |
|
|
81 |
/**
|
|
82 |
* fills data for single media-item
|
|
83 |
*
|
|
84 |
* @param media
|
|
85 |
* @index
|
|
86 |
* @MediaDetailSelection
|
|
87 |
*
|
|
88 |
* @return bool true: succeed
|
|
89 |
*/
|
|
90 |
bool fillMediaDatas(CMPXMedia* media, int index, int mediaType, MediaDetailSelection detailSelectionFlag);
|
|
91 |
|
|
92 |
/**
|
|
93 |
* array of medias
|
|
94 |
*/
|
|
95 |
CMPXMediaArray *mArray;
|
|
96 |
};
|
|
97 |
|
|
98 |
|
|
99 |
#endif // __TESTVIDEOLISTMEDIAFACTORY_H__
|
|
100 |
|
|
101 |
// End of file
|
|
102 |
|
|
103 |
|
|
104 |
|