equal
deleted
inserted
replaced
13 * |
13 * |
14 * Description: stub hbview |
14 * Description: stub hbview |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 |
|
19 #ifndef HBLISTVIEW_H |
18 #ifndef HBLISTVIEW_H |
20 #define HBLISTVIEW_H |
19 #define HBLISTVIEW_H |
|
20 |
|
21 #include "hbwidget.h" |
|
22 #include "hblistviewitem.h" |
|
23 #include "hbscrollbar.h" |
|
24 #include "hbabstractitemview.h" |
|
25 #include "videosortfilterproxymodel.h" |
21 |
26 |
22 #include <QGraphicsItem> |
27 #include <QGraphicsItem> |
23 #include <QModelIndex> |
28 #include <QModelIndex> |
24 #include <qgraphicswidget.h> |
29 #include <qgraphicswidget.h> |
25 #include <QList> |
30 #include <QList> |
26 #include <QPointF> |
31 #include <QPointF> |
27 #include <qitemselectionmodel.h> |
32 #include <qitemselectionmodel.h> |
28 |
33 |
29 #include "videosortfilterproxymodel.h" |
|
30 #include "hblistviewitem.h" |
|
31 #include "hbscrollbar.h" |
|
32 #include "hbabstractitemview.h" |
|
33 |
|
34 class HbScrollArea |
34 class HbScrollArea |
35 { |
35 { |
36 public: |
36 public: |
37 enum ClampingStyle |
37 enum ClampingStyle |
38 { |
38 { |
47 }; |
47 }; |
48 |
48 |
49 class HbListView : public HbAbstractItemView |
49 class HbListView : public HbAbstractItemView |
50 { |
50 { |
51 Q_OBJECT |
51 Q_OBJECT |
52 |
52 |
53 public: |
53 public: |
54 |
54 |
55 signals: |
55 signals: |
56 |
56 |
57 /** |
57 /** |
61 |
61 |
62 /** |
62 /** |
63 * dummy signal |
63 * dummy signal |
64 */ |
64 */ |
65 void scrollingEnded(); |
65 void scrollingEnded(); |
|
66 |
|
67 /** |
|
68 * dummy signal |
|
69 */ |
|
70 void scrollingStarted(); |
66 |
71 |
67 public: |
72 public: |
68 /** |
73 /** |
69 * contructor |
74 * contructor |
70 */ |
75 */ |
71 HbListView(QGraphicsItem *parent = 0) : |
76 HbListView(QGraphicsItem *parent = 0) : |
72 mItem(0) |
77 mItem(0), mVerticalSB(0), mSelectionModel(0) |
73 { |
78 { |
74 Q_UNUSED(parent); |
79 Q_UNUSED(parent); |
75 mItem = new HbListViewItem(); |
80 mItem = new HbListViewItem(); |
76 mVerticalSB = new HbScrollBar(); |
81 mVerticalSB = new HbScrollBar(); |
77 } |
82 } |
159 */ |
164 */ |
160 void setUniformItemSizes(bool value) |
165 void setUniformItemSizes(bool value) |
161 { |
166 { |
162 mLatestUniformItemSizes = value; |
167 mLatestUniformItemSizes = value; |
163 } |
168 } |
164 |
169 |
165 /** |
170 /** |
166 * dummy method |
171 * dummy method |
167 */ |
172 */ |
168 void setVisible(bool value) |
173 void setVisible(bool value) |
169 { |
174 { |
218 /** |
223 /** |
219 * dummy method |
224 * dummy method |
220 */ |
225 */ |
221 void clearSelection() |
226 void clearSelection() |
222 { |
227 { |
223 // nop |
228 mAllSelectedStatus = 0; |
224 } |
229 } |
225 |
230 |
226 /** |
231 /** |
227 * dummy method |
232 * dummy method |
228 */ |
233 */ |
236 /** |
241 /** |
237 * dummy method |
242 * dummy method |
238 */ |
243 */ |
239 void selectAll() |
244 void selectAll() |
240 { |
245 { |
241 // nop |
246 mAllSelectedStatus = 1; |
242 } |
247 } |
243 |
248 |
244 /** |
249 /** |
245 * dummy method |
250 * dummy method |
246 */ |
251 */ |
250 { |
255 { |
251 mSelectionModel = new QItemSelectionModel(mLatestModel); |
256 mSelectionModel = new QItemSelectionModel(mLatestModel); |
252 } |
257 } |
253 return mSelectionModel; |
258 return mSelectionModel; |
254 } |
259 } |
|
260 |
|
261 /** |
|
262 * dummy method |
|
263 */ |
|
264 HbAbstractViewItem* itemAtPosition(const QPointF &position) |
|
265 { |
|
266 return mItem; |
|
267 } |
|
268 public: |
255 |
269 |
256 /** |
270 /** |
257 * items to be returned from visibleItems |
271 * items to be returned from visibleItems |
258 */ |
272 */ |
259 static QList<HbAbstractViewItem*> mVisibleItems; |
273 static QList<HbAbstractViewItem*> mVisibleItems; |
261 /** |
275 /** |
262 * selection model to be returned |
276 * selection model to be returned |
263 */ |
277 */ |
264 static HbAbstractItemView::SelectionMode mSelectionMode; |
278 static HbAbstractItemView::SelectionMode mSelectionMode; |
265 |
279 |
266 |
|
267 /** |
280 /** |
268 * provided model |
281 * provided model |
269 */ |
282 */ |
270 static VideoSortFilterProxyModel *mLatestModel; |
283 static VideoSortFilterProxyModel *mLatestModel; |
271 |
284 |
272 /** |
285 /** |
273 * item to returned from listItemPrototype |
286 * -1 == initialized |
|
287 * 0 == nothing selected |
|
288 * 1 == all selected |
|
289 */ |
|
290 static int mAllSelectedStatus; |
|
291 |
|
292 /** |
|
293 * item to returned from listItemPrototype and from itemAtPosition |
274 */ |
294 */ |
275 HbListViewItem *mItem; |
295 HbListViewItem *mItem; |
276 |
296 |
277 /** |
297 /** |
278 * item to be returned from verticalScrollBar |
298 * item to be returned from verticalScrollBar |
281 |
301 |
282 /** |
302 /** |
283 * selection model |
303 * selection model |
284 */ |
304 */ |
285 QItemSelectionModel *mSelectionModel; |
305 QItemSelectionModel *mSelectionModel; |
286 |
306 |
287 /** |
307 /** |
288 * if true verticalScrollBar return null |
308 * if true verticalScrollBar return null |
289 */ |
309 */ |
290 static bool mVScrollBarIsNull; |
310 static bool mVScrollBarIsNull; |
291 |
311 |