45
|
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
|
55
|
22 |
#include <QDateTime>
|
45
|
23 |
#include <hbabstractviewitem.h>
|
|
24 |
#include <hbtextitem.h>
|
|
25 |
#include <hbframeitem.h>
|
|
26 |
|
|
27 |
//Forward declarations
|
|
28 |
class AgendaEntry;
|
|
29 |
class CalenDayStatusStrip;
|
55
|
30 |
class CalenDayContainer;
|
45
|
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:
|
55
|
40 |
CalenDayItem(const CalenDayContainer *container);
|
45
|
41 |
virtual ~CalenDayItem();
|
|
42 |
HbAbstractViewItem * createItem();
|
|
43 |
void updateChildItems();
|
55
|
44 |
bool hasEventDescription() const { return mEventDesc->isVisible(); }
|
|
45 |
bool hasBackgroundFrame() const { return mBg->isVisible(); }
|
|
46 |
const CalenDayContainer *container() const { return mContainer; }
|
|
47 |
|
45
|
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
|
57 |
qreal mEventDescMinWidth;
|
|
58 |
qreal mFrameMinWidth;
|
|
59 |
|
45
|
60 |
HbFrameItem *mBg;
|
|
61 |
HbTextItem *mEventDesc;
|
57
|
62 |
|
45
|
63 |
CalenDayStatusStrip *mColorStripe;
|
55
|
64 |
const CalenDayContainer *mContainer;
|
45
|
65 |
};
|
|
66 |
|
|
67 |
#endif // CALENDAYITEM_H
|