calendarui/views/dayview/inc/calendaycontainer.h
changeset 55 2c54b51f39c4
parent 45 b6db4fd4947b
child 57 bb2d3e476f29
--- a/calendarui/views/dayview/inc/calendaycontainer.h	Mon Jul 12 02:32:28 2010 +0530
+++ b/calendarui/views/dayview/inc/calendaycontainer.h	Mon Jul 26 13:54:38 2010 +0530
@@ -11,7 +11,9 @@
 *
 * Contributors:
 *
-* Description:  Day view control of calendar
+* Description:  Day view container - parent widget for events (CalenDayItem) and
+* hours area widgets (CalenDayEventsPane)
+* Responsible for positioning and resizing events widgets.
 *
 */
 
@@ -20,10 +22,8 @@
 
 //System includes
 #include <QDateTime>
-
 #include "../../../../../mw/hb/src/hbwidgets/itemviews/hbabstractitemcontainer_p.h"
 
-//User includes
 
 //Forward declarations
 class CalenDayInfo;
@@ -34,87 +34,45 @@
     Q_OBJECT
 
 public:
-    
-    /**
-     * Constructor. 
-     */
     CalenDayContainer(QGraphicsItem *parent = 0);
-
-    /**
-     * Destructor.
-     */
     ~CalenDayContainer();
 
-    /**
-     * 
-     */
     void itemAdded (int index, HbAbstractViewItem *item, bool animate);
-    
-    /**
-     * 
-     */
     void itemRemoved (HbAbstractViewItem *item, bool animate);
-    
-    /**
-     * 
-     */
     void reset();
-    
-    /**
-     * 
-     */
     void viewResized (const QSizeF &size);
     
-    /**
-     * Sets day's info structer to the container.
-     * 
-     * @param dayInfo Day info.
-     */
     void setDayInfo( CalenDayInfo* dayInfo );
+
+    void setDate( const QDate &date );
+    const QDate &date() const;
     
 public slots:
-
-    /**
-     * Slot handles layout switch.
-     * @param orientation Current device orientation
-     */
     void orientationChanged(Qt::Orientation orientation);
     
 protected:
-
-    /**
-     * 
-     */
     HbAbstractViewItem * createDefaultPrototype() const;
-    
-    /**
-     * 
-     */
     void setItemModelIndex(HbAbstractViewItem *item, const QModelIndex &index);
     
-    /**
-     * Updates geometry of a timed event.
-     */
     void updateTimedEventGeometry(HbAbstractViewItem *item, 
                                   const QModelIndex &index);
-    
-    /**
-     * Updates geometry of a all-day events	
-     */
     void updateAllDayEventGeometry(HbAbstractViewItem *item, 
                                   const QModelIndex &index);
+
+    /*!
+     \class LayoutValues
+     \brief Structure with event layout values.
+     
+     eventAreaX X value for event area start.
+     eventAreaWidth The width of event area.
+     eventMargin Margins between the multiple events.
+     slotHeight Half hour slot's height.
+     unitInPixels No. of pixels in 1un
+     maxColumns Max. no. of touchable overlapping timed events
     
-    /**
-     * Structure with event layout values.
-     * 
-     * eventAreaX X value for event area start.
-     * eventAreaWidth The width of event area.
-     * eventMargin Margins between the multiple events.
-     * slotHeight Half hour slot's height.
-     * unitInPixels no. of pixels in 1un
      */
-
-    struct LayoutValues {
+    class LayoutValues {
+		public:	
 					LayoutValues()
 						:eventAreaX(0),
 						 eventAreaWidth(0),
@@ -122,8 +80,7 @@
 						 slotHeight(0),
 						 unitInPixels(0),
 						 maxColumns(0)
-						 {}
-						
+						 {}				
     	qreal eventAreaX;
     	qreal eventAreaWidth;
     	qreal eventMargin;
@@ -132,60 +89,40 @@
     	int maxColumns;
     };
     
-    /**
-     * Gets event layout values.
-     * 
-     * @param layoutValues structure to be filled with layout data
-     */
     void getTimedEventLayoutValues(LayoutValues& layoutValues);
-    
-    
-    /**
-     *  creates absorbers which prevent touching to small items
-     *  (according to UI spec items smaller than ... are untouchable)
-     */
     void createTouchEventAbsorbers();
-    
-    /**
-     * 
-     */
-    TouchEventAbsorber* crateAbsorberBetweenSlots(int startSlot, int endSlot);
+    TouchEventAbsorber* crateAbsorberBetweenSlots(int startSlot, int endSlot, bool forAllDayEvents);
     
 private:
-    
     bool mGeometryUpdated;
-
-    QDateTime mDateTime;
     
-    /**
-     * Day event info.
-     * Not own.
-     */
-    CalenDayInfo* mInfo;
-    
-    LayoutValues mLayoutValues;
-    QList<TouchEventAbsorber*> mAbsorbers;
+    CalenDayInfo* mInfo; //!<Day event info. Not owned.
+    LayoutValues mLayoutValues; //!<Keeps layout values, see LayoutValues class
+    QList<TouchEventAbsorber*> mAbsorbers; //!<Keeps needed touch absorbers.
+    QDate mDate; //!<Keeps date currently associated with this container.
 };
 
 
 
+/*!
+ \class TouchEventAbsorber
+ \brief TouchEventAbsorber objects are used to catch touch events.
+ \brief Used when event widgets are to small (see UI spec.) 
+ */
 class TouchEventAbsorber : public HbWidget
     	{
 	Q_OBJECT
     public:
     	TouchEventAbsorber(QGraphicsItem *parent=0);
-    	~TouchEventAbsorber();
-    	
+    	~TouchEventAbsorber();  	
     protected:
         void gestureEvent(QGestureEvent *event);
         
 #ifdef _DEBUG
         void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
 				QWidget *widget);
-#endif
-        
+#endif       
     	};
 
 #endif // CALENDAYCONTAINER_H
-
 // End of File