38 const char *mTypeString; |
38 const char *mTypeString; |
39 } dialogInfos[] = { |
39 } dialogInfos[] = { |
40 {"com.nokia.hb.devicenotificationdialog/1.0"} |
40 {"com.nokia.hb.devicenotificationdialog/1.0"} |
41 }; |
41 }; |
42 |
42 |
|
43 /// \cond |
43 class HbDeviceNotificationDialogPluginPrivate |
44 class HbDeviceNotificationDialogPluginPrivate |
44 { |
45 { |
45 public: |
46 public: |
46 HbDeviceNotificationDialogPluginPrivate() {mError = NoError;} |
47 HbDeviceNotificationDialogPluginPrivate() {mError = NoError;} |
47 |
48 |
48 int mError; |
49 int mError; |
49 }; |
50 }; |
|
51 /// \endcond |
50 |
52 |
51 // Constructor |
53 // Constructor |
52 HbDeviceNotificationDialogPlugin::HbDeviceNotificationDialogPlugin() |
54 HbDeviceNotificationDialogPlugin::HbDeviceNotificationDialogPlugin() |
53 { |
55 { |
54 TRACE_ENTRY |
56 TRACE_ENTRY |
68 bool HbDeviceNotificationDialogPlugin::accessAllowed(const QString &deviceDialogType, |
70 bool HbDeviceNotificationDialogPlugin::accessAllowed(const QString &deviceDialogType, |
69 const QVariantMap ¶meters, const QVariantMap &securityInfo) const |
71 const QVariantMap ¶meters, const QVariantMap &securityInfo) const |
70 { |
72 { |
71 TRACE_ENTRY |
73 TRACE_ENTRY |
72 Q_UNUSED(deviceDialogType) |
74 Q_UNUSED(deviceDialogType) |
|
75 |
|
76 #ifdef Q_OS_SYMBIAN |
|
77 // If show group is higher than normal, a swEvent capability is required |
|
78 if (showLevel(parameters) != NormalLevel) { |
|
79 return (securityInfo["sym-caps"].toInt() >> ECapabilitySwEvent) & 1; |
|
80 } else { |
|
81 return true; // all clients are allowed to use. |
|
82 } |
|
83 #else |
73 Q_UNUSED(parameters) |
84 Q_UNUSED(parameters) |
74 Q_UNUSED(securityInfo) |
85 Q_UNUSED(securityInfo) |
75 |
86 // All clients are allowed to use. |
76 // This plugin doesn't perform operations that may compromise security. All clients |
|
77 // are allowed to use. |
|
78 return true; |
87 return true; |
79 TRACE_EXIT |
88 #endif // Q_OS_SYMBIAN |
80 } |
89 } |
81 |
90 |
82 // Create device dialog widget |
91 // Create device dialog widget |
83 HbDeviceDialogInterface *HbDeviceNotificationDialogPlugin::createDeviceDialog( |
92 HbDeviceDialogInterface *HbDeviceNotificationDialogPlugin::createDeviceDialog( |
84 const QString &deviceDialogType, const QVariantMap ¶meters) |
93 const QString &deviceDialogType, const QVariantMap ¶meters) |
107 bool HbDeviceNotificationDialogPlugin::deviceDialogInfo(const QString &deviceDialogType, |
116 bool HbDeviceNotificationDialogPlugin::deviceDialogInfo(const QString &deviceDialogType, |
108 const QVariantMap ¶meters, DeviceDialogInfo *info) const |
117 const QVariantMap ¶meters, DeviceDialogInfo *info) const |
109 { |
118 { |
110 TRACE_ENTRY |
119 TRACE_ENTRY |
111 Q_UNUSED(deviceDialogType); |
120 Q_UNUSED(deviceDialogType); |
112 Q_UNUSED(parameters); |
|
113 |
121 |
|
122 unsigned int level = static_cast<unsigned int>(showLevel(parameters)); |
|
123 if (level > CriticalLevel) { |
|
124 return false; |
|
125 } |
114 info->group = DeviceNotificationDialogGroup; |
126 info->group = DeviceNotificationDialogGroup; |
115 info->flags = NoDeviceDialogFlags; |
127 info->flags = level == NormalLevel ? NoDeviceDialogFlags : SecurityCheck; |
116 info->priority = DefaultPriority; |
128 info->showLevel = static_cast<ShowLevel>(level); |
117 |
|
118 TRACE_EXIT |
|
119 return true; |
129 return true; |
120 } |
130 } |
121 |
131 |
122 // Return device dialog types this plugin implements |
132 // Return device dialog types this plugin implements |
123 QStringList HbDeviceNotificationDialogPlugin::deviceDialogTypes() const |
133 QStringList HbDeviceNotificationDialogPlugin::deviceDialogTypes() const |