diff -r 2c54b51f39c4 -r bb2d3e476f29 calendarui/views/dayview/inc/calendaycontainer.h --- a/calendarui/views/dayview/inc/calendaycontainer.h Mon Jul 26 13:54:38 2010 +0530 +++ b/calendarui/views/dayview/inc/calendaycontainer.h Mon Aug 09 18:30:52 2010 +0530 @@ -1,34 +1,34 @@ /* -* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Day view container - parent widget for events (CalenDayItem) and -* hours area widgets (CalenDayEventsPane) -* Responsible for positioning and resizing events widgets. -* -*/ + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Day view container - parent widget for events (CalenDayItem) and + * hours area widgets (CalenDayEventsPane) + * Responsible for positioning and resizing events widgets. + * + */ #ifndef CALENDAYCONTAINER_H #define CALENDAYCONTAINER_H -//System includes +// System includes #include #include "../../../../../mw/hb/src/hbwidgets/itemviews/hbabstractitemcontainer_p.h" - -//Forward declarations +// Forward declarations class CalenDayInfo; class TouchEventAbsorber; +// Class declaration class CalenDayContainer : public HbAbstractItemContainer { Q_OBJECT @@ -37,27 +37,29 @@ CalenDayContainer(QGraphicsItem *parent = 0); ~CalenDayContainer(); - void itemAdded (int index, HbAbstractViewItem *item, bool animate); - void itemRemoved (HbAbstractViewItem *item, bool animate); + void itemAdded(int index, HbAbstractViewItem *item, bool animate); + void itemRemoved(HbAbstractViewItem *item, bool animate); void reset(); - void viewResized (const QSizeF &size); - - void setDayInfo( CalenDayInfo* dayInfo ); + void viewResized(const QSizeF &size); - void setDate( const QDate &date ); + void setDayInfo(CalenDayInfo* dayInfo); + CalenDayInfo* dayInfo(); + void setDate(const QDate &date); const QDate &date() const; - + public slots: void orientationChanged(Qt::Orientation orientation); - + protected: HbAbstractViewItem * createDefaultPrototype() const; void setItemModelIndex(HbAbstractViewItem *item, const QModelIndex &index); - - void updateTimedEventGeometry(HbAbstractViewItem *item, - const QModelIndex &index); - void updateAllDayEventGeometry(HbAbstractViewItem *item, - const QModelIndex &index); + + void updateTimedEventGeometry( + HbAbstractViewItem *item, + const QModelIndex &index); + void updateAllDayEventGeometry( + HbAbstractViewItem *item, + const QModelIndex &index); /*! \class LayoutValues @@ -69,37 +71,37 @@ slotHeight Half hour slot's height. unitInPixels No. of pixels in 1un maxColumns Max. no. of touchable overlapping timed events - */ - class LayoutValues { - public: - LayoutValues() - :eventAreaX(0), - eventAreaWidth(0), - eventMargin(0), - slotHeight(0), - unitInPixels(0), - maxColumns(0) - {} - qreal eventAreaX; - qreal eventAreaWidth; - qreal eventMargin; - qreal slotHeight; - qreal unitInPixels; - int maxColumns; + class LayoutValues + { + public: + LayoutValues() : + eventAreaX(0), eventAreaWidth(0), eventMargin(0), slotHeight(0), + unitInPixels(0), maxColumns(0) + { + } + + qreal eventAreaX; + qreal eventAreaWidth; + qreal eventMargin; + qreal slotHeight; + qreal unitInPixels; + int maxColumns; }; - + void getTimedEventLayoutValues(LayoutValues& layoutValues); void createTouchEventAbsorbers(); - TouchEventAbsorber* crateAbsorberBetweenSlots(int startSlot, int endSlot, bool forAllDayEvents); - + TouchEventAbsorber* crateAbsorberBetweenSlots( + int startSlot, + int endSlot, + bool forAllDayEvents); + private: - bool mGeometryUpdated; - - CalenDayInfo* mInfo; //! mAbsorbers; //! mAbsorbers; //!< Keeps needed touch absorbers + QDate mDate; //!< Keeps date currently associated with this container }; @@ -110,19 +112,23 @@ \brief Used when event widgets are to small (see UI spec.) */ class TouchEventAbsorber : public HbWidget - { - Q_OBJECT - public: - TouchEventAbsorber(QGraphicsItem *parent=0); - ~TouchEventAbsorber(); - protected: - void gestureEvent(QGestureEvent *event); - +{ + Q_OBJECT + +public: + TouchEventAbsorber(QGraphicsItem *parent = 0); + ~TouchEventAbsorber(); + +protected: + void gestureEvent(QGestureEvent *event); + #ifdef _DEBUG - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, - QWidget *widget); + void paint( + QPainter *painter, + const QStyleOptionGraphicsItem *option, + QWidget *widget); #endif - }; +}; #endif // CALENDAYCONTAINER_H // End of File