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: DrmUIDialogPlugin class implementation. |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "DrmUIDialogPlugin.h" |
|
19 #include <QtPlugin> |
|
20 #include <hbdevicedialog.h> |
|
21 #include "drmuidialogsbuilder.h" |
|
22 #include "drmuidialogpluginkeys.h" |
|
23 |
|
24 Q_EXPORT_PLUGIN2(DrmUIDialogPlugin, DrmUIDialogPlugin) |
|
25 |
|
26 const int NmMaxDialogCount = 10; |
|
27 static const QString drmUiDialog = "com.nokia.hb.drmuidialog/1.0"; |
|
28 |
|
29 /*! |
|
30 DrmUIDialogPlugin Constructor |
|
31 */ |
|
32 DrmUIDialogPlugin::DrmUIDialogPlugin() |
|
33 { |
|
34 |
|
35 } |
|
36 |
|
37 /*! |
|
38 Destructor |
|
39 */ |
|
40 DrmUIDialogPlugin::~DrmUIDialogPlugin() |
|
41 { |
|
42 |
|
43 } |
|
44 |
|
45 /*! |
|
46 Check if client is allowed to use device dialog widget |
|
47 */ |
|
48 bool DrmUIDialogPlugin::accessAllowed(const QString &deviceDialogType, |
|
49 const QVariantMap ¶meters, const QVariantMap &securityInfo) const |
|
50 { |
|
51 Q_UNUSED (deviceDialogType) |
|
52 Q_UNUSED(parameters) |
|
53 Q_UNUSED(securityInfo) |
|
54 |
|
55 // This plugin doesn't perform operations that may compromise security. |
|
56 // All clients are allowed to use. |
|
57 return true; |
|
58 } |
|
59 |
|
60 /*! |
|
61 From interface class. |
|
62 Use the dialog type in the parameter to create widget. |
|
63 */ |
|
64 HbDeviceDialogInterface *DrmUIDialogPlugin::createDeviceDialog( |
|
65 const QString &deviceDialogType, const QVariantMap ¶meters) |
|
66 { |
|
67 Q_UNUSED(deviceDialogType) |
|
68 return new DrmUiDialogsBuilder(parameters); |
|
69 } |
|
70 |
|
71 /*! |
|
72 Return information of device dialog the plugin creates |
|
73 Currently only supporting 1 device dialog type, so no need to check the type. |
|
74 */ |
|
75 bool DrmUIDialogPlugin::deviceDialogInfo(const QString &deviceDialogType, |
|
76 const QVariantMap ¶meters, DeviceDialogInfo *info) const |
|
77 { |
|
78 Q_UNUSED(parameters) |
|
79 Q_UNUSED(deviceDialogType) |
|
80 // set return values |
|
81 info->group = GenericDeviceDialogGroup; |
|
82 info->flags = NoDeviceDialogFlags; |
|
83 info->priority = DefaultPriority; |
|
84 return true; |
|
85 } |
|
86 |
|
87 /*! |
|
88 Return device dialog types this plugin implements |
|
89 Function will work fine (unchanged) when new dialogs are added. |
|
90 */ |
|
91 QStringList DrmUIDialogPlugin::deviceDialogTypes() const |
|
92 { |
|
93 QStringList types; |
|
94 types.append(drmUiDialog); |
|
95 return types; |
|
96 |
|
97 } |
|
98 |
|
99 /*! |
|
100 Return plugin flags |
|
101 */ |
|
102 HbDeviceDialogPlugin::PluginFlags DrmUIDialogPlugin::pluginFlags() const |
|
103 { |
|
104 return NoPluginFlags; |
|
105 } |
|
106 |
|
107 /*! |
|
108 Return last error |
|
109 */ |
|
110 int DrmUIDialogPlugin::error() const |
|
111 { |
|
112 return 0; |
|
113 } |
|
114 |
|