|
1 /* |
|
2 * Copyright (c) 2010 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "btconversationviewlauncher.h" |
|
19 #include <xqaiwrequest.h> |
|
20 #include <xqappmgr.h> |
|
21 |
|
22 const qint64 KBluetoothMsgsConversationId = 0x01; |
|
23 |
|
24 |
|
25 EXPORT_C CBtConversationViewLauncher* CBtConversationViewLauncher::NewL() |
|
26 { |
|
27 return (new(ELeave)CBtConversationViewLauncher); |
|
28 } |
|
29 |
|
30 EXPORT_C CBtConversationViewLauncher::~CBtConversationViewLauncher() |
|
31 { |
|
32 |
|
33 } |
|
34 |
|
35 /** |
|
36 This API makes use of the QtHighway service provided by the Messaging Application |
|
37 to open the Bluetooth conversation view. |
|
38 */ |
|
39 |
|
40 EXPORT_C void CBtConversationViewLauncher::LaunchConversationViewL() |
|
41 { |
|
42 QString service("com.nokia.services.hbserviceprovider"); |
|
43 QString interface("conversationview"); |
|
44 QString operation("open(qint64)"); |
|
45 QList<QVariant> args; |
|
46 XQAiwRequest* request; |
|
47 XQApplicationManager appManager; |
|
48 request = appManager.create(service, interface, operation, false); // not embedded |
|
49 if ( request == NULL ) |
|
50 { |
|
51 //Could not create request because of the arguments passed to the create() API. |
|
52 User::Leave(KErrArgument); |
|
53 } |
|
54 args << QVariant(KBluetoothMsgsConversationId); |
|
55 request->setArguments(args); |
|
56 TInt error = KErrNone; |
|
57 if(!request->send()) |
|
58 { |
|
59 // The only likely Symbian error code that can be associated is KErrNotSupported |
|
60 error = KErrNotSupported; |
|
61 } |
|
62 delete request; |
|
63 User::LeaveIfError(error); |
|
64 } |
|
65 |
|
66 CBtConversationViewLauncher::CBtConversationViewLauncher() |
|
67 { |
|
68 |
|
69 } |