|
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: Recognizes the parser messages that needs to be notified to the world |
|
15 * using QtHighway. |
|
16 * |
|
17 */ |
|
18 |
|
19 #include <QDebug> |
|
20 #include <xqservicerequest.h> |
|
21 #include <pevirtualengine.h> |
|
22 #include "parserrecognizer.h" |
|
23 |
|
24 ParserRecognizer::ParserRecognizer(QObject* parent) : QObject (parent) |
|
25 { |
|
26 } |
|
27 |
|
28 ParserRecognizer::~ParserRecognizer() |
|
29 { |
|
30 } |
|
31 |
|
32 void ParserRecognizer::sendMessage(const int message, const int callId) |
|
33 { |
|
34 Q_UNUSED(callId); // for now |
|
35 qDebug () << "ParserRecognizer::sendMessage message:" << message; |
|
36 QString api; |
|
37 QString method; |
|
38 bool recognized = true; |
|
39 |
|
40 switch(message) { |
|
41 case MEngineMonitor::EPEMessageActivateRfsDeep: |
|
42 api = "com.nokia.services.telephony"; |
|
43 method = "activateDeepRestoreFactorySettings()"; |
|
44 break; |
|
45 |
|
46 case MEngineMonitor::EPEMessageActivateRfsNormal: |
|
47 api = "com.nokia.services.telephony"; |
|
48 method = "activateNormalRestoreFactorySettings()"; |
|
49 break; |
|
50 |
|
51 case MEngineMonitor::EPEMessageActivateWarrantyMode: |
|
52 api = "com.nokia.services.telephony"; |
|
53 method = "activateWarrantyMode()"; |
|
54 break; |
|
55 |
|
56 case MEngineMonitor::EPEMessageShowBTDeviceAddress: |
|
57 api = "com.nokia.services.bluetooth"; |
|
58 method = "showBluetoothDeviceAddress()"; |
|
59 break; |
|
60 |
|
61 case MEngineMonitor::EPEMessageShowBTLoopback: |
|
62 api = "com.nokia.services.bluetooth"; |
|
63 method = "showBluetoothLoopback()"; |
|
64 break; |
|
65 |
|
66 case MEngineMonitor::EPEMessageBTDebugMode: |
|
67 api = "com.nokia.services.bluetooth"; |
|
68 method = "activateBluetoothDebugMode()"; |
|
69 break; |
|
70 |
|
71 case MEngineMonitor::EPEMessageShowIMEI: |
|
72 api = "com.nokia.services.telephony"; |
|
73 method = "showIMEICode()"; |
|
74 break; |
|
75 |
|
76 case MEngineMonitor::EPEMessageShowVersion: |
|
77 api = "com.nokia.services.telephony"; |
|
78 method = "showVersionNumber()"; |
|
79 break; |
|
80 |
|
81 case MEngineMonitor::EPEMessageShowWlanMacAddress: |
|
82 api = "com.nokia.services.wlan"; |
|
83 method = "showWLANMacAddress()"; |
|
84 break; |
|
85 |
|
86 case MEngineMonitor::EPEMessageSSRequestFailed: |
|
87 api = "com.nokia.services.telephony"; |
|
88 method = "supplementaryServiceRequestFailed()"; |
|
89 break; |
|
90 |
|
91 default: |
|
92 recognized = false; |
|
93 break; |
|
94 } |
|
95 |
|
96 if(recognized) { |
|
97 qDebug () << "ParserRecognizer::sendMessage api:" << api; |
|
98 qDebug () << "ParserRecognizer::sendMessage method:" << method; |
|
99 XQServiceRequest snd(api, method); |
|
100 QVariant err; |
|
101 snd.send(err); |
|
102 } |
|
103 } |