|
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: HgMediawall stub for testing mpmediawallview |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef HGMEDIAWALL_H |
|
19 #define HGMEDIAWALL_H |
|
20 |
|
21 //includes |
|
22 #include <hbglobal.h> |
|
23 #include <hbnamespace.h> |
|
24 #include <hbwidget.h> |
|
25 #include <hbscrollbar.h> |
|
26 |
|
27 class HgWidget : public HbWidget |
|
28 { |
|
29 Q_OBJECT |
|
30 Q_PROPERTY(QSizeF itemSize READ itemSize WRITE setItemSize) |
|
31 |
|
32 public: |
|
33 |
|
34 enum ScrollBarPolicy { |
|
35 ScrollBarAsNeeded = Qt::ScrollBarAsNeeded, |
|
36 ScrollBarAlwaysOff = Qt::ScrollBarAlwaysOff, |
|
37 ScrollBarAlwaysOn = Qt::ScrollBarAlwaysOn, |
|
38 ScrollBarAutoHide |
|
39 }; |
|
40 |
|
41 enum IndexFeedbackPolicy { |
|
42 IndexFeedbackNone = 0, |
|
43 IndexFeedbackSingleCharacter, |
|
44 IndexFeedbackThreeCharacter, |
|
45 IndexFeedbackString |
|
46 }; |
|
47 |
|
48 explicit HgWidget ( QGraphicsItem *parent = 0 ); |
|
49 virtual ~HgWidget (); |
|
50 |
|
51 void setScrollBarPolicy( ScrollBarPolicy policy ); |
|
52 virtual void setModel(QAbstractItemModel *model); |
|
53 void scrollTo(const QModelIndex &index); |
|
54 QModelIndex currentIndex() const; |
|
55 |
|
56 void setItemSize(const QSizeF& size); |
|
57 QSizeF itemSize() const; |
|
58 void setDefaultImage(QImage defaultImage); |
|
59 void setIndexFeedbackPolicy( IndexFeedbackPolicy policy); |
|
60 HbScrollBar *scrollBar() const; |
|
61 bool getItemOutline(const QModelIndex& index, QPolygonF& points); |
|
62 |
|
63 signals: |
|
64 |
|
65 void scrollingEnded(); |
|
66 |
|
67 }; |
|
68 |
|
69 class HgMediawall : public HgWidget |
|
70 { |
|
71 Q_OBJECT |
|
72 |
|
73 public: |
|
74 |
|
75 enum LabelPosition { |
|
76 PositionNone = 0, |
|
77 PositionAboveImage, |
|
78 PositionBelowImage |
|
79 }; |
|
80 |
|
81 explicit HgMediawall( QGraphicsItem *parent = 0 ); |
|
82 virtual ~HgMediawall(); |
|
83 |
|
84 void setTitlePosition( LabelPosition position ); |
|
85 void setDescriptionPosition( LabelPosition position ); |
|
86 void setTitleFontSpec( const HbFontSpec &fontSpec ); |
|
87 void setDescriptionFontSpec( const HbFontSpec &fontSpec ); |
|
88 |
|
89 void enableReflections( bool enabled ); |
|
90 bool reflectionsEnabled() const; |
|
91 |
|
92 public: |
|
93 |
|
94 bool mReflectionEnabled; |
|
95 |
|
96 }; |
|
97 |
|
98 #endif // HGMEDIAWALL_H |