emailuis/nmindicatorplugin/src/nmindicatorplugin.cpp
changeset 23 2dc6caa42ec3
parent 20 ecc8def7944a
child 30 759dc5235cdb
equal deleted inserted replaced
20:ecc8def7944a 23:2dc6caa42ec3
    27 #include <email_services_api.h>
    27 #include <email_services_api.h>
    28 
    28 
    29 Q_EXPORT_PLUGIN(NmIndicatorPlugin)
    29 Q_EXPORT_PLUGIN(NmIndicatorPlugin)
    30 
    30 
    31 const int NmMaxIndicatorCount = 10;
    31 const int NmMaxIndicatorCount = 10;
       
    32 static const QString emailServiceNameMailbox = "nmail.com.nokia.symbian.IEmailInboxView";
    32 
    33 
    33 /*!
    34 /*!
    34     \class NmIndicatorPlugin
    35     \class NmIndicatorPlugin
    35     \brief Mail indicator plugin class.
    36     \brief Mail indicator plugin class.
    36 */
    37 */
    64     }
    65     }
    65     return types;
    66     return types;
    66 }
    67 }
    67 
    68 
    68 /*!
    69 /*!
    69 	Check if client is allowed to use notification widget
    70     Check if client is allowed to use notification widget
    70 	see HbIndicatorPluginInterface
    71     see HbIndicatorPluginInterface
    71 */
    72 */
    72 bool NmIndicatorPlugin::accessAllowed(const QString &indicatorType,
    73 bool NmIndicatorPlugin::accessAllowed(const QString &indicatorType,
    73     const HbSecurityInfo *securityInfo) const
    74     const QVariantMap &securityInfo) const
    74 {
    75 {
    75     Q_UNUSED(indicatorType)
    76     Q_UNUSED(indicatorType)
    76     Q_UNUSED(securityInfo)
    77     Q_UNUSED(securityInfo)
    77 
    78 
    78     // This plugin doesn't perform operations that may compromise security.
    79     // This plugin doesn't perform operations that may compromise security.
    79     // All clients are allowed to use.
    80     // All clients are allowed to use.
    80     return true;
    81     return true;
    81 }
    82 }
       
    83 
    82 
    84 
    83 /*!
    85 /*!
    84     Called when any of the indicator receive updated status of the global status
    86     Called when any of the indicator receive updated status of the global status
    85  */
    87  */
    86 void NmIndicatorPlugin::globalStatusChanged(bool sending)
    88 void NmIndicatorPlugin::globalStatusChanged(bool sending)
   173 */
   175 */
   174 bool NmIndicatorPlugin::showMailbox(quint64 mailboxId)
   176 bool NmIndicatorPlugin::showMailbox(quint64 mailboxId)
   175 {
   177 {
   176     NMLOG("NmIndicatorPlugin::showMailbox");
   178     NMLOG("NmIndicatorPlugin::showMailbox");
   177     XQServiceRequest request(
   179     XQServiceRequest request(
   178         emailInterfaceNameMailbox,
   180         emailServiceNameMailbox,
   179         emailOperationViewInbox,
   181         emailOperationViewInbox,
   180         true);
   182         true);
   181 
   183 
   182     QList<QVariant> list;
   184     QList<QVariant> list;
   183     list.append(QVariant(mailboxId));
   185     list.append(QVariant(mailboxId));