messagingapp/msgnotifications/msgindicatorplugin/src/msgindicatorplugin.cpp
changeset 23 238255e8b033
child 25 84d9eb65b26f
equal deleted inserted replaced
5:4697dfb2d7ad 23:238255e8b033
       
     1 /*
       
     2  * Copyright (c) 2009 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 "msgindicatorplugin.h"
       
    19 
       
    20 #include "msgindicator.h"
       
    21 #include <QtPlugin>
       
    22 #include <QVariant>
       
    23 
       
    24 Q_EXPORT_PLUGIN(MsgIndicatorPlugin)
       
    25 
       
    26 // ----------------------------------------------------------------------------
       
    27 // MsgIndicatorPlugin::MsgIndicatorPlugin
       
    28 // @see msgindicatorplugin.h
       
    29 // ----------------------------------------------------------------------------
       
    30 MsgIndicatorPlugin::MsgIndicatorPlugin() : mError(0)
       
    31 {
       
    32    
       
    33 }
       
    34 
       
    35 // ----------------------------------------------------------------------------
       
    36 // MsgIndicatorPlugin::~MsgIndicatorPlugin
       
    37 // @see msgindicatorplugin.h
       
    38 // ----------------------------------------------------------------------------
       
    39 MsgIndicatorPlugin::~MsgIndicatorPlugin()
       
    40 {
       
    41 }
       
    42 
       
    43 // ----------------------------------------------------------------------------
       
    44 // MsgIndicatorPlugin::indicatorTypes
       
    45 // Return notification types this plugin implements
       
    46 // @see msgindicatorplugin.h
       
    47 // ----------------------------------------------------------------------------
       
    48 QStringList MsgIndicatorPlugin::indicatorTypes() const
       
    49 {
       
    50   QStringList types; 
       
    51   types << "com.nokia.messaging.indicatorplugin/1.0";
       
    52   return types;
       
    53 }
       
    54 
       
    55 // ----------------------------------------------------------------------------
       
    56 // MsgIndicatorPlugin::accessAllowed
       
    57 // Check if client is allowed to use notification widget
       
    58 // @see msgindicatorplugin.h
       
    59 // ----------------------------------------------------------------------------
       
    60 bool MsgIndicatorPlugin::accessAllowed(const QString &indicatorType,
       
    61     const HbSecurityInfo *securityInfo) const
       
    62 {
       
    63     Q_UNUSED(indicatorType)
       
    64     Q_UNUSED(securityInfo)
       
    65 
       
    66     // This plugin doesn't perform operations that may compromise security.
       
    67     // All clients are allowed to use.
       
    68     return true;
       
    69 }
       
    70 
       
    71 // ----------------------------------------------------------------------------
       
    72 // MsgIndicatorPlugin::createIndicator
       
    73 // @see msgindicatorplugin.h
       
    74 // ----------------------------------------------------------------------------
       
    75 HbIndicatorInterface* MsgIndicatorPlugin::createIndicator(
       
    76         const QString &indicatorType)
       
    77 {
       
    78     HbIndicatorInterface *indicator = new MsgIndicator(indicatorType);
       
    79 
       
    80     return indicator;
       
    81 }
       
    82 
       
    83 // ----------------------------------------------------------------------------
       
    84 // MsgIndicatorPlugin::error
       
    85 // @see msgindicatorplugin.h
       
    86 // ----------------------------------------------------------------------------
       
    87 int MsgIndicatorPlugin::error() const
       
    88 {
       
    89     return mError;
       
    90 }
       
    91 
       
    92 
       
    93 
       
    94