54 public: |
54 public: |
55 CalenMonthGrid(QGraphicsItem *parent = NULL); |
55 CalenMonthGrid(QGraphicsItem *parent = NULL); |
56 ~CalenMonthGrid(); |
56 ~CalenMonthGrid(); |
57 void setView(CalenMonthView *view); |
57 void setView(CalenMonthView *view); |
58 void updateMonthGridModel(QList<CalenMonthData> &monthDataArray, |
58 void updateMonthGridModel(QList<CalenMonthData> &monthDataArray, |
59 int indexToBeScrolled); |
59 int indexToBeScrolled, bool isFirstTime); |
|
60 void updateMonthGridWithInActiveMonths( |
|
61 QList<CalenMonthData> &monthDataArray); |
|
62 void updateMonthGridWithEventIndicators( |
|
63 QList<CalenMonthData> &monthDataArray); |
60 void setCurrentIdex(int index); |
64 void setCurrentIdex(int index); |
61 int getCurrentIndex(); |
65 int getCurrentIndex(); |
62 |
66 |
63 protected: |
67 protected: |
64 void orientationChanged(Qt::Orientation newOrientation); |
68 void orientationChanged(Qt::Orientation newOrientation); |
|
69 void gestureEvent(QGestureEvent *event); |
65 |
70 |
66 private: |
71 private: |
|
72 void downGesture(); |
|
73 void upGesture(); |
|
74 void handlePrependingRows(QList<CalenMonthData > &monthDataList); |
|
75 void handleAppendingRows(QList<CalenMonthData > &monthDataList); |
|
76 void handlePanGestureFinished(); |
67 void mousePressEvent(QGraphicsSceneMouseEvent* event); |
77 void mousePressEvent(QGraphicsSceneMouseEvent* event); |
68 void mouseReleaseEvent(QGraphicsSceneMouseEvent* event); |
78 void mouseReleaseEvent(QGraphicsSceneMouseEvent* event); |
69 void setFocusToProperDay(); |
79 void setFocusToProperDay(); |
70 void setActiveDates(QDate activeDate); |
80 void setActiveDates(QDate activeDate); |
71 void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget); |
81 void paint(QPainter* painter, |
|
82 const QStyleOptionGraphicsItem* option, QWidget* widget); |
72 |
83 |
73 public slots: |
84 public slots: |
74 void scrollingFinished(); |
85 void scrollingFinished(); |
75 void prependRows(); |
86 void prependRows(); |
76 void appendRows(); |
87 void appendRows(); |
77 void itemActivated(const QModelIndex &index); |
88 void itemActivated(const QModelIndex &index); |
78 |
|
79 protected slots: |
|
80 void downGesture(int value); |
|
81 void upGesture(int value); |
|
82 void panGesture(const QPointF &delta); |
|
83 void timerExpired(); |
|
84 |
89 |
85 private: |
90 private: |
86 QStandardItemModel *mModel; |
91 QStandardItemModel *mModel; |
87 QList<CalenMonthData> mMonthDataArray; |
92 QList<CalenMonthData> mMonthDataArray; |
88 scrollDirection mDirection; |
93 scrollDirection mDirection; |
95 bool mIgnoreItemActivated; |
100 bool mIgnoreItemActivated; |
96 QPointF mPressedPos; |
101 QPointF mPressedPos; |
97 QColor mGridLineColor; |
102 QColor mGridLineColor; |
98 QColor mGridBorderColor; |
103 QColor mGridBorderColor; |
99 QGraphicsWidget* mContentWidget; |
104 QGraphicsWidget* mContentWidget; |
|
105 QList<QString> mLocalisedDates; |
|
106 QPointF mStartPos; |
100 }; |
107 }; |
101 |
108 |
102 #endif // CALENMONTHGRID_H |
109 #endif // CALENMONTHGRID_H |
103 |
110 |
104 // End of file --Don't remove this. |
111 // End of file --Don't remove this. |