calendarui/views/dayview/inc/calendayitem.h
branchRCL_3
changeset 65 12af337248b1
equal deleted inserted replaced
60:96907930389d 65:12af337248b1
       
     1 /*
       
     2 * Copyright (c) 2010 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:  Day view control of calendar
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CALENDAYITEM_H
       
    19 #define CALENDAYITEM_H
       
    20 
       
    21 //System includes
       
    22 #include <QDateTime>
       
    23 #include <hbabstractviewitem.h>
       
    24 #include <hbtextitem.h>
       
    25 #include <hbframeitem.h>
       
    26 
       
    27 //Forward declarations
       
    28 class AgendaEntry;
       
    29 class CalenDayStatusStrip;
       
    30 class CalenDayContainer;
       
    31 
       
    32 
       
    33 class CalenDayItem : public HbAbstractViewItem
       
    34 {
       
    35     Q_OBJECT
       
    36     Q_PROPERTY( bool eventDescription READ hasEventDescription )
       
    37     Q_PROPERTY( bool backgroundFrame READ hasBackgroundFrame )
       
    38     
       
    39 public:
       
    40     CalenDayItem(const CalenDayContainer *container);
       
    41     virtual ~CalenDayItem();
       
    42     HbAbstractViewItem * createItem();
       
    43     void updateChildItems();
       
    44     bool hasEventDescription() const { return mEventDesc->isVisible(); }
       
    45     bool hasBackgroundFrame() const { return mBg->isVisible(); }
       
    46     const CalenDayContainer *container() const { return mContainer; }
       
    47     
       
    48 protected:
       
    49     void resizeEvent(QGraphicsSceneResizeEvent *event);
       
    50 
       
    51 private:
       
    52     CalenDayItem(const CalenDayItem &source);
       
    53 	void setDescription(const AgendaEntry &entry, bool allDayEvent);
       
    54     void setStatusStrip(const AgendaEntry &entry, bool allDayEvent);
       
    55 
       
    56     bool mUpdated;
       
    57     qreal mEventDescMinWidth;
       
    58     qreal mFrameMinWidth;
       
    59 
       
    60     HbFrameItem *mBg;
       
    61     HbTextItem *mEventDesc;
       
    62 
       
    63     CalenDayStatusStrip *mColorStripe;
       
    64     const CalenDayContainer *mContainer;
       
    65 };
       
    66 
       
    67 #endif // CALENDAYITEM_H