37
|
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: Manages differnt messaging views.
|
|
15 |
*
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
|
|
19 |
#ifndef MSGSERVICEVIEWMANAGER_H_
|
|
20 |
#define MSGSERVICEVIEWMANAGER_H_
|
|
21 |
|
|
22 |
#include <QObject>
|
|
23 |
#include <QVariant>
|
51
|
24 |
#include <HbEffect>
|
56
|
25 |
#include <convergedmessage.h>
|
37
|
26 |
|
51
|
27 |
class QGraphicsItem;
|
|
28 |
class QGraphicsPixmapItem;
|
37
|
29 |
class HbMainWindow;
|
|
30 |
class MsgUnifiedEditorView;
|
|
31 |
class UnifiedViewer;
|
|
32 |
class MsgBaseView;
|
|
33 |
class MsgSettingsView;
|
|
34 |
class HbAction;
|
|
35 |
class MsgStoreHandler;
|
|
36 |
|
|
37 |
class MsgServiceViewManager: public QObject
|
|
38 |
{
|
|
39 |
Q_OBJECT
|
|
40 |
|
|
41 |
public:
|
|
42 |
/**
|
|
43 |
* Constructor
|
|
44 |
*/
|
|
45 |
MsgServiceViewManager(MsgStoreHandler* storeHandler,
|
|
46 |
HbMainWindow* mainWindow, QObject* parent = 0);
|
|
47 |
|
|
48 |
/**
|
|
49 |
* Destructor.
|
|
50 |
*/
|
|
51 |
~MsgServiceViewManager();
|
|
52 |
|
|
53 |
/**
|
|
54 |
* Send message.
|
|
55 |
* @param phoneNumber phone number.
|
|
56 |
* @param contactId contactId.
|
|
57 |
* @param displayName displayname.
|
|
58 |
*/
|
|
59 |
void send(const QString phoneNumber,
|
|
60 |
const qint32 contactId,
|
|
61 |
const QString displayName);
|
|
62 |
|
|
63 |
/**
|
|
64 |
* Send message.
|
|
65 |
* @param phoneNumber phone number.
|
|
66 |
* @param alias alias.
|
|
67 |
* @param bodyText body text.
|
|
68 |
*/
|
|
69 |
void send(const QString phoneNumber,
|
|
70 |
const QString alias,
|
|
71 |
const QString bodyText);
|
|
72 |
|
|
73 |
/**
|
|
74 |
* Send message.
|
|
75 |
* @param addressList list of phone numbers and displaynames.
|
|
76 |
* key is the phone number and value is the display name.
|
|
77 |
* @param bodyText body text.
|
|
78 |
*/
|
|
79 |
void send(const QVariantMap addressList,
|
|
80 |
const QString bodyText = QString());
|
|
81 |
|
|
82 |
/**
|
|
83 |
* Send message.
|
|
84 |
* @param data data to be sent.
|
|
85 |
*/
|
|
86 |
void send(QVariant data);
|
56
|
87 |
|
|
88 |
/**
|
|
89 |
* Send message.
|
|
90 |
*/
|
|
91 |
void send(ConvergedMessage message);
|
|
92 |
|
37
|
93 |
/**
|
|
94 |
* Opens the viewer to view the message.
|
|
95 |
* @param msgId message id of the message.
|
|
96 |
*/
|
|
97 |
void view(int msgId);
|
|
98 |
|
62
|
99 |
/**
|
|
100 |
* Handles the HW key events.
|
|
101 |
* @param key key type.
|
|
102 |
* @return true if key event handled else false.
|
|
103 |
*/
|
|
104 |
bool handleKeyEvent(int key);
|
73
|
105 |
|
|
106 |
/**
|
|
107 |
* Save editor contents to drafts
|
|
108 |
*/
|
|
109 |
void saveContentToDraft();
|
62
|
110 |
|
37
|
111 |
private:
|
|
112 |
/*
|
|
113 |
* Switch to unieditor.
|
|
114 |
* @param editorData editor data.
|
|
115 |
*/
|
|
116 |
void switchToUniEditor(const QVariantList& editorData);
|
|
117 |
|
|
118 |
/*
|
|
119 |
* Switch to settings view.
|
|
120 |
*/
|
|
121 |
void switchToMsgSettings(const QVariantList& data);
|
|
122 |
|
|
123 |
/**
|
67
|
124 |
* Show information popup dialog
|
|
125 |
* @param dispText, text to be displayed
|
|
126 |
*/
|
|
127 |
void showPopup(const QString& dispText);
|
|
128 |
|
|
129 |
/**
|
|
130 |
* Handle Draft messages
|
|
131 |
* @param msgId, message id
|
|
132 |
* @param msgType, type of message e.g. sms or mms etc
|
37
|
133 |
*/
|
67
|
134 |
void handleDraftMsg(int msgId, int msgType);
|
|
135 |
|
|
136 |
/**
|
|
137 |
* Handle Business Card messages (for view)
|
|
138 |
* @param msgId, message id
|
|
139 |
*/
|
|
140 |
void handleVCardMsg(int msgId);
|
|
141 |
|
|
142 |
/**
|
|
143 |
* Handle sms and mms message
|
|
144 |
* @param msgId, message id
|
|
145 |
*/
|
|
146 |
void handleSmsMmsMsg(int msgId);
|
|
147 |
|
|
148 |
/**
|
|
149 |
* Handle MMS notification message
|
|
150 |
* @param msgId, message id
|
|
151 |
*/
|
|
152 |
void handleMmsNotification(int msgId);
|
37
|
153 |
|
|
154 |
/**
|
|
155 |
* Handle ringtone message
|
|
156 |
* @param msgId message id
|
|
157 |
*/
|
|
158 |
void handleRingtoneMsg(int msgId);
|
|
159 |
|
|
160 |
/**
|
|
161 |
* Handle provisioning message
|
|
162 |
* @param msgId message id
|
|
163 |
*/
|
|
164 |
void handleProvisoningMsg(int msgId);
|
|
165 |
|
|
166 |
/**
|
|
167 |
* Handle bluetooth message
|
|
168 |
* @param msgId message id
|
|
169 |
*/
|
|
170 |
void handleBTMessage(int msgId);
|
67
|
171 |
|
51
|
172 |
/**
|
|
173 |
* Start a custom effect animation
|
|
174 |
* e.g. editor's send effect
|
|
175 |
* @param effectEvent, effect type for animation
|
|
176 |
*/
|
|
177 |
void startAnimation(QString effectEvent);
|
|
178 |
|
|
179 |
/**
|
|
180 |
* Reset a custom effect animation
|
|
181 |
* e.g. editor's send effect
|
|
182 |
* @param effectEvent, animation effect type which needs to be reset
|
|
183 |
* @param item, QGraphicsItem on which the effect was run
|
|
184 |
*/
|
|
185 |
void resetAnimation(QString effectEvent, QGraphicsItem* item);
|
|
186 |
|
|
187 |
/**
|
|
188 |
* Grab screenshot for animation purpose
|
|
189 |
* e.g. editor's send effect animation
|
|
190 |
* @return QGraphicsPixmapItem, item on which animation will run
|
|
191 |
*/
|
|
192 |
QGraphicsPixmapItem *screenShot();
|
|
193 |
|
|
194 |
/**
|
|
195 |
* find and return animation file for an effect
|
|
196 |
* @param effectEvent, effect for which file definition needs to be found
|
|
197 |
* @return QString, animation definition file path
|
|
198 |
*/
|
|
199 |
QString getAnimationFile(QString effectEvent);
|
67
|
200 |
|
37
|
201 |
private slots:
|
|
202 |
/**
|
|
203 |
* This slot is called on mainwindows back action.
|
|
204 |
*/
|
|
205 |
void onBackAction();
|
|
206 |
|
|
207 |
/**
|
|
208 |
* This slot is called when switchView signal is emitted from a view.
|
|
209 |
* @param data data required to switch the views.
|
|
210 |
*/
|
|
211 |
void switchView(const QVariantList& data);
|
|
212 |
|
|
213 |
/**
|
67
|
214 |
* This slot sets the current view on view-ready signal of mainwindow.
|
|
215 |
* This is needed to show the default transitions correctly.
|
37
|
216 |
*/
|
67
|
217 |
void showOnViewReady();
|
51
|
218 |
|
|
219 |
/**
|
|
220 |
* Handle a custom effect animation complete signal
|
|
221 |
* e.g. editor's send effect complete
|
|
222 |
* @param status, status information of the effect that has finished
|
|
223 |
*/
|
|
224 |
void onAnimationComplete(const HbEffect::EffectStatus &status);
|
|
225 |
|
37
|
226 |
private:
|
|
227 |
/**
|
|
228 |
* Main window pointer.
|
|
229 |
* Not owned.
|
|
230 |
*/
|
|
231 |
HbMainWindow* mMainWindow;
|
|
232 |
|
|
233 |
/**
|
|
234 |
* Unified editor.
|
|
235 |
* Owned.
|
|
236 |
*/
|
|
237 |
MsgUnifiedEditorView* mUniEditor;
|
|
238 |
|
|
239 |
/**
|
|
240 |
* Unified viewer.
|
|
241 |
* Owned.
|
|
242 |
*/
|
|
243 |
UnifiedViewer* mUniViewer;
|
|
244 |
|
|
245 |
/**
|
|
246 |
* Settings view.
|
|
247 |
* Owned.
|
|
248 |
*/
|
|
249 |
MsgSettingsView* mSettingsView;
|
|
250 |
|
|
251 |
/**
|
|
252 |
* Back action
|
|
253 |
* Owned.
|
|
254 |
*/
|
|
255 |
HbAction* mBackAction;
|
|
256 |
|
|
257 |
/**
|
|
258 |
* Store handler.
|
|
259 |
* Not Owned.
|
|
260 |
*/
|
|
261 |
MsgStoreHandler* mStoreHandler;
|
|
262 |
|
|
263 |
/**
|
|
264 |
* Current view value.
|
|
265 |
*/
|
67
|
266 |
int mCurrentView;
|
37
|
267 |
};
|
|
268 |
|
|
269 |
#endif /* MSGSERVICEVIEWMANAGER_H_ */
|