33 class CalenDayItem : public HbAbstractViewItem |
33 class CalenDayItem : public HbAbstractViewItem |
34 { |
34 { |
35 Q_OBJECT |
35 Q_OBJECT |
36 Q_PROPERTY( bool eventDescription READ hasEventDescription ) |
36 Q_PROPERTY( bool eventDescription READ hasEventDescription ) |
37 Q_PROPERTY( bool backgroundFrame READ hasBackgroundFrame ) |
37 Q_PROPERTY( bool backgroundFrame READ hasBackgroundFrame ) |
38 |
38 Q_PROPERTY( BackgroundType backgroundType READ backgroundType ) |
|
39 Q_ENUMS( BackgroundType ) |
|
40 |
|
41 public: |
|
42 //Due to HbFrameItem size limitation (2047px) in case when we have long lasting |
|
43 //events, background item has the same height as screen and needs to be scrolled |
|
44 //along with the view. By default background type is set as static but final decision |
|
45 //is made when handling resize event i.e. when geomtry of event is already known. |
|
46 enum BackgroundType{ |
|
47 EStaticBackground, |
|
48 EFloatingBackground |
|
49 }; |
|
50 |
39 public: |
51 public: |
40 CalenDayItem(const CalenDayContainer *container); |
52 CalenDayItem(const CalenDayContainer *container); |
41 virtual ~CalenDayItem(); |
53 virtual ~CalenDayItem(); |
42 HbAbstractViewItem * createItem(); |
54 HbAbstractViewItem * createItem(); |
43 void updateChildItems(); |
55 void updateChildItems(); |
44 bool hasEventDescription() const { return mEventDesc->isVisible(); } |
56 bool hasEventDescription() const { return mEventDesc->isVisible(); } |
45 bool hasBackgroundFrame() const { return mBg->isVisible(); } |
57 bool hasBackgroundFrame() const { return mBg->isVisible(); } |
|
58 BackgroundType backgroundType() const { return mBackgroundType; } |
46 const CalenDayContainer *container() const { return mContainer; } |
59 const CalenDayContainer *container() const { return mContainer; } |
|
60 |
|
61 public slots: |
|
62 void scrollBackground(const QPointF &pos); |
47 |
63 |
|
64 signals: |
|
65 void backgroundTypeChanged(const CalenDayItem *item); |
|
66 |
48 protected: |
67 protected: |
49 void resizeEvent(QGraphicsSceneResizeEvent *event); |
68 void resizeEvent(QGraphicsSceneResizeEvent *event); |
50 |
69 |
51 private: |
70 private: |
52 CalenDayItem(const CalenDayItem &source); |
71 CalenDayItem(const CalenDayItem &source); |