|
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 public slots: |
|
93 |
|
94 /** |
|
95 * Slot handles layout switch. |
|
96 * @param orientation Current device orientation |
|
97 */ |
|
98 void orientationChanged(Qt::Orientation orientation) |
|
99 { |
|
100 Q_UNUSED(orientation); |
|
101 } |
|
102 |
|
103 protected: |
|
104 |
|
105 /** |
|
106 * |
|
107 */ |
|
108 HbAbstractViewItem * createDefaultPrototype() const{ return 0;} |
|
109 |
|
110 /** |
|
111 * |
|
112 */ |
|
113 // void setItemModelIndex(HbAbstractViewItem *item, const QModelIndex &index); |
|
114 |
|
115 /** |
|
116 * Updates geometry of a timed event. |
|
117 */ |
|
118 // void updateTimedEventGeometry(HbAbstractViewItem *item, |
|
119 // const QModelIndex &index); |
|
120 |
|
121 /** |
|
122 * Updates geometry of a all-day events |
|
123 */ |
|
124 // void updateAllDayEventGeometry(HbAbstractViewItem *item, |
|
125 // const QModelIndex &index); |
|
126 |
|
127 /** |
|
128 * Structure with event layout values. |
|
129 * |
|
130 * eventAreaX X value for event area start. |
|
131 * eventAreaWidth The width of event area. |
|
132 * eventMargin Margins between the multiple events. |
|
133 * slotHeight Half hour slot's height. |
|
134 * unitInPixels no. of pixels in 1un |
|
135 */ |
|
136 |
|
137 /*struct LayoutValues { |
|
138 LayoutValues() |
|
139 :eventAreaX(0), |
|
140 eventAreaWidth(0), |
|
141 eventMargin(0), |
|
142 slotHeight(0), |
|
143 unitInPixels(0), |
|
144 maxColumns(0) |
|
145 {} |
|
146 |
|
147 qreal eventAreaX; |
|
148 qreal eventAreaWidth; |
|
149 qreal eventMargin; |
|
150 qreal slotHeight; |
|
151 qreal unitInPixels; |
|
152 int maxColumns; |
|
153 }; |
|
154 */ |
|
155 /** |
|
156 * Gets event layout values. |
|
157 * |
|
158 * @param layoutValues structure to be filled with layout data |
|
159 */ |
|
160 //void getTimedEventLayoutValues(LayoutValues& layoutValues); |
|
161 |
|
162 |
|
163 /** |
|
164 * creates absorbers which prevent touching to small items |
|
165 * (according to UI spec items smaller than ... are untouchable) |
|
166 */ |
|
167 //void createTouchEventAbsorbers(); |
|
168 |
|
169 /** |
|
170 * |
|
171 */ |
|
172 //TouchEventAbsorber* crateAbsorberBetweenSlots(int startSlot, int endSlot); |
|
173 |
|
174 private: |
|
175 |
|
176 //bool mGeometryUpdated; |
|
177 |
|
178 //QDateTime mDateTime; |
|
179 |
|
180 /** |
|
181 * Day event info. |
|
182 * Not own. |
|
183 */ |
|
184 //CalenDayInfo* mInfo; |
|
185 |
|
186 // LayoutValues mLayoutValues; |
|
187 //QList<TouchEventAbsorber*> mAbsorbers; |
|
188 }; |
|
189 |
|
190 |
|
191 |
|
192 class TouchEventAbsorber : public HbWidget |
|
193 { |
|
194 Q_OBJECT |
|
195 public: |
|
196 TouchEventAbsorber(QGraphicsItem *parent=0); |
|
197 ~TouchEventAbsorber(); |
|
198 |
|
199 protected: |
|
200 void gestureEvent(QGestureEvent *event); |
|
201 |
|
202 #ifdef _DEBUG |
|
203 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, |
|
204 QWidget *widget); |
|
205 #endif |
|
206 |
|
207 }; |
|
208 |
|
209 #endif // CALENDAYCONTAINER_H |
|
210 |
|
211 // End of File |