1 /* |
|
2 * Copyright (c) 2009 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CALENDAYCONTAINER_H |
|
19 #define CALENDAYCONTAINER_H |
|
20 |
|
21 //System includes |
|
22 #include <QDateTime> |
|
23 |
|
24 #include "../../../../../mw/hb/src/hbwidgets/itemviews/hbabstractitemcontainer_p.h" |
|
25 |
|
26 //User includes |
|
27 |
|
28 //Forward declarations |
|
29 #include "calendayinfo.h" |
|
30 |
|
31 class CalenDayContainer : public HbAbstractItemContainer |
|
32 { |
|
33 Q_OBJECT |
|
34 |
|
35 public: |
|
36 |
|
37 /** |
|
38 * Constructor. |
|
39 */ |
|
40 CalenDayContainer(QGraphicsItem *parent = 0) |
|
41 { |
|
42 Q_UNUSED(parent); |
|
43 } |
|
44 |
|
45 /** |
|
46 * Destructor. |
|
47 */ |
|
48 ~CalenDayContainer(){} |
|
49 |
|
50 /** |
|
51 * |
|
52 */ |
|
53 void itemAdded (int index, HbAbstractViewItem *item, bool animate) |
|
54 { |
|
55 Q_UNUSED(index); |
|
56 Q_UNUSED(item); |
|
57 Q_UNUSED(animate); |
|
58 } |
|
59 |
|
60 /** |
|
61 * |
|
62 */ |
|
63 void itemRemoved (HbAbstractViewItem *item, bool animate) |
|
64 { |
|
65 Q_UNUSED(item); |
|
66 Q_UNUSED(animate); |
|
67 } |
|
68 |
|
69 /** |
|
70 * |
|
71 */ |
|
72 //void reset(); |
|
73 |
|
74 /** |
|
75 * |
|
76 */ |
|
77 void viewResized (const QSizeF &size) |
|
78 { |
|
79 Q_UNUSED(size); |
|
80 } |
|
81 |
|
82 /** |
|
83 * Sets day's info structer to the container. |
|
84 * |
|
85 * @param dayInfo Day info. |
|
86 */ |
|
87 void setDayInfo( CalenDayInfo* dayInfo ) |
|
88 { |
|
89 Q_UNUSED(dayInfo); |
|
90 } |
|
91 |
|
92 void setDate( const QDate &date ) |
|
93 { |
|
94 Q_UNUSED(date); |
|
95 } |
|
96 |
|
97 const QDate &date() const |
|
98 { |
|
99 return QDate(); |
|
100 } |
|
101 |
|
102 public slots: |
|
103 |
|
104 /** |
|
105 * Slot handles layout switch. |
|
106 * @param orientation Current device orientation |
|
107 */ |
|
108 void orientationChanged(Qt::Orientation orientation) |
|
109 { |
|
110 Q_UNUSED(orientation); |
|
111 } |
|
112 |
|
113 protected: |
|
114 |
|
115 /** |
|
116 * |
|
117 */ |
|
118 HbAbstractViewItem * createDefaultPrototype() const{ return 0;} |
|
119 |
|
120 /** |
|
121 * |
|
122 */ |
|
123 // void setItemModelIndex(HbAbstractViewItem *item, const QModelIndex &index); |
|
124 |
|
125 /** |
|
126 * Updates geometry of a timed event. |
|
127 */ |
|
128 // void updateTimedEventGeometry(HbAbstractViewItem *item, |
|
129 // const QModelIndex &index); |
|
130 |
|
131 /** |
|
132 * Updates geometry of a all-day events |
|
133 */ |
|
134 // void updateAllDayEventGeometry(HbAbstractViewItem *item, |
|
135 // const QModelIndex &index); |
|
136 |
|
137 /** |
|
138 * Structure with event layout values. |
|
139 * |
|
140 * eventAreaX X value for event area start. |
|
141 * eventAreaWidth The width of event area. |
|
142 * eventMargin Margins between the multiple events. |
|
143 * slotHeight Half hour slot's height. |
|
144 * unitInPixels no. of pixels in 1un |
|
145 */ |
|
146 |
|
147 /*struct LayoutValues { |
|
148 LayoutValues() |
|
149 :eventAreaX(0), |
|
150 eventAreaWidth(0), |
|
151 eventMargin(0), |
|
152 slotHeight(0), |
|
153 unitInPixels(0), |
|
154 maxColumns(0) |
|
155 {} |
|
156 |
|
157 qreal eventAreaX; |
|
158 qreal eventAreaWidth; |
|
159 qreal eventMargin; |
|
160 qreal slotHeight; |
|
161 qreal unitInPixels; |
|
162 int maxColumns; |
|
163 }; |
|
164 */ |
|
165 /** |
|
166 * Gets event layout values. |
|
167 * |
|
168 * @param layoutValues structure to be filled with layout data |
|
169 */ |
|
170 //void getTimedEventLayoutValues(LayoutValues& layoutValues); |
|
171 |
|
172 |
|
173 /** |
|
174 * creates absorbers which prevent touching to small items |
|
175 * (according to UI spec items smaller than ... are untouchable) |
|
176 */ |
|
177 //void createTouchEventAbsorbers(); |
|
178 |
|
179 /** |
|
180 * |
|
181 */ |
|
182 //TouchEventAbsorber* crateAbsorberBetweenSlots(int startSlot, int endSlot); |
|
183 |
|
184 private: |
|
185 |
|
186 //bool mGeometryUpdated; |
|
187 |
|
188 //QDateTime mDateTime; |
|
189 |
|
190 /** |
|
191 * Day event info. |
|
192 * Not own. |
|
193 */ |
|
194 //CalenDayInfo* mInfo; |
|
195 |
|
196 // LayoutValues mLayoutValues; |
|
197 //QList<TouchEventAbsorber*> mAbsorbers; |
|
198 }; |
|
199 |
|
200 |
|
201 |
|
202 class TouchEventAbsorber : public HbWidget |
|
203 { |
|
204 Q_OBJECT |
|
205 public: |
|
206 TouchEventAbsorber(QGraphicsItem *parent=0); |
|
207 ~TouchEventAbsorber(); |
|
208 |
|
209 protected: |
|
210 void gestureEvent(QGestureEvent *event); |
|
211 |
|
212 #ifdef _DEBUG |
|
213 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, |
|
214 QWidget *widget); |
|
215 #endif |
|
216 |
|
217 }; |
|
218 |
|
219 #endif // CALENDAYCONTAINER_H |
|
220 |
|
221 // End of File |
|