|
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 public slots: |
|
53 /** |
|
54 * Handle scrolling started signal |
|
55 */ |
|
56 void handleScrollingStarted(); |
|
57 |
|
58 /** |
|
59 * Handle scrolling started signal |
|
60 */ |
|
61 void handleScrollingEnded(); |
|
62 |
|
63 /** |
|
64 * Set total slides present in the contents widget |
|
65 * @param totalSlides |
|
66 */ |
|
67 void setTotalSlides(int totalSlides); |
|
68 |
|
69 /** |
|
70 * Resets the current slide to zero |
|
71 */ |
|
72 void resetCurrentSlide(); |
|
73 |
|
74 signals: |
|
75 |
|
76 /** |
|
77 * Sinal emitted when next slide is to be loaded |
|
78 */ |
|
79 void scrolledToNextSlide(); |
|
80 |
|
81 /** |
|
82 * Sinal emitted when previous slide is to be loaded |
|
83 */ |
|
84 void scrolledToPreviousSlide(); |
|
85 |
|
86 private: |
|
87 |
|
88 /** |
|
89 * current slide number |
|
90 */ |
|
91 int mCurrentSlide; |
|
92 |
|
93 /** |
|
94 * Total slide count |
|
95 */ |
|
96 int mTotalSlides; |
|
97 |
|
98 /** |
|
99 * Scrolling start pos |
|
100 */ |
|
101 QPointF mScrollStartPoint; |
|
102 |
|
103 /** |
|
104 * Scrolling end pos |
|
105 */ |
|
106 QPointF mScrollEndPoint; |
|
107 }; |
|
108 |
|
109 #endif //UNISCROLL_AREA_H |
|
110 // EOF |