45
|
1 |
/*
|
57
|
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 |
*/
|
45
|
17 |
|
|
18 |
#ifndef CALENDAYHOURELEMENT_H
|
|
19 |
#define CALENDAYHOURELEMENT_H
|
|
20 |
|
57
|
21 |
// System includes
|
45
|
22 |
#include <QTime>
|
|
23 |
#include <QPen>
|
57
|
24 |
#include <HbWidget>
|
81
|
25 |
#include <HbTextItem>
|
45
|
26 |
|
57
|
27 |
// User includes
|
45
|
28 |
|
|
29 |
|
57
|
30 |
// Forward declarations
|
45
|
31 |
class CalenDayHourScrollArea;
|
|
32 |
|
|
33 |
class CalenDayHourElement : public HbWidget
|
|
34 |
{
|
81
|
35 |
Q_OBJECT
|
45
|
36 |
|
|
37 |
public:
|
57
|
38 |
|
|
39 |
CalenDayHourElement(const QTime &time, QGraphicsItem *parent = 0);
|
45
|
40 |
virtual ~CalenDayHourElement();
|
|
41 |
|
81
|
42 |
void paint(
|
|
43 |
QPainter * painter,
|
|
44 |
const QStyleOptionGraphicsItem * option,
|
|
45 |
QWidget * widget);
|
|
46 |
|
55
|
47 |
void setTime(const QTime &time);
|
|
48 |
QTime time() const;
|
81
|
49 |
|
|
50 |
public slots:
|
|
51 |
void localeChanged();
|
45
|
52 |
|
|
53 |
private:
|
81
|
54 |
void setupWithLocale();
|
57
|
55 |
|
81
|
56 |
private:
|
57
|
57 |
const CalenDayHourScrollArea *mContainer;
|
45
|
58 |
QTime mHour;
|
|
59 |
QColor mHourLineColor;
|
|
60 |
qreal mUnitInPixels;
|
81
|
61 |
|
|
62 |
HbTextItem *mTimeTextItem; //!< Text item for displaying time
|
|
63 |
HbTextItem *mAmpmTextItem; //!< Test item for displaying am/pm
|
45
|
64 |
};
|
|
65 |
|
|
66 |
#endif // CALENDAYHOURELEMENT_H
|