30
|
1 |
/*
|
|
2 |
* Copyright (c) 2008 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: Stub collection client to be used when unit testing videocollectionsortfilterproxy
|
|
15 |
*/
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
// INCLUDE FILES>
|
|
20 |
#include <mpxmediaarray.h>
|
|
21 |
#include "stub/inc/videocollectionclient.h"
|
|
22 |
|
|
23 |
VideoCollectionClient* VideoCollectionClient::testInstance = 0;
|
|
24 |
|
|
25 |
bool VideoCollectionClient::mFailInit = false;
|
|
26 |
bool VideoCollectionClient::mFailStartOpen = false;
|
|
27 |
bool VideoCollectionClient::mFailMediaPlayback = false;
|
|
28 |
bool VideoCollectionClient::mFailMediaDetails = false;
|
|
29 |
bool VideoCollectionClient::mFailSetSort = false;
|
|
30 |
bool VideoCollectionClient::mFailAddNewCollection = false;
|
34
|
31 |
TMPXItemId VideoCollectionClient::mNewAlbumId = TMPXItemId::InvalidId();
|
30
|
32 |
TVcxMyVideosSortingOrder VideoCollectionClient::mSettedSortOrder = EVcxMyVideosSortingNone;
|
|
33 |
int VideoCollectionClient::mSortOrderSetCount = 0;
|
|
34 |
QString VideoCollectionClient::mAddNewCollectionName = QString();
|
|
35 |
QString VideoCollectionClient::mAddNewCollectionThumb = QString();
|
|
36 |
QList<TMPXItemId> VideoCollectionClient::mAddNewCollectionIds = QList<TMPXItemId>();
|
36
|
37 |
int VideoCollectionClient::mRenameAlbumReturnValue = 0;
|
|
38 |
int VideoCollectionClient::mBackReturnValue = 0;
|
30
|
39 |
|
|
40 |
// -----------------------------------------------------------------------------
|
|
41 |
// VideoCollectionClient
|
|
42 |
// -----------------------------------------------------------------------------
|
|
43 |
//
|
|
44 |
VideoCollectionClient::VideoCollectionClient()
|
|
45 |
{
|
|
46 |
testInstance = this;
|
|
47 |
}
|
|
48 |
|
|
49 |
// -----------------------------------------------------------------------------
|
|
50 |
// ~CVideoCollectionClient
|
|
51 |
// -----------------------------------------------------------------------------
|
|
52 |
//
|
|
53 |
VideoCollectionClient::~VideoCollectionClient()
|
|
54 |
{
|
|
55 |
}
|
|
56 |
|
|
57 |
// -----------------------------------------------------------------------------
|
|
58 |
// initialize
|
|
59 |
// -----------------------------------------------------------------------------
|
|
60 |
//
|
|
61 |
int VideoCollectionClient::initialize()
|
|
62 |
{
|
|
63 |
if(mFailInit)
|
|
64 |
{
|
|
65 |
return -1;
|
|
66 |
}
|
|
67 |
return 0;
|
|
68 |
}
|
|
69 |
|
|
70 |
// -----------------------------------------------------------------------------
|
|
71 |
// startOpenCollection
|
|
72 |
// -----------------------------------------------------------------------------
|
|
73 |
//
|
|
74 |
int VideoCollectionClient::startOpenCollection(int level)
|
|
75 |
{
|
34
|
76 |
Q_UNUSED(level);
|
30
|
77 |
if(mFailStartOpen)
|
|
78 |
{
|
|
79 |
return -1;
|
|
80 |
}
|
|
81 |
return 0;
|
|
82 |
}
|
|
83 |
|
|
84 |
// -----------------------------------------------------------------------------
|
34
|
85 |
// openItem
|
30
|
86 |
// -----------------------------------------------------------------------------
|
|
87 |
//
|
34
|
88 |
int VideoCollectionClient::openItem(int /*mpxId1*/)
|
30
|
89 |
{
|
|
90 |
if(mFailMediaPlayback)
|
|
91 |
{
|
|
92 |
return -1;
|
|
93 |
}
|
|
94 |
return 0;
|
|
95 |
}
|
|
96 |
|
|
97 |
// -----------------------------------------------------------------------------
|
34
|
98 |
// addNewAlbum
|
|
99 |
// -----------------------------------------------------------------------------
|
|
100 |
//
|
|
101 |
TMPXItemId VideoCollectionClient::addNewAlbum(QString title)
|
|
102 |
{
|
|
103 |
mAddNewCollectionName = title;
|
|
104 |
return mNewAlbumId;
|
|
105 |
}
|
|
106 |
|
|
107 |
// -----------------------------------------------------------------------------
|
|
108 |
// addItemsInAlbum
|
|
109 |
// -----------------------------------------------------------------------------
|
|
110 |
//
|
|
111 |
int VideoCollectionClient::addItemsInAlbum(TMPXItemId albumId, QList<TMPXItemId> items)
|
|
112 |
{
|
|
113 |
Q_UNUSED(albumId);
|
|
114 |
Q_UNUSED(items);
|
|
115 |
return 0;
|
|
116 |
}
|
|
117 |
|
|
118 |
// -----------------------------------------------------------------------------
|
|
119 |
// revoveAlbums
|
|
120 |
// -----------------------------------------------------------------------------
|
|
121 |
//
|
|
122 |
int VideoCollectionClient::removeAlbums(const QList<TMPXItemId> &items)
|
|
123 |
{
|
|
124 |
Q_UNUSED(items);
|
|
125 |
return 0;
|
|
126 |
}
|
|
127 |
|
|
128 |
// -----------------------------------------------------------------------------
|
30
|
129 |
// deleteFile
|
|
130 |
// -----------------------------------------------------------------------------
|
|
131 |
//
|
|
132 |
int VideoCollectionClient::getVideoDetails(int /*mpxId1*/)
|
|
133 |
{
|
|
134 |
if(mFailMediaDetails)
|
|
135 |
{
|
|
136 |
return -1;
|
|
137 |
}
|
|
138 |
return 0;
|
|
139 |
}
|
|
140 |
|
|
141 |
// -----------------------------------------------------------------------------
|
34
|
142 |
// getCategoryId
|
30
|
143 |
// -----------------------------------------------------------------------------
|
|
144 |
//
|
34
|
145 |
void VideoCollectionClient::getCategoryId(TMPXItemId &id)
|
30
|
146 |
{
|
34
|
147 |
id.iId1 = 1;
|
|
148 |
id.iId2 = 2;
|
30
|
149 |
}
|
36
|
150 |
|
30
|
151 |
// -----------------------------------------------------------------------------
|
|
152 |
// back
|
|
153 |
// -----------------------------------------------------------------------------
|
|
154 |
//
|
|
155 |
int VideoCollectionClient::back()
|
|
156 |
{
|
36
|
157 |
return mBackReturnValue;
|
30
|
158 |
}
|
|
159 |
|
36
|
160 |
// -----------------------------------------------------------------------------
|
|
161 |
// renameAlbum
|
|
162 |
// -----------------------------------------------------------------------------
|
|
163 |
//
|
|
164 |
int VideoCollectionClient::renameAlbum(const TMPXItemId &albumId, const QString &newTitle)
|
|
165 |
{
|
|
166 |
Q_UNUSED(albumId);
|
|
167 |
Q_UNUSED(newTitle);
|
|
168 |
return mRenameAlbumReturnValue;
|
|
169 |
}
|