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