32 explicit HgCoverflowContainer(QGraphicsItem* parent = 0); |
32 explicit HgCoverflowContainer(QGraphicsItem* parent = 0); |
33 virtual ~HgCoverflowContainer(); |
33 virtual ~HgCoverflowContainer(); |
34 |
34 |
35 // events |
35 // events |
36 virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); |
36 virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); |
37 virtual void resizeEvent(QGraphicsSceneResizeEvent *event); |
|
38 |
37 |
39 // from HgContainer |
38 // from HgContainer |
40 virtual HgMediaWallRenderer* createRenderer(Qt::Orientation scrollDirection); |
39 virtual HgMediaWallRenderer* createRenderer(Qt::Orientation scrollDirection); |
41 virtual qreal getCameraDistance(qreal springVelocity); |
40 virtual qreal getCameraDistance(qreal springVelocity); |
42 virtual qreal getCameraRotationY(qreal springVelocity); |
41 virtual qreal getCameraRotationY(qreal springVelocity); |
43 virtual void handleTapAction(const QPointF& pos, HgWidgetItem* hitItem, int hitItemIndex); |
42 virtual void handleTapAction(const QPointF& pos, HgWidgetItem* hitItem, int hitItemIndex); |
44 virtual void handleLongTapAction(const QPointF& pos, HgWidgetItem* hitItem, int hitItemIndex); |
43 virtual void handleLongTapAction(const QPointF& pos, HgWidgetItem* hitItem, int hitItemIndex); |
45 virtual void onScrollPositionChanged(qreal pos); |
44 virtual void onScrollPositionChanged(qreal pos); |
46 virtual void handleCurrentChanged(const QModelIndex & current); |
|
47 virtual void itemDataChanged(const int &firstIndex, const int &lastIndex); |
|
48 virtual void scrollToPosition(const QPointF& pos, bool animate); |
45 virtual void scrollToPosition(const QPointF& pos, bool animate); |
49 |
46 |
50 virtual QSizeF getAutoItemSize() const; |
47 virtual QSizeF getAutoItemSize() const; |
51 virtual QSizeF getAutoItemSpacing() const; |
48 virtual QSizeF getAutoItemSpacing() const; |
52 virtual void updateItemSizeAndSpacing(); |
49 virtual void updateItemSizeAndSpacing(); |
53 |
|
54 void setTitlePosition(HgMediawall::LabelPosition position); |
|
55 HgMediawall::LabelPosition titlePosition() const; |
|
56 void setDescriptionPosition(HgMediawall::LabelPosition position); |
|
57 HgMediawall::LabelPosition descriptionPosition() const; |
|
58 void setTitleFontSpec(const HbFontSpec &fontSpec); |
|
59 HbFontSpec titleFontSpec() const; |
|
60 void setDescriptionFontSpec(const HbFontSpec &fontSpec); |
|
61 HbFontSpec descriptionFontSpec() const; |
|
62 |
50 |
63 void setFrontItemPositionDelta(const QPointF& position); |
51 void setFrontItemPositionDelta(const QPointF& position); |
64 QPointF frontItemPositionDelta() const; |
52 QPointF frontItemPositionDelta() const; |
65 |
53 |
|
54 void setFrontItemElevationFactor(qreal factor); |
|
55 |
66 void enableReflections(bool enabled); |
56 void enableReflections(bool enabled); |
67 bool reflectionsEnabled() const; |
57 bool reflectionsEnabled() const; |
|
58 |
|
59 void setCenterItemArea(HgCenterItemArea *centerItemArea); |
|
60 |
|
61 public slots: |
|
62 |
|
63 void updateItemSize(); |
68 |
64 |
69 signals: |
65 signals: |
70 |
66 |
71 void animationAboutToEnd(const QModelIndex& targetIndex); |
67 void animationAboutToEnd(const QModelIndex& targetIndex); |
72 |
68 |
73 private: // From HgContainer |
|
74 void setDefaultImage(QImage defaultImage); |
|
75 |
|
76 private: |
69 private: |
77 |
70 |
78 void updateLabels(int itemIndex); |
71 void calculateItemSize(); |
79 |
|
80 void updatePositions(); |
|
81 |
|
82 void calculatePositions(); |
|
83 void positionLabels(); |
|
84 void onScrollingStarted(); |
72 void onScrollingStarted(); |
85 void onScrollingEnded(); |
73 void onScrollingEnded(); |
86 |
74 |
|
75 void resizeEvent(QGraphicsSceneResizeEvent *event); |
|
76 |
87 private: |
77 private: |
88 HbLabel *mTitleLabel; |
78 int mPrevPos; |
89 HbLabel *mDescriptionLabel; |
79 QSizeF mAutoSize; |
90 HgMediawall::LabelPosition mTitlePosition; |
80 bool mAnimationAboutToEndReacted; |
91 HgMediawall::LabelPosition mDescriptionPosition; |
81 HgCenterItemArea *mCenterItemArea; |
92 int mPrevPos; |
|
93 qreal mAspectRatio; |
|
94 QSizeF mAutoSize; |
|
95 bool mAnimationAboutToEndReacted; |
|
96 }; |
82 }; |
97 |
83 |
98 #endif |
84 #endif |