|
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: Page indicator |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef HSPAGEINDICATOR_H |
|
19 #define HSPAGEINDICATOR_H |
|
20 |
|
21 #include <hbwidget.h> |
|
22 |
|
23 #include "hsutils_global.h" |
|
24 #include "hstest_global.h" |
|
25 |
|
26 class QGraphicsLinearLayout; |
|
27 class QParallelAnimationGroup; |
|
28 class HbIconItem; |
|
29 |
|
30 HOMESCREEN_TEST_CLASS(t_hsUtils) |
|
31 |
|
32 class HSUTILS_EXPORT HsPageIndicator: public HbWidget |
|
33 { |
|
34 Q_OBJECT |
|
35 |
|
36 public: |
|
37 HsPageIndicator(QGraphicsItem* parent = 0); |
|
38 ~HsPageIndicator(); |
|
39 |
|
40 signals: |
|
41 void currentItemChangeAnimationFinished(); |
|
42 |
|
43 public slots: |
|
44 void addItem(bool setAsCurrent=false,bool animated=true); |
|
45 void removeItem(bool animated=true); |
|
46 void setCurrentIndex(int currentIndex,bool animated=true); |
|
47 |
|
48 public: |
|
49 void setItemCount(int itemCount); |
|
50 int itemCount(); |
|
51 int currentIndex(); |
|
52 bool isAnimatingCurrentItemChange(); |
|
53 |
|
54 private slots: |
|
55 void resetEffect(); |
|
56 |
|
57 private: |
|
58 void addItemInternal(bool setAsCurrent,int itemIndex,bool animated=true); |
|
59 |
|
60 void startItemAnimation(); |
|
61 |
|
62 private: |
|
63 int mItemCount; |
|
64 int mCurrentIndex; |
|
65 HbIcon *mNonActiveIcon; |
|
66 HbIcon *mActiveIcon; |
|
67 QSizeF mItemSize; |
|
68 QGraphicsLinearLayout *mPageIndicatorLayout; |
|
69 QParallelAnimationGroup *mIconAnimationGroup; |
|
70 |
|
71 HOMESCREEN_TEST_FRIEND_CLASS(t_hsUtils) |
|
72 }; |
|
73 |
|
74 #endif |