calendarui/views/dayview/inc/calendayitem.h
changeset 45 b6db4fd4947b
child 55 2c54b51f39c4
child 58 ef813d54df51
equal deleted inserted replaced
23:fd30d51f876b 45:b6db4fd4947b
       
     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 <hbabstractviewitem.h>
       
    23 #include <hbtextitem.h>
       
    24 #include <hbframeitem.h>
       
    25 
       
    26 //Forward declarations
       
    27 class AgendaEntry;
       
    28 class CalenDayStatusStrip;
       
    29 
       
    30 
       
    31 class CalenDayItem : public HbAbstractViewItem
       
    32 {
       
    33     Q_OBJECT
       
    34     Q_PROPERTY( bool eventDescription READ hasEventDescription )
       
    35     Q_PROPERTY( bool backgroundFrame READ hasBackgroundFrame )
       
    36     
       
    37 public:
       
    38     CalenDayItem();
       
    39     virtual ~CalenDayItem();
       
    40     HbAbstractViewItem * createItem();
       
    41     void updateChildItems();
       
    42     bool hasEventDescription() const { return mEventDesc->isVisible();}
       
    43     bool hasBackgroundFrame() const { return mBg->isVisible();}
       
    44 
       
    45 protected:
       
    46     void resizeEvent(QGraphicsSceneResizeEvent *event);
       
    47 
       
    48 private:
       
    49     CalenDayItem(const CalenDayItem &source);
       
    50 	void setDescription(const AgendaEntry &entry, bool allDayEvent);
       
    51     void setStatusStrip(const AgendaEntry &entry, bool allDayEvent);
       
    52 
       
    53     bool mUpdated;
       
    54     HbFrameItem *mBg;
       
    55     HbTextItem *mEventDesc;
       
    56     CalenDayStatusStrip *mColorStripe;
       
    57     qreal mEventDescMinWidth;
       
    58     qreal mFrameMinWidth; 
       
    59     
       
    60 };
       
    61 
       
    62 #endif // CALENDAYITEM_H