|
1 |
|
2 /** |
|
3 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
4 * All rights reserved. |
|
5 * This component and the accompanying materials are made available |
|
6 * under the terms of "Eclipse Public License v1.0" |
|
7 * which accompanies this distribution, and is available |
|
8 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
9 * |
|
10 * Initial Contributors: |
|
11 * Nokia Corporation - initial contribution. |
|
12 * |
|
13 * Contributors: |
|
14 * |
|
15 * Description: Stub VideoListDataModel class for VideoCollectionWrapperPrivate unit tests |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef __STUB_VIDEOLISTDATAMODEL_H |
|
20 #define __STUB_VIDEOLISTDATAMODEL_H |
|
21 |
|
22 #include <QObject> |
|
23 #include <qabstractitemmodel.h> |
|
24 #include <mpxitemid.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class VideoCollectionClient; |
|
28 |
|
29 |
|
30 class VideoListDataModel : public QAbstractItemModel |
|
31 { |
|
32 |
|
33 Q_OBJECT |
|
34 |
|
35 public: // Constructors and destructor |
|
36 |
|
37 /** |
|
38 * constructor |
|
39 * |
|
40 */ |
|
41 VideoListDataModel(QObject *parent = 0); |
|
42 |
|
43 /** |
|
44 * destructor |
|
45 */ |
|
46 virtual ~VideoListDataModel(); |
|
47 |
|
48 public: |
|
49 |
|
50 /** |
|
51 * if gInitFails is true, return -1 |
|
52 * if gInitFails is false, return 0 |
|
53 * |
|
54 * @param not used |
|
55 * |
|
56 * @return int |
|
57 */ |
|
58 int initialize(); |
|
59 |
|
60 /** |
|
61 * if gFetchMediaIDFails is true, return -1 |
|
62 * if gFetchMediaIDFails is false, return 0 |
|
63 * |
|
64 * @param not used |
|
65 * |
|
66 * @return int |
|
67 */ |
|
68 int mediaIdAtIndex(int index) const; |
|
69 |
|
70 signals: |
|
71 |
|
72 /** |
|
73 * not used in stub, but needed to make sure testable object is linked correctly |
|
74 */ |
|
75 void shortDetailsReady(TMPXItemId); |
|
76 |
|
77 /** |
|
78 * not used ion stub, but needed to make sure testable object is linked correctly |
|
79 */ |
|
80 void fullVideoDetailsReady(TMPXItemId); |
|
81 |
|
82 public: // from QAbstractItemModel |
|
83 |
|
84 /** |
|
85 * not used ion stub, but needed to make sure testable object is linked correctly |
|
86 */ |
|
87 int rowCount(const QModelIndex &parent = QModelIndex()) const; |
|
88 |
|
89 /** |
|
90 * not used ion stub, but needed to make sure testable object is linked correctly |
|
91 */ |
|
92 QMap<int, QVariant> itemData(const QModelIndex &index) const; |
|
93 |
|
94 /** |
|
95 * not used ion stub, but needed to make sure testable object is linked correctly |
|
96 */ |
|
97 QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const; |
|
98 |
|
99 /** |
|
100 * not used ion stub, but needed to make sure testable object is linked correctly |
|
101 */ |
|
102 int columnCount(const QModelIndex & parent = QModelIndex()) const; |
|
103 |
|
104 /** |
|
105 * not used ion stub, but needed to make sure testable object is linked correctly |
|
106 */ |
|
107 QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const; |
|
108 |
|
109 /** |
|
110 * not used ion stub, but needed to make sure testable object is linked correctly |
|
111 */ |
|
112 QModelIndex parent(const QModelIndex & index) const; |
|
113 |
|
114 /* |
|
115 * returns gFailDeleteFile |
|
116 */ |
|
117 bool removeRows( QModelIndexList list); |
|
118 |
|
119 /** |
|
120 * if true, initialize returns -1 |
|
121 */ |
|
122 static bool mInitFails; |
|
123 }; |
|
124 |
|
125 #endif // __STUB_VIDEOLISTDATAMODEL_H |