30 |
30 |
31 // User includes |
31 // User includes |
32 #include "calengriditemprototype.h" |
32 #include "calengriditemprototype.h" |
33 #include "calencommon.h" |
33 #include "calencommon.h" |
34 #include "calentodayindicatorlinedrawer.h" |
34 #include "calentodayindicatorlinedrawer.h" |
|
35 #include "OstTraceDefinitions.h" |
|
36 #ifdef OST_TRACE_COMPILER_IN_USE |
|
37 #include "calengriditemprototypeTraces.h" |
|
38 #endif |
|
39 |
35 |
40 |
36 /*! |
41 /*! |
37 \class CalenGridItemPrototype |
42 \class CalenGridItemPrototype |
38 |
43 |
39 Prototype class for HbGridView. |
44 Prototype class for HbGridView. |
53 mEventIndicatorItem(0), |
58 mEventIndicatorItem(0), |
54 mMonthDayInfoItem(0), |
59 mMonthDayInfoItem(0), |
55 mFocusIndicatorItem(0), |
60 mFocusIndicatorItem(0), |
56 mTodayIndicatorItem(0) |
61 mTodayIndicatorItem(0) |
57 { |
62 { |
|
63 OstTraceFunctionEntry0( CALENGRIDITEMPROTOTYPE_CALENGRIDITEMPROTOTYPE_ENTRY ); |
|
64 |
|
65 OstTraceFunctionExit0( CALENGRIDITEMPROTOTYPE_CALENGRIDITEMPROTOTYPE_EXIT ); |
58 } |
66 } |
59 |
67 |
60 /*! |
68 /*! |
61 Constructs all the primitives |
69 Constructs all the primitives |
62 */ |
70 */ |
63 void CalenGridItemPrototype::createPrimitives() |
71 void CalenGridItemPrototype::createPrimitives() |
64 { |
72 { |
|
73 OstTraceFunctionEntry0( CALENGRIDITEMPROTOTYPE_CREATEPRIMITIVES_ENTRY ); |
|
74 |
65 if (!mMonthDayInfoItem) { |
75 if (!mMonthDayInfoItem) { |
66 mMonthDayInfoItem = new HbTextItem(this); |
76 mMonthDayInfoItem = new HbTextItem(this); |
67 HbStyle::setItemName(mMonthDayInfoItem, |
77 HbStyle::setItemName(mMonthDayInfoItem, |
68 QLatin1String("monthDayInfoTextItem")); |
78 QLatin1String("monthDayInfoTextItem")); |
69 mMonthDayInfoItem->setElideMode(Qt::ElideNone); |
79 mMonthDayInfoItem->setElideMode(Qt::ElideNone); |
88 mTodayIndicatorItem = new CalenTodayIndicatorLineDrawer(this); |
98 mTodayIndicatorItem = new CalenTodayIndicatorLineDrawer(this); |
89 HbStyle::setItemName( |
99 HbStyle::setItemName( |
90 mTodayIndicatorItem, QLatin1String("todayIndicatorItem")); |
100 mTodayIndicatorItem, QLatin1String("todayIndicatorItem")); |
91 } |
101 } |
92 |
102 |
|
103 OstTraceFunctionExit0( CALENGRIDITEMPROTOTYPE_CREATEPRIMITIVES_EXIT ); |
93 } |
104 } |
94 |
105 |
95 /*! |
106 /*! |
96 From HbAbstractViewItem. |
107 From HbAbstractViewItem. |
97 |
108 |
98 \return CalenGridItemPrototype* Pointer to the constructed object. |
109 \return CalenGridItemPrototype* Pointer to the constructed object. |
99 \sa HbAbstractViewItem, HbGridViewItem |
110 \sa HbAbstractViewItem, HbGridViewItem |
100 */ |
111 */ |
101 HbAbstractViewItem *CalenGridItemPrototype::createItem() |
112 HbAbstractViewItem *CalenGridItemPrototype::createItem() |
102 { |
113 { |
|
114 OstTraceFunctionEntry0( CALENGRIDITEMPROTOTYPE_CREATEITEM_ENTRY ); |
|
115 |
103 CalenGridItemPrototype* item = new CalenGridItemPrototype(*this); |
116 CalenGridItemPrototype* item = new CalenGridItemPrototype(*this); |
104 item->createPrimitives(); |
117 item->createPrimitives(); |
105 |
118 |
106 // Set the default frame to NULL so that HbGridView does not add its |
119 // Set the default frame to NULL so that HbGridView does not add its |
107 // default frame for items |
120 // default frame for items |
108 HbFrameBackground frame; |
121 HbFrameBackground frame; |
109 frame.setFrameGraphicsName(QString("")); |
122 frame.setFrameGraphicsName(QString("")); |
110 item->setDefaultFrame(frame); |
123 item->setDefaultFrame(frame); |
111 |
124 |
|
125 OstTraceFunctionExit0( CALENGRIDITEMPROTOTYPE_CREATEITEM_EXIT ); |
112 return item; |
126 return item; |
113 } |
127 } |
114 |
128 |
115 /*! |
129 /*! |
116 From HbAbstractViewItem. |
130 From HbAbstractViewItem. |
117 |
131 |
118 \sa HbAbstractViewItem, HbGridViewItem |
132 \sa HbAbstractViewItem, HbGridViewItem |
119 */ |
133 */ |
120 void CalenGridItemPrototype::updateChildItems() |
134 void CalenGridItemPrototype::updateChildItems() |
121 { |
135 { |
|
136 OstTraceFunctionEntry0( CALENGRIDITEMPROTOTYPE_UPDATECHILDITEMS_ENTRY ); |
|
137 |
122 // Here update content of each item. |
138 // Here update content of each item. |
123 QVariant monthDayRole; |
139 QVariant monthDayRole; |
124 bool monthFocusRole; |
140 bool monthFocusRole; |
125 bool underlineEnabled = false; |
141 bool underlineEnabled = false; |
126 bool monthEventRole; |
142 bool monthEventRole; |
177 } |
193 } |
178 } |
194 } |
179 |
195 |
180 // base class implementation |
196 // base class implementation |
181 HbGridViewItem::updateChildItems(); |
197 HbGridViewItem::updateChildItems(); |
|
198 OstTraceFunctionExit0( CALENGRIDITEMPROTOTYPE_UPDATECHILDITEMS_EXIT ); |
182 } |
199 } |
183 |
200 |
184 /*! |
201 /*! |
185 Function overwritten to avoid default behavior |
202 Function overwritten to avoid default behavior |
186 */ |
203 */ |
187 void CalenGridItemPrototype::pressStateChanged(bool pressed,bool animate) |
204 void CalenGridItemPrototype::pressStateChanged(bool pressed,bool animate) |
188 { |
205 { |
|
206 OstTraceFunctionEntry0( CALENGRIDITEMPROTOTYPE_PRESSSTATECHANGED_ENTRY ); |
|
207 |
189 Q_UNUSED(pressed) |
208 Q_UNUSED(pressed) |
190 Q_UNUSED(animate) |
209 Q_UNUSED(animate) |
191 // Just overrode it as we dont want to have any default behavior |
210 // Just overrode it as we dont want to have any default behavior |
|
211 OstTraceFunctionExit0( CALENGRIDITEMPROTOTYPE_PRESSSTATECHANGED_EXIT ); |
192 } |
212 } |
193 |
213 |
194 /*! |
214 /*! |
195 Function overwritten to avoid default behavior |
215 Function overwritten to avoid default behavior |
196 */ |
216 */ |
197 void CalenGridItemPrototype::pressStateChanged(bool animate) |
217 void CalenGridItemPrototype::pressStateChanged(bool animate) |
198 { |
218 { |
|
219 OstTraceFunctionEntry0( DUP1_CALENGRIDITEMPROTOTYPE_PRESSSTATECHANGED_ENTRY ); |
|
220 |
199 Q_UNUSED(animate) |
221 Q_UNUSED(animate) |
200 // Just overrode it as we dont want to have any default behavior |
222 // Just overrode it as we dont want to have any default behavior |
|
223 OstTraceFunctionExit0( DUP1_CALENGRIDITEMPROTOTYPE_PRESSSTATECHANGED_EXIT ); |
201 } |
224 } |
202 |
225 |
203 bool CalenGridItemPrototype::canSetModelIndex(const QModelIndex& index) |
226 bool CalenGridItemPrototype::canSetModelIndex(const QModelIndex& index) |
204 { |
227 { |
|
228 OstTraceFunctionEntry0( CALENGRIDITEMPROTOTYPE_CANSETMODELINDEX_ENTRY ); |
|
229 |
205 Q_UNUSED(index) |
230 Q_UNUSED(index) |
|
231 |
|
232 OstTraceFunctionExit0( CALENGRIDITEMPROTOTYPE_CANSETMODELINDEX_EXIT ); |
206 return true; |
233 return true; |
207 } |
234 } |
208 |
235 |
209 // End of file --Don't remove this. |
236 // End of file --Don't remove this. |