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: CalenDayView class definition.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef CALEDAYVIEW_H
|
|
19 |
#define CALEDAYVIEW_H
|
|
20 |
|
|
21 |
// System includes
|
|
22 |
#include <QDateTime>
|
|
23 |
#include <xqsettingskey.h>
|
|
24 |
|
|
25 |
// User includes
|
|
26 |
#include "calennativeview.h"
|
|
27 |
#include "calendaycommonheaders.h"
|
|
28 |
#include "hb_calencommands.hrh" // command ids
|
|
29 |
|
|
30 |
// Forward declarations
|
|
31 |
class QGraphicsLinearLayout;
|
|
32 |
class XQSettingsManager;
|
|
33 |
class QVariant;
|
|
34 |
class HbGroupBox;
|
|
35 |
class AgendaEntry;
|
|
36 |
class CalenDocLoader;
|
|
37 |
class CalenDayContentScrollArea;
|
|
38 |
class CalenDayContentWidget;
|
|
39 |
class CalenDayHourScrollArea;
|
|
40 |
class CalenDayModelManager;
|
|
41 |
|
|
42 |
|
|
43 |
// Constants
|
|
44 |
|
|
45 |
|
|
46 |
#ifdef CALENVIEWS_DLL
|
|
47 |
#define CALENDAYVIEW_EXPORT Q_DECL_EXPORT
|
|
48 |
#else
|
|
49 |
#define CALENDAYVIEW_EXPORT Q_DECL_IMPORT
|
|
50 |
#endif
|
|
51 |
|
|
52 |
class CalenDayView : public CalenNativeView
|
|
53 |
{
|
|
54 |
Q_OBJECT
|
|
55 |
|
|
56 |
public:
|
|
57 |
|
|
58 |
/**
|
|
59 |
* Constructor.
|
|
60 |
*
|
|
61 |
* @param services Calendar services.
|
|
62 |
*/
|
|
63 |
CALENDAYVIEW_EXPORT CalenDayView( MCalenServices &services );
|
|
64 |
|
|
65 |
/**
|
|
66 |
* Destructor.
|
|
67 |
*/
|
|
68 |
CALENDAYVIEW_EXPORT virtual ~CalenDayView();
|
|
69 |
|
|
70 |
public:
|
|
71 |
|
|
72 |
//From CalenNativeView
|
|
73 |
|
|
74 |
/**
|
|
75 |
* Handles locale change.
|
|
76 |
*
|
|
77 |
* @param reason Change reason.
|
|
78 |
*/
|
|
79 |
virtual void onLocaleChanged(int reason);
|
|
80 |
|
|
81 |
//From CalenView
|
|
82 |
|
|
83 |
/**
|
|
84 |
* Handles view (re)population.
|
|
85 |
*
|
|
86 |
*/
|
|
87 |
CALENDAYVIEW_EXPORT virtual void doPopulation();
|
|
88 |
|
|
89 |
/**
|
|
90 |
* Informs the organizer that the view's population is complete.
|
|
91 |
*/
|
|
92 |
virtual void populationComplete();
|
|
93 |
|
|
94 |
//From MCalenNotificationHandler
|
|
95 |
|
|
96 |
/**
|
|
97 |
* The function handles calendar notifications.
|
|
98 |
*/
|
|
99 |
virtual void HandleNotification( const TCalenNotification notification );
|
|
100 |
|
|
101 |
public:
|
|
102 |
//API
|
|
103 |
|
|
104 |
/**
|
|
105 |
* Sets up the view accroding to the 'xml'
|
|
106 |
*
|
|
107 |
* @param docLoader Loaded document.
|
|
108 |
*/
|
|
109 |
CALENDAYVIEW_EXPORT void setupView(CalenDocLoader* docLoader);
|
|
110 |
|
|
111 |
private slots:
|
|
112 |
|
|
113 |
/**
|
|
114 |
* Handles 'back' functionality;
|
|
115 |
*/
|
|
116 |
void onBack();
|
|
117 |
|
|
118 |
/**
|
|
119 |
* Updates selected date member and context
|
|
120 |
*/
|
|
121 |
void dayChangeStarted(CalenScrollDirection direction);
|
|
122 |
|
|
123 |
/**
|
|
124 |
* Refreshes the model
|
|
125 |
*/
|
|
126 |
void dayChanged(CalenScrollDirection direction);
|
|
127 |
|
|
128 |
/**
|
|
129 |
* Sets new date as heading text. Triggerd after fadeOut effect.
|
|
130 |
*/
|
|
131 |
void setHeadingText(const HbEffect::EffectStatus &status);
|
|
132 |
|
|
133 |
/**
|
|
134 |
* Handles actions from menu
|
|
135 |
*/
|
|
136 |
void runNewMeeting();
|
|
137 |
void runGoToToday();
|
|
138 |
void runChangeToAgendaView();
|
|
139 |
void runLunarData();
|
|
140 |
|
|
141 |
void showRegionalInformation(const HbEffect::EffectStatus &status);
|
|
142 |
void showRegionalInformationFadeIn();
|
|
143 |
void showHideRegionalInformationChanged(const XQSettingsKey& key, const QVariant& var);
|
|
144 |
|
|
145 |
public slots:
|
|
146 |
void changeView(TCalenCommandId viewId);
|
55
|
147 |
|
|
148 |
/**
|
|
149 |
* Scrolls content to correct position after view repopulation
|
|
150 |
*/
|
|
151 |
void setupViewport();
|
|
152 |
|
45
|
153 |
private:
|
|
154 |
/**
|
|
155 |
*
|
|
156 |
*/
|
|
157 |
void getCurrentDate();
|
|
158 |
|
|
159 |
/**
|
|
160 |
* setup menu for the view
|
|
161 |
*/
|
|
162 |
void setupMenu();
|
|
163 |
|
|
164 |
/**
|
|
165 |
* Connects view's slots.
|
|
166 |
*/
|
|
167 |
void setupSlots();
|
55
|
168 |
|
45
|
169 |
private: // members related to view management and gesture handling
|
|
170 |
|
|
171 |
CalenDayModelManager* mModelManager;
|
|
172 |
|
55
|
173 |
CalenDayContentScrollArea* mContentScrollArea; //!< Scroll area for content
|
|
174 |
CalenDayContentWidget* mContentWidget; //!< Content widget
|
|
175 |
CalenDayHourScrollArea* mHourScrollArea; //!< Scroll area for hour elements
|
|
176 |
QGraphicsLinearLayout* mVLayout; //!< Vertical layout for day view
|
45
|
177 |
|
55
|
178 |
CalenDocLoader* mDocLoader; //!< Document loader for day view
|
|
179 |
|
|
180 |
bool mIsLaunching; //!< Indicates that view is launching first time
|
|
181 |
|
45
|
182 |
private:
|
|
183 |
|
|
184 |
XQSettingsManager* mSettingsManager;
|
|
185 |
XQSettingsKey mRegionalInfo;
|
|
186 |
MCalenServices &mServices;
|
|
187 |
|
|
188 |
/**
|
|
189 |
* Current date/time.
|
|
190 |
*/
|
|
191 |
QDateTime mDate;
|
|
192 |
|
|
193 |
HbGroupBox *mHeadingLabel;
|
|
194 |
|
|
195 |
HbGroupBox *mRegionalInfoGroupBox;
|
|
196 |
/*!
|
|
197 |
* \brief It keep pointer to go to Today action from menu.
|
|
198 |
*/
|
|
199 |
HbAction *mGoToTodayMenuAction;
|
|
200 |
};
|
|
201 |
|
|
202 |
|
|
203 |
#endif // CALEDAYVIEW_H
|
|
204 |
|
|
205 |
//End of file
|