author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Mon, 04 Oct 2010 00:16:48 +0300 | |
changeset 77 | 2be0b271d017 |
parent 56 | 5bcb308bd24d |
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"); |
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
19 |
* QString interface("com.nokia.symbian.ICallDial"); |
46
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 |
* |
37 | 35 |
*/ |
36 |
||
37 |
#ifndef DIALSERVICE_H |
|
38 |
#define DIALSERVICE_H |
|
39 |
||
40 |
#include <QObject> |
|
41 |
#include <QString> |
|
42 |
#include <xqserviceprovider.h> |
|
43 |
#include "mpecallcontrolif.h" |
|
44 |
#include "mpecallsettersif.h" |
|
45 |
||
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
46 |
// FORWARD DECLARATIONS |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
47 |
class XQSettingsManager; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
48 |
|
37 | 49 |
class DialService : public XQServiceProvider |
50 |
{ |
|
51 |
Q_OBJECT |
|
52 |
public: |
|
53 |
DialService(MPECallControlIF &call, MPECallSettersIF ¶meters, QObject *parent = 0); |
|
54 |
~DialService(); |
|
55 |
||
56 |
public slots: |
|
57 |
/*! |
|
58 |
\fn dial(const QString& number) |
|
59 |
||
60 |
This method makes a cellular switched dial command to |
|
61 |
Phone Application. It is intended to be used via Qt Highway. |
|
62 |
*/ |
|
63 |
int dial(const QString& number); |
|
64 |
||
65 |
/*! |
|
66 |
\fn dial(const QString& number) |
|
67 |
||
68 |
This method makes a cellular switched dial command to |
|
69 |
Phone Application. It is intended to be used via Qt Highway. |
|
70 |
Caller's name is shown according to the given Phonebook contact |
|
71 |
identifier. |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
72 |
|
37 | 73 |
*/ |
74 |
int dial(const QString& number, int contactId); |
|
75 |
||
76 |
/*! |
|
77 |
\fn dialVideo(const QString& number) |
|
78 |
||
79 |
This method makes a video call dial command to |
|
80 |
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
|
81 |
|
37 | 82 |
*/ |
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
83 |
int dialVideo(const QString& number); |
37 | 84 |
|
85 |
/*! |
|
86 |
\fn dial(const QString& number) |
|
87 |
||
88 |
This method makes a video call dial command to |
|
89 |
Phone Application. It is intended to be used via Qt Highway. |
|
90 |
Caller's name is shown according to the given Phonebook contact |
|
91 |
identifier. |
|
92 |
*/ |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
93 |
int dialVideo(const QString& number, int contactId); |
37 | 94 |
|
95 |
/*! |
|
96 |
\fn dialVoip(const QString& address) |
|
97 |
||
98 |
This method makes a voip call dial command to |
|
99 |
Phone Application. It is intended to be used via Qt Highway. |
|
100 |
*/ |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
101 |
int dialVoip(const QString& address); |
37 | 102 |
|
103 |
/*! |
|
104 |
\fn dialVoip(const QString& address, int contactId) |
|
105 |
||
106 |
This method makes a voip call dial command to |
|
107 |
Phone Application. It is intended to be used via Qt Highway. |
|
108 |
Caller's name is shown according to the given Phonebook contact |
|
109 |
identifier. |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
110 |
|
37 | 111 |
*/ |
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
112 |
int dialVoip(const QString& address, int contactId); |
37 | 113 |
|
114 |
/*! |
|
115 |
\fn dialVoipService(const QString& address, int contactId) |
|
116 |
||
117 |
This method makes a voip call dial command to |
|
118 |
Phone Application. It is intended to be used via Qt Highway. |
|
119 |
Call is made by given service (id). |
|
120 |
*/ |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
121 |
int dialVoipService(const QString& address, int serviceId); |
37 | 122 |
|
123 |
/*! |
|
124 |
\fn dialVoipService(const QString& address, int serviceId, int contactId) |
|
125 |
||
126 |
This method makes a voip call dial command to |
|
127 |
Phone Application. It is intended to be used via Qt Highway. |
|
128 |
Call is made by given service (id). |
|
129 |
Caller's name is shown according to the given Phonebook contact |
|
130 |
identifier. |
|
131 |
*/ |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
132 |
int dialVoipService(const QString& address, int serviceId, int contactId); |
37 | 133 |
|
134 |
private: |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
135 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
136 |
/*! |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
137 |
\fn QString modifyPhoneNumber(QString& number) |
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 |
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
|
140 |
*/ |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
141 |
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
|
142 |
|
37 | 143 |
/*! |
144 |
\fn QString simplified(QString& number) |
|
145 |
||
146 |
Returns a string that has whitespaces, '(', ')', '-', '[', and ']' chars removed |
|
147 |
*/ |
|
148 |
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
|
149 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
150 |
/*! |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
151 |
\fn QString japanPrefixModifications(QString& number) |
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 |
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
|
154 |
*/ |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
155 |
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
|
156 |
|
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
157 |
|
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 |
\fn bool hasCapability() |
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 |
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
|
162 |
*/ |
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
163 |
bool hasCapability(); |
37 | 164 |
|
165 |
||
166 |
private: |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
167 |
MPECallControlIF &m_call; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
168 |
MPECallSettersIF &m_parameters; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
169 |
XQSettingsManager *m_settingsManager; |
37 | 170 |
}; |
171 |
||
172 |
#endif // DIALERSERVICE_H |