|
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: CalenDayContentScrollArea class definition. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CALENDAYCONTENTSCROLLAREA_H_ |
|
19 #define CALENDAYCONTENTSCROLLAREA_H_ |
|
20 |
|
21 // System includes |
|
22 #include <hbscrollarea.h> |
|
23 |
|
24 // User includes |
|
25 #include "calendaycommonheaders.h" |
|
26 |
|
27 // Class declaration |
|
28 class CalenDayContentScrollArea : public HbScrollArea |
|
29 { |
|
30 Q_OBJECT |
|
31 |
|
32 public: |
|
33 CalenDayContentScrollArea(QGraphicsItem *parent = 0); |
|
34 virtual ~CalenDayContentScrollArea(); |
|
35 |
|
36 signals: |
|
37 void scrollAreaMoveStarted(CalenScrollDirection scrollTo); |
|
38 void scrollAreaMoveFinished(CalenScrollDirection scrollTo); |
|
39 |
|
40 public slots: |
|
41 void scrollToMiddleWidget(); |
|
42 |
|
43 protected: |
|
44 bool scrollByAmount(const QPointF &delta); |
|
45 |
|
46 void gestureEvent(QGestureEvent *event); |
|
47 bool eventFilter(QObject *obj, QEvent *event); |
|
48 bool event(QEvent *e); |
|
49 |
|
50 private: // private functions |
|
51 void checkPanDirection(QPanGesture *panGesture); |
|
52 void moveTo(const QPointF &newPosition, int time = 0); |
|
53 |
|
54 private slots: |
|
55 void moveFinished(); |
|
56 void orientationChanged(Qt::Orientation orientation); |
|
57 |
|
58 private: // data |
|
59 QPointF mStartPosition; //!< Start position of movement |
|
60 |
|
61 qreal mContentWidth; //!< Content width |
|
62 |
|
63 Qt::Orientation mOrientation; //!< Stores current orientation |
|
64 |
|
65 /*! |
|
66 \brief Pan gesture direction indicator |
|
67 |
|
68 Member is used when switching widgets by panning gesture is enabled. |
|
69 */ |
|
70 CalenPanDirection mPanDayDirection; |
|
71 |
|
72 bool mIsMoving; //!< Indicates if moving of scroll area is in progress |
|
73 |
|
74 /*! |
|
75 \brief Scroll area horizontal move direction |
|
76 */ |
|
77 CalenScrollDirection mMoveDirection; |
|
78 }; |
|
79 |
|
80 #endif /* CALENDAYCONTENTSCROLLAREA_H_ */ |