13 * |
13 * |
14 * Description: SecUi notification plugin. |
14 * Description: SecUi notification plugin. |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
|
18 #include "secuinotificationdebug.h" |
18 #include "secuinotificationdialogplugin.h" |
19 #include "secuinotificationdialogplugin.h" |
19 #include "secuinotificationdialog.h" |
20 #include "secuinotificationdialog.h" |
20 #include "secuinotificationdialogpluginkeys.h" |
21 #include "secuinotificationdialogpluginkeys.h" |
|
22 |
|
23 #include <etelmm.h> |
21 |
24 |
22 // This plugin implements one device dialog type |
25 // This plugin implements one device dialog type |
23 static const struct { |
26 static const struct { |
24 const char *mTypeString; |
27 const char *mTypeString; |
25 } dialogInfos[] = { |
28 } dialogInfos[] = { |
48 // ---------------------------------------------------------------------------- |
51 // ---------------------------------------------------------------------------- |
49 // |
52 // |
50 bool SecUiNotificationDialogPlugin::accessAllowed(const QString &deviceDialogType, |
53 bool SecUiNotificationDialogPlugin::accessAllowed(const QString &deviceDialogType, |
51 const QVariantMap ¶meters, const QVariantMap &securityInfo) const |
54 const QVariantMap ¶meters, const QVariantMap &securityInfo) const |
52 { |
55 { |
|
56 RDEBUG("0", 0); |
53 Q_UNUSED(deviceDialogType) |
57 Q_UNUSED(deviceDialogType) |
54 Q_UNUSED(parameters) |
58 Q_UNUSED(parameters) |
55 Q_UNUSED(securityInfo) |
59 Q_UNUSED(securityInfo) |
56 |
60 |
57 // All clients are allowed to use. |
61 // All clients are allowed to use. |
58 // TODO: should access be limited to certain clients? |
62 // should access be limited to certain clients or capabilities ? Not for now. |
59 return true; |
63 return true; |
60 } |
64 } |
61 |
65 |
62 // ---------------------------------------------------------------------------- |
66 // ---------------------------------------------------------------------------- |
63 // SecUiNotificationDialogPlugin::createDeviceDialog() |
67 // SecUiNotificationDialogPlugin::createDeviceDialog() |
65 // |
69 // |
66 HbDeviceDialogInterface *SecUiNotificationDialogPlugin::createDeviceDialog( |
70 HbDeviceDialogInterface *SecUiNotificationDialogPlugin::createDeviceDialog( |
67 const QString &deviceDialogType, const QVariantMap ¶meters) |
71 const QString &deviceDialogType, const QVariantMap ¶meters) |
68 { |
72 { |
69 // Create device dialog widget |
73 // Create device dialog widget |
|
74 RDEBUG("0", 0); |
70 Q_UNUSED(deviceDialogType) |
75 Q_UNUSED(deviceDialogType) |
71 |
76 |
72 SecUiNotificationDialog *deviceDialog = new SecUiNotificationDialog(parameters); |
77 SecUiNotificationDialog *deviceDialog = new SecUiNotificationDialog(parameters); |
73 mError = deviceDialog->deviceDialogError(); |
78 mError = deviceDialog->deviceDialogError(); |
74 if (mError != KNoError) { |
79 if (mError != KNoError) { |
84 // ---------------------------------------------------------------------------- |
89 // ---------------------------------------------------------------------------- |
85 // |
90 // |
86 bool SecUiNotificationDialogPlugin::deviceDialogInfo( const QString &deviceDialogType, |
91 bool SecUiNotificationDialogPlugin::deviceDialogInfo( const QString &deviceDialogType, |
87 const QVariantMap ¶meters, DeviceDialogInfo *info) const |
92 const QVariantMap ¶meters, DeviceDialogInfo *info) const |
88 { |
93 { |
89 // Return device dialog flags |
94 // For some unknown reason, this function doesn't print the signature |
|
95 RDEBUG("0", 0); |
|
96 #ifdef _DEBUG |
|
97 RDebug::Printf( "SecUiNotificationDialogPlugin::deviceDialogInfo=%x", 0 ); |
|
98 #endif |
|
99 |
90 Q_UNUSED(deviceDialogType); |
100 Q_UNUSED(deviceDialogType); |
91 Q_UNUSED(parameters); |
|
92 |
101 |
93 //info->group = DeviceNotificationDialogGroup; // TODO this should be SecurityGroup , but it's still not available, Commented out by 10.1 Integration |
102 info->group = SecurityGroup; |
94 info->group = SecurityGroup; // Added by 10.1 Integration... It's working better with this layer. |
|
95 info->flags = NoDeviceDialogFlags; |
103 info->flags = NoDeviceDialogFlags; |
96 info->priority = DefaultPriority; |
104 info->priority = DefaultPriority; |
|
105 |
|
106 // The unlock-query must have higher priority, to get over Telephony. |
|
107 if (parameters.contains(KQueryType)) { |
|
108 #ifdef _DEBUG |
|
109 RDebug::Printf( "SecUiNotificationDialogPlugin::deviceDialogInfo KQueryType=%x", 1 ); |
|
110 #endif |
|
111 int iqueryType = parameters.value(KQueryType).toUInt(); |
|
112 RDEBUG("iqueryType", iqueryType); |
|
113 #ifdef _DEBUG |
|
114 RDebug::Printf( "SecUiNotificationDialogPlugin::deviceDialogInfo iqueryType=%x", iqueryType ); |
|
115 #endif |
|
116 if( (iqueryType & 0xFFFF) == RMobilePhone::ESecurityCodePhonePassword ) |
|
117 { |
|
118 RDEBUG("CriticalGroup", CriticalGroup); |
|
119 #ifdef _DEBUG |
|
120 RDebug::Printf( "SecUiNotificationDialogPlugin::deviceDialogInfo CriticalGroup=%x", CriticalGroup ); |
|
121 #endif |
|
122 info->group = CriticalGroup; |
|
123 } |
|
124 } |
|
125 // Return device dialog flags |
97 |
126 |
98 return true; |
127 return true; |
99 } |
128 } |
100 |
129 |
101 // ---------------------------------------------------------------------------- |
130 // ---------------------------------------------------------------------------- |
102 // SecUiNotificationDialogPlugin::deviceDialogTypes() |
131 // SecUiNotificationDialogPlugin::deviceDialogTypes() |
103 // ---------------------------------------------------------------------------- |
132 // ---------------------------------------------------------------------------- |
104 // |
133 // |
105 QStringList SecUiNotificationDialogPlugin::deviceDialogTypes() const |
134 QStringList SecUiNotificationDialogPlugin::deviceDialogTypes() const |
106 { |
135 { |
|
136 RDEBUG("0", 0); |
107 // Return device dialog types this plugin implements |
137 // Return device dialog types this plugin implements |
108 |
138 |
109 QStringList types; |
139 QStringList types; |
110 const int numTypes = sizeof(dialogInfos) / sizeof(dialogInfos[0]); |
140 const int numTypes = sizeof(dialogInfos) / sizeof(dialogInfos[0]); |
111 for(int i = 0; i < numTypes; ++i) { |
141 for(int i = 0; i < numTypes; ++i) { |
119 // SecUiNotificationDialogPlugin::pluginFlags() |
149 // SecUiNotificationDialogPlugin::pluginFlags() |
120 // ---------------------------------------------------------------------------- |
150 // ---------------------------------------------------------------------------- |
121 // |
151 // |
122 HbDeviceDialogPlugin::PluginFlags SecUiNotificationDialogPlugin::pluginFlags() const |
152 HbDeviceDialogPlugin::PluginFlags SecUiNotificationDialogPlugin::pluginFlags() const |
123 { |
153 { |
|
154 RDEBUG("0", 0); |
124 // Return plugin flags |
155 // Return plugin flags |
125 return NoPluginFlags; |
156 return NoPluginFlags; |
126 } |
157 } |
127 |
158 |
128 // ---------------------------------------------------------------------------- |
159 // ---------------------------------------------------------------------------- |
129 // SecUiNotificationDialogPlugin::error() |
160 // SecUiNotificationDialogPlugin::error() |
130 // ---------------------------------------------------------------------------- |
161 // ---------------------------------------------------------------------------- |
131 // |
162 // |
132 int SecUiNotificationDialogPlugin::error() const |
163 int SecUiNotificationDialogPlugin::error() const |
133 { |
164 { |
|
165 RDEBUG("mError", mError); |
134 // Return last error |
166 // Return last error |
135 return mError; |
167 return mError; |
136 } |
168 } |
137 |
169 |
138 Q_EXPORT_PLUGIN2(secuinotificationdialogplugin,SecUiNotificationDialogPlugin) |
170 Q_EXPORT_PLUGIN2(secuinotificationdialogplugin,SecUiNotificationDialogPlugin) |