21 |
21 |
22 // User includes |
22 // User includes |
23 #include "clockalarmlistitemprototype.h" |
23 #include "clockalarmlistitemprototype.h" |
24 #include "clockdatatypes.h" |
24 #include "clockdatatypes.h" |
25 #include "clockmainview.h" |
25 #include "clockmainview.h" |
|
26 #include "OstTraceDefinitions.h" |
|
27 #ifdef OST_TRACE_COMPILER_IN_USE |
|
28 #include "clockalarmlistitemprototypeTraces.h" |
|
29 #endif |
|
30 |
26 |
31 |
27 /*! |
32 /*! |
28 \class ClockAlarmListItemPrototype |
33 \class ClockAlarmListItemPrototype |
29 |
34 |
30 TODO: Write description here. |
35 This is the prototype class for the items in the list view. This class is |
|
36 responsible for creating any cutom item types. |
31 */ |
37 */ |
32 |
38 |
33 /*! |
39 /*! |
34 Default constructor. |
40 Default constructor. |
35 |
41 |
36 \parent of type QGraphicsItem. |
42 \parent of type QGraphicsItem. |
37 */ |
43 */ |
38 ClockAlarmListItemPrototype::ClockAlarmListItemPrototype(QGraphicsItem *parent) |
44 ClockAlarmListItemPrototype::ClockAlarmListItemPrototype(QGraphicsItem *parent) |
39 :HbListViewItem(parent) |
45 :HbListViewItem(parent) |
40 { |
46 { |
|
47 OstTraceFunctionEntry0( CLOCKALARMLISTITEMPROTOTYPE_CLOCKALARMLISTITEMPROTOTYPE_ENTRY ); |
41 // Nothing yet. |
48 // Nothing yet. |
|
49 OstTraceFunctionExit0( CLOCKALARMLISTITEMPROTOTYPE_CLOCKALARMLISTITEMPROTOTYPE_EXIT ); |
42 } |
50 } |
43 |
51 |
44 /*! |
52 /*! |
45 Destructor. |
53 Destructor. |
46 */ |
54 */ |
47 ClockAlarmListItemPrototype::~ClockAlarmListItemPrototype() |
55 ClockAlarmListItemPrototype::~ClockAlarmListItemPrototype() |
48 { |
56 { |
|
57 OstTraceFunctionEntry0( DUP1_CLOCKALARMLISTITEMPROTOTYPE_CLOCKALARMLISTITEMPROTOTYPE_ENTRY ); |
49 // Nothing yet. |
58 // Nothing yet. |
|
59 OstTraceFunctionExit0( DUP1_CLOCKALARMLISTITEMPROTOTYPE_CLOCKALARMLISTITEMPROTOTYPE_EXIT ); |
50 } |
60 } |
51 |
61 |
52 /*! |
62 /*! |
53 Called for every view item in the list. |
63 Called for every view item in the list. |
54 |
64 |
55 \sa HbAbstractViewItem, HbListViewItem. |
65 \sa HbAbstractViewItem, HbListViewItem. |
56 */ |
66 */ |
57 void ClockAlarmListItemPrototype::updateChildItems() |
67 void ClockAlarmListItemPrototype::updateChildItems() |
58 { |
68 { |
|
69 OstTraceFunctionEntry0( CLOCKALARMLISTITEMPROTOTYPE_UPDATECHILDITEMS_ENTRY ); |
59 // First allow the base class to update. |
70 // First allow the base class to update. |
60 HbListViewItem::updateChildItems(); |
71 HbListViewItem::updateChildItems(); |
61 |
72 |
62 QVariant alarmIconRole = modelIndex().data(AlarmIcon).toString(); |
73 QVariant alarmIconRole = modelIndex().data(AlarmIcon).toString(); |
63 if (alarmIconRole.isValid()) { |
74 if (alarmIconRole.isValid()) { |
72 this, SLOT(handleAlarmStatusChanged())); |
83 this, SLOT(handleAlarmStatusChanged())); |
73 } |
84 } |
74 malarmIconItem->setIcon(alarmIconPath); |
85 malarmIconItem->setIcon(alarmIconPath); |
75 } |
86 } |
76 } |
87 } |
|
88 OstTraceFunctionExit0( CLOCKALARMLISTITEMPROTOTYPE_UPDATECHILDITEMS_EXIT ); |
77 } |
89 } |
78 |
90 |
79 /*! |
91 /*! |
80 Called to construct a HbListViewItem. |
92 Called to construct a HbListViewItem. |
81 |
93 |
82 \return AlarmListItemPrototype* Pointer to the constructed view item. |
94 \return AlarmListItemPrototype* Pointer to the constructed view item. |
83 */ |
95 */ |
84 ClockAlarmListItemPrototype *ClockAlarmListItemPrototype::createItem() |
96 ClockAlarmListItemPrototype *ClockAlarmListItemPrototype::createItem() |
85 { |
97 { |
|
98 OstTraceFunctionEntry0( CLOCKALARMLISTITEMPROTOTYPE_CREATEITEM_ENTRY ); |
86 return new ClockAlarmListItemPrototype(*this); |
99 return new ClockAlarmListItemPrototype(*this); |
87 } |
100 } |
88 |
101 |
89 /*! |
102 /*! |
90 SLOT which handles when the alarm push button is pressed. |
103 SLOT which handles when the alarm push button is pressed. |
91 */ |
104 */ |
92 void ClockAlarmListItemPrototype::handleAlarmStatusChanged() |
105 void ClockAlarmListItemPrototype::handleAlarmStatusChanged() |
93 { |
106 { |
|
107 OstTraceFunctionEntry0( CLOCKALARMLISTITEMPROTOTYPE_HANDLEALARMSTATUSCHANGED_ENTRY ); |
94 int row = modelIndex().row(); |
108 int row = modelIndex().row(); |
95 emit static_cast<ClockAlarmListItemPrototype*>( |
109 emit static_cast<ClockAlarmListItemPrototype*>( |
96 prototype())->alarmStatusHasChanged(row); |
110 prototype())->alarmStatusHasChanged(row); |
|
111 OstTraceFunctionExit0( CLOCKALARMLISTITEMPROTOTYPE_HANDLEALARMSTATUSCHANGED_EXIT ); |
97 } |
112 } |
98 |
113 |
99 // End of file --Don't remove this. |
114 // End of file --Don't remove this. |