|
1 /* |
|
2 * Copyright (c) 2009 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: |
|
15 * Header file for ClockMainView class. |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef CLOCKMAINVIEW_H |
|
20 #define CLOCKMAINVIEW_H |
|
21 |
|
22 // System includes |
|
23 #include <QObject> |
|
24 #include <HbView> |
|
25 |
|
26 // User includes |
|
27 #include "clockviewsdefines.h" |
|
28 #include "clockdatatypes.h" |
|
29 |
|
30 // Forward declarations |
|
31 class QGraphicsItem; |
|
32 class QTimer; |
|
33 class HbLabel; |
|
34 class HbListView; |
|
35 class HbAbstractViewItem; |
|
36 class ClockDocLoader; |
|
37 class ClockAppControllerIf; |
|
38 class AlarmClient; |
|
39 class TimezoneClient; |
|
40 class SettingsUtility; |
|
41 class SkinnableClock; |
|
42 class ClockAlarmListModel; |
|
43 |
|
44 class ClockMainView : public HbView |
|
45 { |
|
46 Q_OBJECT |
|
47 |
|
48 public: |
|
49 CLOCKVIEWS_EXPORT ClockMainView(QGraphicsItem *parent = 0); |
|
50 CLOCKVIEWS_EXPORT virtual ~ClockMainView(); |
|
51 |
|
52 public: |
|
53 CLOCKVIEWS_EXPORT void setupView( |
|
54 ClockAppControllerIf &controllerIf, ClockDocLoader *docLoader); |
|
55 |
|
56 public slots: |
|
57 void handleAlarmStatusChanged(int row); |
|
58 |
|
59 private slots: |
|
60 void refreshMainView(); |
|
61 void displayWorldClockView(); |
|
62 void addNewAlarm(); |
|
63 void openSettings(); |
|
64 void handleActivated(const QModelIndex &index); |
|
65 void handleLongPress(HbAbstractViewItem *item, const QPointF &coords); |
|
66 void deleteAlarm(); |
|
67 void updateDateLabel(); |
|
68 void updatePlaceLabel(); |
|
69 void updateClockWidget(); |
|
70 void handleAlarmListDisplay(); |
|
71 void checkOrientationAndLoadSection(Qt::Orientation orientation); |
|
72 |
|
73 private: |
|
74 void setmodel(); |
|
75 void hideAlarmList(bool show); |
|
76 |
|
77 private: |
|
78 QTimer *mTickTimer; |
|
79 |
|
80 HbAction *mRefreshMainView; |
|
81 HbAction *mDisplayWorldClockView; |
|
82 HbAction *mAddNewAlarm; |
|
83 HbAction *mSettingsAction; |
|
84 |
|
85 HbLabel *mDayLabel; |
|
86 HbLabel *mPlaceLabel; |
|
87 SkinnableClock *mClockWidget; |
|
88 HbLabel *mNoAlarmLabel; |
|
89 HbListView *mAlarmList; |
|
90 |
|
91 TimezoneClient *mTimezoneClient; |
|
92 AlarmClient *mAlarmClient; |
|
93 SettingsUtility *mSettingsUtility; |
|
94 ClockDocLoader *mDocLoader; |
|
95 ClockAppControllerIf *mAppControllerIf; |
|
96 ClockAlarmListModel *mAlarmListModel; |
|
97 |
|
98 int mSelectedItem; |
|
99 bool mHideAlarmList; |
|
100 }; |
|
101 |
|
102 #endif // CLOCKMAINVIEW_H |
|
103 |
|
104 // End of file --Don't remove this. |