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: Class declaration for the day/agenda view |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CALENDAYVIEW_H |
|
19 #define CALENDAYVIEW_H |
|
20 |
|
21 // System includes |
|
22 #include <QDateTime> |
|
23 |
|
24 // User includes |
|
25 #include "calennativeview.h" |
|
26 |
|
27 // Forward declarations |
|
28 class QGraphicsSceneMouseEvent; |
|
29 class CalenDayViewWidget; |
|
30 class CalenDocLoader; |
|
31 |
|
32 #ifdef CALENVIEWS_DLL |
|
33 #define CALENDAYVIEW_EXPORT Q_DECL_EXPORT |
|
34 #else |
|
35 #define CALENDAYVIEW_EXPORT Q_DECL_IMPORT |
|
36 #endif |
|
37 |
|
38 /** |
|
39 * @class CalenDayView |
|
40 * @brief Class declaration for the day/agenda view |
|
41 * which shows the list of events &/ to-do's (if any) |
|
42 * for any given day in the calendar. User can do other |
|
43 * basic operations like creating, viewing or deleting |
|
44 * an event |
|
45 */ |
|
46 class CalenDayView : public CalenNativeView |
|
47 { |
|
48 Q_OBJECT |
|
49 |
|
50 public: |
|
51 /** |
|
52 * @brief Constructor |
|
53 * @param services A reference to the MCalenServices object |
|
54 */ |
|
55 CALENDAYVIEW_EXPORT CalenDayView(MCalenServices &services); |
|
56 |
|
57 /** |
|
58 * @brief Default C++ constructor |
|
59 */ |
|
60 CALENDAYVIEW_EXPORT virtual ~CalenDayView(); |
|
61 |
|
62 /** |
|
63 * @brief Initializes the view after its creation |
|
64 * Must be called only after the view and its children are constructed |
|
65 * @param docLoader Pointer to the document loader object which has |
|
66 * loaded this view from the .docml file |
|
67 */ |
|
68 CALENDAYVIEW_EXPORT void setupView(CalenDocLoader *docLoader); |
|
69 |
|
70 /** |
|
71 * @brief Activates the current view. Sets this view as the current |
|
72 * view of the application's main window. Must be called only after |
|
73 * the view has been constructed and initialized |
|
74 */ |
|
75 CALENDAYVIEW_EXPORT virtual void doPopulation(); |
|
76 |
|
77 /** |
|
78 * @brief Callback function for any notifications that has been |
|
79 * subscribed by this view |
|
80 * @param notification The event for which notification is being sent |
|
81 */ |
|
82 CALENDAYVIEW_EXPORT void HandleNotification(const TCalenNotification notification); |
|
83 |
|
84 /** |
|
85 * @brief Getter function for the document loader. Called from the content |
|
86 * widget in order get its children |
|
87 */ |
|
88 CALENDAYVIEW_EXPORT CalenDocLoader* docLoader(); |
|
89 |
|
90 /** |
|
91 * @brief Refreshes the view with the date set in the context |
|
92 */ |
|
93 void refreshViewOnGoToDate(); |
|
94 |
|
95 protected: |
|
96 |
|
97 // TODO: Remove these after gestures are available |
|
98 void mousePressEvent(QGraphicsSceneMouseEvent *event); |
|
99 void mouseMoveEvent(QGraphicsSceneMouseEvent *event); |
|
100 bool eventFilter(QObject *source, QEvent *event); |
|
101 |
|
102 private: |
|
103 |
|
104 /** |
|
105 * @brief Connects to all the toolbar and menu actions associated |
|
106 * with this view |
|
107 */ |
|
108 void setupActions(); |
|
109 |
|
110 /** |
|
111 * @brief Callback function for listening to locale changes like |
|
112 * time format, date format etc |
|
113 */ |
|
114 void onLocaleChanged(int reason); |
|
115 |
|
116 private slots: |
|
117 |
|
118 /** |
|
119 * @brief Slot which is called whenever the orientation of the device changes |
|
120 * @param orientation The current device orientation |
|
121 */ |
|
122 void orientationChanged(Qt::Orientation orientation); |
|
123 |
|
124 /** |
|
125 * @brief Slot which launches back the month view |
|
126 */ |
|
127 void launchMonthView(); |
|
128 |
|
129 private: |
|
130 |
|
131 /** |
|
132 * @var mDate |
|
133 * @brief The date for which this view is being shown |
|
134 */ |
|
135 QDateTime mDate; |
|
136 |
|
137 /** |
|
138 * @var mSoftKeyAction |
|
139 * TODO: This may not be required going ahead |
|
140 */ |
|
141 HbAction *mSoftKeyAction; |
|
142 |
|
143 /** |
|
144 * @var mDayViewWidget |
|
145 * @brief The pointer to the content widget of this view |
|
146 */ |
|
147 CalenDayViewWidget *mDayViewWidget; |
|
148 |
|
149 /** |
|
150 * @var mDocLoader |
|
151 * @brief Pointer to the document loader which has loaded |
|
152 * this view |
|
153 */ |
|
154 CalenDocLoader *mDocLoader; |
|
155 |
|
156 /** |
|
157 * @var mGoToTodayAction |
|
158 * Action which provides "Go to today" functionality |
|
159 */ |
|
160 HbAction *mGoToTodayAction; |
|
161 |
|
162 // TODO: Remove these after gestures are available |
|
163 QPointF mTapPoint; |
|
164 bool mActionTaken; |
|
165 |
|
166 }; |
|
167 |
|
168 #endif /* CALENDAYVIEW_H */ |
|
169 |
|
170 // End of file --Don't remove this. |
|