author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 18 Aug 2010 09:48:26 +0300 | |
changeset 56 | 5bcb308bd24d |
parent 46 | bc5a64e5bc3c |
child 74 | d1c62c765e48 |
permissions | -rw-r--r-- |
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: Dial API to be used through Qt Highway. |
|
15 |
* |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
16 |
* |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
17 |
* Example usage: |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
18 |
* QString service("phoneui"); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
19 |
* QString interface(""com.nokia.symbian.ICallDial"); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
20 |
* QString operation("dial(QString)"); // choose appropriate operation |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
21 |
* XQApplicationManager appManager; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
22 |
* QScopedPointer<XQAiwRequest> request(appManager.create(service, interface, operation, false)); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
23 |
* if (request == NULL) { |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
24 |
* //Service not found |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
25 |
* } |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
26 |
* QList<QVariant> args; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
27 |
* args << QString("0501234567"); // number or address |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
28 |
* // add contactId and serviceId when needed by operation |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
29 |
* request->setArguments(args); |
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
30 |
* QVariant retValue; |
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
31 |
* if (request->send(retValue)) { |
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
32 |
* //error |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
33 |
* } |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
34 |
* |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
35 |
* Note: |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
36 |
* |
37 | 37 |
*/ |
38 |
||
39 |
#ifndef DIALSERVICE_H |
|
40 |
#define DIALSERVICE_H |
|
41 |
||
42 |
#include <QObject> |
|
43 |
#include <QString> |
|
44 |
#include <xqserviceprovider.h> |
|
45 |
#include "mpecallcontrolif.h" |
|
46 |
#include "mpecallsettersif.h" |
|
47 |
||
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
48 |
// FORWARD DECLARATIONS |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
49 |
class XQSettingsManager; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
50 |
|
37 | 51 |
class DialService : public XQServiceProvider |
52 |
{ |
|
53 |
Q_OBJECT |
|
54 |
public: |
|
55 |
DialService(MPECallControlIF &call, MPECallSettersIF ¶meters, QObject *parent = 0); |
|
56 |
~DialService(); |
|
57 |
||
58 |
public slots: |
|
59 |
/*! |
|
60 |
\fn dial(const QString& number) |
|
61 |
||
62 |
This method makes a cellular switched dial command to |
|
63 |
Phone Application. It is intended to be used via Qt Highway. |
|
64 |
*/ |
|
65 |
int dial(const QString& number); |
|
66 |
||
67 |
/*! |
|
68 |
\fn dial(const QString& number) |
|
69 |
||
70 |
This method makes a cellular switched dial command to |
|
71 |
Phone Application. It is intended to be used via Qt Highway. |
|
72 |
Caller's name is shown according to the given Phonebook contact |
|
73 |
identifier. |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
74 |
|
37 | 75 |
*/ |
76 |
int dial(const QString& number, int contactId); |
|
77 |
||
78 |
/*! |
|
79 |
\fn dialVideo(const QString& number) |
|
80 |
||
81 |
This method makes a video call dial command to |
|
82 |
Phone Application. It is intended to be used via Qt Highway. |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
83 |
|
37 | 84 |
*/ |
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
85 |
int dialVideo(const QString& number); |
37 | 86 |
|
87 |
/*! |
|
88 |
\fn dial(const QString& number) |
|
89 |
||
90 |
This method makes a video call dial command to |
|
91 |
Phone Application. It is intended to be used via Qt Highway. |
|
92 |
Caller's name is shown according to the given Phonebook contact |
|
93 |
identifier. |
|
94 |
*/ |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
95 |
int dialVideo(const QString& number, int contactId); |
37 | 96 |
|
97 |
/*! |
|
98 |
\fn dialVoip(const QString& address) |
|
99 |
||
100 |
This method makes a voip call dial command to |
|
101 |
Phone Application. It is intended to be used via Qt Highway. |
|
102 |
*/ |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
103 |
int dialVoip(const QString& address); |
37 | 104 |
|
105 |
/*! |
|
106 |
\fn dialVoip(const QString& address, int contactId) |
|
107 |
||
108 |
This method makes a voip call dial command to |
|
109 |
Phone Application. It is intended to be used via Qt Highway. |
|
110 |
Caller's name is shown according to the given Phonebook contact |
|
111 |
identifier. |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
112 |
|
37 | 113 |
*/ |
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
114 |
int dialVoip(const QString& address, int contactId); |
37 | 115 |
|
116 |
/*! |
|
117 |
\fn dialVoipService(const QString& address, int contactId) |
|
118 |
||
119 |
This method makes a voip call dial command to |
|
120 |
Phone Application. It is intended to be used via Qt Highway. |
|
121 |
Call is made by given service (id). |
|
122 |
*/ |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
123 |
int dialVoipService(const QString& address, int serviceId); |
37 | 124 |
|
125 |
/*! |
|
126 |
\fn dialVoipService(const QString& address, int serviceId, int contactId) |
|
127 |
||
128 |
This method makes a voip call dial command to |
|
129 |
Phone Application. It is intended to be used via Qt Highway. |
|
130 |
Call is made by given service (id). |
|
131 |
Caller's name is shown according to the given Phonebook contact |
|
132 |
identifier. |
|
133 |
*/ |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
134 |
int dialVoipService(const QString& address, int serviceId, int contactId); |
37 | 135 |
|
136 |
private: |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
137 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
138 |
/*! |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
139 |
\fn QString modifyPhoneNumber(QString& number) |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
140 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
141 |
Returns a modified phone number string. Strips white spaces, makes prefix changes etc. |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
142 |
*/ |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
143 |
QString modifyPhoneNumber(const QString &number) Q_REQUIRED_RESULT; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
144 |
|
37 | 145 |
/*! |
146 |
\fn QString simplified(QString& number) |
|
147 |
||
148 |
Returns a string that has whitespaces, '(', ')', '-', '[', and ']' chars removed |
|
149 |
*/ |
|
150 |
static QString simplified(const QString &number) Q_REQUIRED_RESULT; |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
151 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
152 |
/*! |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
153 |
\fn QString japanPrefixModifications(QString& number) |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
154 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
155 |
Returns a string that has japan specific configuration modifications made |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
156 |
*/ |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
157 |
QString japanPrefixModifications(const QString &number) Q_REQUIRED_RESULT; |
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
158 |
|
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
159 |
|
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
160 |
/*! |
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
161 |
\fn bool hasCapability() |
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
162 |
|
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
163 |
Checks if the client has the required capabilities |
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
164 |
*/ |
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
165 |
bool hasCapability(); |
37 | 166 |
|
167 |
||
168 |
private: |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
169 |
MPECallControlIF &m_call; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
170 |
MPECallSettersIF &m_parameters; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
171 |
XQSettingsManager *m_settingsManager; |
37 | 172 |
}; |
173 |
||
174 |
#endif // DIALERSERVICE_H |