|
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: Customized scroll area which handles dynamic slide loading in |
|
15 * unifiedviewer |
|
16 * |
|
17 */ |
|
18 #ifndef UNISCROLL_AREA_H |
|
19 #define UNISCROLL_AREA_H |
|
20 |
|
21 #include <hbwidget.h> |
|
22 #include <hbscrollarea.h> |
|
23 #include <qobject.h> |
|
24 #include <QTimer> |
|
25 |
|
26 class QGraphicsItem; |
|
27 /** |
|
28 * Customized scroll area which handles dynamic slide loading in unifiedviewer |
|
29 */ |
|
30 class UniScrollArea : public HbScrollArea |
|
31 { |
|
32 Q_OBJECT |
|
33 |
|
34 public: |
|
35 /** |
|
36 * Constructor |
|
37 */ |
|
38 UniScrollArea(QGraphicsItem * parent = 0); |
|
39 |
|
40 /** |
|
41 * Destructor |
|
42 */ |
|
43 ~UniScrollArea(); |
|
44 |
|
45 public: |
|
46 |
|
47 /** |
|
48 * Set the sroll area pos to the start |
|
49 */ |
|
50 void setPosToStart(); |
|
51 |
|
52 /** |
|
53 * Handler for UpGesture |
|
54 */ |
|
55 void upGesture(int value); |
|
56 |
|
57 /** |
|
58 * Handler for DownGesture |
|
59 */ |
|
60 void downGesture(int value); |
|
61 |
|
62 public slots: |
|
63 /** |
|
64 * Handle scrolling started signal |
|
65 */ |
|
66 void handleScrollingStarted(); |
|
67 |
|
68 /** |
|
69 * Handle scrolling started signal |
|
70 */ |
|
71 void handleScrollingEnded(); |
|
72 |
|
73 /** |
|
74 * Set total slides present in the contents widget |
|
75 * @param totalSlides |
|
76 */ |
|
77 void setTotalSlides(int totalSlides); |
|
78 |
|
79 /** |
|
80 * Resets the current slide to zero |
|
81 */ |
|
82 void resetCurrentSlide(); |
|
83 |
|
84 signals: |
|
85 |
|
86 /** |
|
87 * Sinal emitted when next slide is to be loaded |
|
88 */ |
|
89 void scrolledToNextSlide(); |
|
90 |
|
91 /** |
|
92 * Sinal emitted when previous slide is to be loaded |
|
93 */ |
|
94 void scrolledToPreviousSlide(); |
|
95 |
|
96 private: |
|
97 |
|
98 /** |
|
99 * current slide number |
|
100 */ |
|
101 int mCurrentSlide; |
|
102 |
|
103 /** |
|
104 * Total slide count |
|
105 */ |
|
106 int mTotalSlides; |
|
107 |
|
108 /** |
|
109 * Scrolling start pos |
|
110 */ |
|
111 QPointF mScrollStartPoint; |
|
112 |
|
113 /** |
|
114 * Scrolling end pos |
|
115 */ |
|
116 QPointF mScrollEndPoint; |
|
117 }; |
|
118 |
|
119 #endif //UNISCROLL_AREA_H |
|
120 // EOF |