|
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; |
|
35 qreal contentWidth() const; |
|
36 |
|
37 Qt::Orientation orientation() const; |
|
38 |
|
39 HbMainWindow* mainWindow(); |
|
40 |
|
41 /** |
|
42 * Get event's start/end time fromm agenda entry. |
|
43 * Start/end time are validated to be within the current day (the case of |
|
44 * multi-day events) |
|
45 * @param start [out] valid start time |
|
46 * @param end [out] valid end time |
|
47 * @param entry [in] agenda entry asociated with the event. |
|
48 * @param currentDate [in] current date |
|
49 */ |
|
50 void getEventValidStartEndTime( QDateTime& start, QDateTime& end, |
|
51 const AgendaEntry& entry, QDateTime& currentDate ); |
|
52 |
|
53 protected: |
|
54 CalenDayUtils(); |
|
55 |
|
56 private: |
|
57 qreal calculateHourElementWidth() const; |
|
58 qreal calculateHourElementHeight() const; |
|
59 |
|
60 private: // data |
|
61 |
|
62 static CalenDayUtils* mInstance; |
|
63 |
|
64 HbMainWindow* mMainWindow; //!< Pointer to main window |
|
65 |
|
66 qreal mHourElementWidth; //!< The width of hour element |
|
67 qreal mHourElementHeight; //!< The height of hour element |
|
68 }; |
|
69 |
|
70 #endif /* CALENDAYUTILS_H_ */ |