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: CalenDayUtils utility class header.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef CALENDAYUTILS_H_
|
|
19 |
#define CALENDAYUTILS_H_
|
|
20 |
|
|
21 |
// Forward declarations
|
|
22 |
class HbMainWindow;
|
|
23 |
class QDateTime;
|
|
24 |
class AgendaEntry;
|
|
25 |
|
|
26 |
class CalenDayUtils
|
|
27 |
{
|
|
28 |
public:
|
|
29 |
static CalenDayUtils *instance();
|
|
30 |
~CalenDayUtils();
|
|
31 |
|
|
32 |
qreal screenWidth() const;
|
|
33 |
qreal hourElementWidth() const;
|
|
34 |
qreal hourElementHeight() const;
|
70
|
35 |
qreal minEventHeight() const;
|
45
|
36 |
qreal contentWidth() const;
|
|
37 |
|
|
38 |
Qt::Orientation orientation() const;
|
|
39 |
|
|
40 |
HbMainWindow* mainWindow();
|
|
41 |
|
81
|
42 |
void getEventValidStartEndTime(
|
|
43 |
QDateTime& start,
|
|
44 |
QDateTime& end,
|
|
45 |
const AgendaEntry& entry,
|
|
46 |
QDateTime& currentDate);
|
45
|
47 |
|
|
48 |
protected:
|
|
49 |
CalenDayUtils();
|
|
50 |
|
|
51 |
private:
|
|
52 |
qreal calculateHourElementWidth() const;
|
|
53 |
qreal calculateHourElementHeight() const;
|
70
|
54 |
qreal calculateMinEventHeight() const;
|
45
|
55 |
|
|
56 |
private: // data
|
|
57 |
|
|
58 |
static CalenDayUtils* mInstance;
|
|
59 |
|
|
60 |
HbMainWindow* mMainWindow; //!< Pointer to main window
|
|
61 |
|
|
62 |
qreal mHourElementWidth; //!< The width of hour element
|
|
63 |
qreal mHourElementHeight; //!< The height of hour element
|
70
|
64 |
qreal mMinEventHeight; //!< The minimum height of event bubble
|
45
|
65 |
};
|
|
66 |
|
|
67 |
#endif /* CALENDAYUTILS_H_ */
|