|
1 /* |
|
2 * Copyright (c) 2010 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef HGCOVERFLOWCONTAINER_H |
|
19 #define HGCOVERFLOWCONTAINER_H |
|
20 |
|
21 #include <hgwidgets/hgmediawall.h> |
|
22 #include "HgContainer.h" |
|
23 |
|
24 class HbLabel; |
|
25 |
|
26 class HgCoverflowContainer: public HgContainer |
|
27 { |
|
28 Q_OBJECT |
|
29 Q_DISABLE_COPY(HgCoverflowContainer) |
|
30 |
|
31 public: |
|
32 explicit HgCoverflowContainer(QGraphicsItem* parent = 0); |
|
33 virtual ~HgCoverflowContainer(); |
|
34 |
|
35 // events |
|
36 virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); |
|
37 virtual void resizeEvent(QGraphicsSceneResizeEvent *event); |
|
38 |
|
39 // from HgContainer |
|
40 virtual HgMediaWallRenderer* createRenderer(); |
|
41 virtual qreal getCameraDistance(qreal springVelocity); |
|
42 virtual qreal getCameraRotationY(qreal springVelocity); |
|
43 virtual void handleTapAction(const QPointF& pos, HgWidgetItem* hitItem, int hitItemIndex); |
|
44 virtual void handleLongTapAction(const QPointF& pos, HgWidgetItem* hitItem, int hitItemIndex); |
|
45 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); |
|
49 |
|
50 void setTitlePosition(HgMediawall::LabelPosition position); |
|
51 HgMediawall::LabelPosition titlePosition() const; |
|
52 void setDescriptionPosition(HgMediawall::LabelPosition position); |
|
53 HgMediawall::LabelPosition descriptionPosition() const; |
|
54 void setTitleFontSpec(const HbFontSpec &fontSpec); |
|
55 HbFontSpec titleFontSpec() const; |
|
56 void setDescriptionFontSpec(const HbFontSpec &fontSpec); |
|
57 HbFontSpec descriptionFontSpec() const; |
|
58 |
|
59 private: |
|
60 void positionLabels(); |
|
61 void updateLabels(int itemIndex); |
|
62 |
|
63 private: |
|
64 HbLabel *mTitleLabel; |
|
65 HbLabel *mDescriptionLabel; |
|
66 HgMediawall::LabelPosition mTitlePosition; |
|
67 HgMediawall::LabelPosition mDescriptionPosition; |
|
68 int mCenterIconTop; |
|
69 int mPrevPos; |
|
70 }; |
|
71 |
|
72 #endif |