|
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 "hswidgetinstallersender.h" |
|
19 #include "hswidgetcomponentdescriptor.h" |
|
20 |
|
21 #include <QDebug> |
|
22 #include <QFile> |
|
23 #include <xqrequestinfo.h> |
|
24 #include <xqservicerequest.h> |
|
25 |
|
26 const char INTERFACE_NAME[] = "com.nokia.services.hsapplication.IHomeScreenClient"; |
|
27 |
|
28 /*! |
|
29 \class HsWidgetInstallerSender |
|
30 \ingroup group_hswidgetuninstaller |
|
31 \brief Sends qt highway function calls to com.nokia.services.hsapplication.IHomeScreenClient service. |
|
32 */ |
|
33 |
|
34 /*! |
|
35 Constructor, \a parent. |
|
36 */ |
|
37 HsWidgetInstallerSender::HsWidgetInstallerSender(QObject *parent):QObject(parent) |
|
38 { |
|
39 } |
|
40 |
|
41 /*! |
|
42 Destructor. |
|
43 */ |
|
44 HsWidgetInstallerSender::~HsWidgetInstallerSender() |
|
45 { |
|
46 |
|
47 } |
|
48 |
|
49 /*! |
|
50 Sends gt highway command to com.nokia.services.hsapplication.IHomeScreenClient service. \a functionSignature function |
|
51 name, \a widgetDescriptor parsed widget descriptor. |
|
52 */ |
|
53 void HsWidgetInstallerSender::widgetChanged(QString functionSignature, HsWidgetComponentDescriptor &widgetDescriptor) |
|
54 { |
|
55 QVariantHash widgetDescriptorHash; |
|
56 widgetDescriptorHash["uri"] = widgetDescriptor.uri; |
|
57 widgetDescriptorHash["title"] = widgetDescriptor.title; |
|
58 widgetDescriptorHash["description"] = widgetDescriptor.description; |
|
59 widgetDescriptorHash["iconUri"] = widgetDescriptor.iconUri; |
|
60 widgetDescriptorHash["hidden"] = widgetDescriptor.hidden; |
|
61 widgetDescriptorHash["serviceXml"] = widgetDescriptor.serviceXml; |
|
62 widgetDescriptorHash["version"] = widgetDescriptor.version; |
|
63 widgetDescriptorHash["installationPath"] = widgetDescriptor.installationPath; |
|
64 |
|
65 XQServiceRequest snd(INTERFACE_NAME, functionSignature, true); |
|
66 XQRequestInfo requestInfo = snd.info(); |
|
67 requestInfo.setBackground(true); |
|
68 snd.setInfo(requestInfo); |
|
69 snd << widgetDescriptorHash; |
|
70 bool res=snd.send(); |
|
71 if (!res) { |
|
72 qDebug() << "error send: " << snd.latestError(); |
|
73 } |
|
74 |
|
75 } |
|
76 |