65
|
1 |
/*!
|
76
|
2 |
* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
|
65
|
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: Handles phone notes.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef PHONEGLOBALNOTES_H
|
|
19 |
#define PHONEGLOBALNOTES_H
|
|
20 |
|
|
21 |
#include <QObject>
|
|
22 |
#include <QString>
|
|
23 |
#include "tphonecmdparamnote.h"
|
76
|
24 |
#include "tphonecmdparamglobalnote.h"
|
65
|
25 |
#include <hbdevicenotificationdialogsymbian.h>
|
|
26 |
#include <hbdevicemessageboxsymbian.h>
|
|
27 |
#include <hbdeviceprogressdialogsymbian.h>
|
|
28 |
|
|
29 |
// FORWARD DECLARATION
|
|
30 |
class TPhoneCommandParam;
|
|
31 |
class TPhoneCmdParamQuery;
|
|
32 |
class TPhoneCmdParamGlobalNote;
|
|
33 |
class HbDeviceMessageBox;
|
|
34 |
class HbDeviceNotificationDialog;
|
|
35 |
class HbDeviceProgressDialog;
|
|
36 |
class QTimer;
|
76
|
37 |
class XQSystemToneService;
|
65
|
38 |
|
|
39 |
class PhoneGlobalNotes : public QObject,
|
|
40 |
public MHbDeviceNotificationDialogObserver,
|
|
41 |
public MHbDeviceMessageBoxObserver,
|
|
42 |
public MHbDeviceProgressDialogObserver
|
|
43 |
{
|
|
44 |
Q_OBJECT
|
|
45 |
|
|
46 |
public:
|
|
47 |
|
|
48 |
/*!
|
78
|
49 |
\fn PhoneGlobalNotes (XQSystemToneService &toneservice,
|
|
50 |
QObject *parent)
|
65
|
51 |
*/
|
78
|
52 |
PhoneGlobalNotes(XQSystemToneService &toneservice,
|
|
53 |
QObject *parent = 0);
|
65
|
54 |
|
|
55 |
/*!
|
|
56 |
Destructor
|
|
57 |
*/
|
|
58 |
virtual ~PhoneGlobalNotes ();
|
|
59 |
|
|
60 |
/*!
|
|
61 |
\fn void showDefaultQuery()
|
|
62 |
|
|
63 |
This method shows global wait note.
|
|
64 |
*/
|
|
65 |
void showGlobalWaitNote(TPhoneCmdParamQuery* params);
|
|
66 |
|
|
67 |
/*!
|
|
68 |
\fn void showDeviceMessageBox()
|
|
69 |
|
|
70 |
This method shows device message box.
|
|
71 |
*/
|
|
72 |
void showDeviceMessageBox(TPhoneCmdParamGlobalNote* params);
|
|
73 |
|
|
74 |
/*!
|
|
75 |
\fn void showDeviceNotificationDialog()
|
|
76 |
|
|
77 |
This method shows device notification dialog.
|
|
78 |
*/
|
|
79 |
void showDeviceNotificationDialog(TPhoneCmdParamGlobalNote* params);
|
|
80 |
|
|
81 |
|
|
82 |
/*!
|
|
83 |
\fn void removeGlobalWaitNote()
|
|
84 |
|
|
85 |
This method removes global wait note.
|
|
86 |
|
|
87 |
*/
|
|
88 |
void removeGlobalWaitNote();
|
|
89 |
signals:
|
|
90 |
|
|
91 |
/*!
|
|
92 |
\fn void command(int command)
|
|
93 |
|
|
94 |
This signal is emitted when note action is handled.
|
|
95 |
*/
|
|
96 |
void command (int command);
|
|
97 |
|
|
98 |
private:
|
|
99 |
|
|
100 |
/*!
|
|
101 |
\fn QString globalNoteText()
|
|
102 |
|
|
103 |
This method returns text for global note.
|
|
104 |
*/
|
|
105 |
QString globalNoteText(TPhoneCommandParam *commandParam);
|
|
106 |
|
76
|
107 |
/*!
|
|
108 |
\fn QString playToneIfNeeded()
|
|
109 |
|
|
110 |
This method plays note tone if needed.
|
|
111 |
*/
|
|
112 |
void playToneIfNeeded(TPhoneNotificationToneType aTone);
|
65
|
113 |
|
|
114 |
private: // Leaving symbian stuff
|
|
115 |
void ShowGlobalWaitNoteL(
|
|
116 |
const TDesC16& aText);
|
|
117 |
|
|
118 |
void ShowDeviceMessageBoxL(
|
|
119 |
CHbDeviceMessageBoxSymbian::TType aType,
|
|
120 |
const TDesC16& aText,
|
76
|
121 |
TInt aTimeout,
|
|
122 |
TPhoneNotificationToneType aTone);
|
65
|
123 |
|
|
124 |
void ShowDeviceNotificationDialogL(
|
76
|
125 |
const TDesC16& aTitle,
|
|
126 |
TInt aTimeout,
|
|
127 |
TPhoneNotificationToneType aTone);
|
65
|
128 |
|
|
129 |
|
|
130 |
private slots:
|
|
131 |
|
|
132 |
/*!
|
|
133 |
\fn void queryTimeout ()
|
|
134 |
|
|
135 |
Slot is called when query timeout expires.
|
|
136 |
|
|
137 |
*/
|
|
138 |
void queryTimeout();
|
|
139 |
|
|
140 |
private: // Symbian observers
|
|
141 |
void NotificationDialogActivated(
|
|
142 |
const CHbDeviceNotificationDialogSymbian* aDialog);
|
|
143 |
void NotificationDialogClosed(
|
|
144 |
const CHbDeviceNotificationDialogSymbian* aDialog, TInt aCompletionCode);
|
|
145 |
void MessageBoxClosed(const CHbDeviceMessageBoxSymbian* aMessageBox,
|
|
146 |
CHbDeviceMessageBoxSymbian::TButtonId aButton);
|
|
147 |
void ProgressDialogCancelled(
|
|
148 |
const CHbDeviceProgressDialogSymbian* aProgressDialog);
|
|
149 |
void ProgressDialogClosed(
|
|
150 |
const CHbDeviceProgressDialogSymbian* aProgressDialog);
|
|
151 |
|
76
|
152 |
struct MessageBoxData{
|
|
153 |
CHbDeviceMessageBoxSymbian *m_messageBox;
|
|
154 |
int m_tone;
|
|
155 |
};
|
|
156 |
|
|
157 |
struct NotificationDialogData{
|
|
158 |
CHbDeviceNotificationDialogSymbian *m_notificationDialog;
|
|
159 |
int m_tone;
|
|
160 |
};
|
65
|
161 |
private:
|
|
162 |
|
|
163 |
QTimer *m_timer;
|
76
|
164 |
XQSystemToneService *m_toneService;
|
65
|
165 |
int m_queryCanceledCommand;
|
|
166 |
int m_timeoutCommand;
|
|
167 |
|
76
|
168 |
QList<NotificationDialogData*> iNotificationList;
|
|
169 |
QList<MessageBoxData*> iMessageBoxList;
|
65
|
170 |
CHbDeviceProgressDialogSymbian *iProgressDialog;
|
|
171 |
};
|
|
172 |
|
|
173 |
#endif // PHONEGLOBALNOTES_H
|