diff -r 5de72ea7a065 -r 579cc610882e calendarui/views/dayview/inc/calendaystatusstrip.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/calendarui/views/dayview/inc/calendaystatusstrip.h Tue Jul 06 14:14:56 2010 +0300 @@ -0,0 +1,94 @@ +/* + * 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 control of calendar + * + */ + + +#ifndef CALENDAYSTATUSSTRIP_H +#define CALENDAYSTATUSSTRIP_H + +#include +#include + +class CalenDayStatusStrip : public HbWidget +{ + Q_OBJECT + Q_ENUMS(DrawingStyle) +public: + /*! + \brief It specifiy how status Strip should be drawed. + + OnlyFrame -- draw not filled rectangle + StripWithLines -- draw filled rectangle with transparent diagonal lines + Filled -- draw filled rectangle + */ + enum DrawingStyle + { + OnlyFrame, + StripWithLines, + Filled + }; + + + CalenDayStatusStrip(HbWidget *parent = 0); + ~CalenDayStatusStrip(); + + qreal range() const; + + QColor color() const; + + CalenDayStatusStrip::DrawingStyle drawingStyle() const; + + QPair startEndTime() const; + + void setRange(qreal mRange); + + void setColor(QColor mStripColor); + + void setDrawingStyle(CalenDayStatusStrip::DrawingStyle mDrawingStyle); + + void setStartEndTime(const QTime &startTime, const QTime &endTime); + + +protected: + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, + QWidget *widget = 0); + + QPolygonF diagonalLine(QPointF startPoint, qreal dx, qreal dy); + + + QPair calculateStartEndPostion( + const QTime &startTime, + const QTime &endTime + ); + + qreal calculateMinuteHeight(const QTime &start, const QTime &end); + +private: + qreal mRange; //! mStartEndEventTime; + + static const qreal mMinute;//!