coreapplicationuis/powersaveutilities/psmindicatorplugin/inc/psmindicator.h
branchRCL_3
changeset 63 c2c61fdca848
parent 62 924385140d98
child 64 75184094ace1
child 66 9af619316cbf
equal deleted inserted replaced
62:924385140d98 63:c2c61fdca848
     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: power save mode Indicator class
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef PSMINDICATOR_H
       
    19 #define PSMINDICATOR_H
       
    20 
       
    21 #include <QObject>
       
    22 
       
    23 #include <QVariant>
       
    24 #include <QtCore/QProcess>
       
    25 
       
    26 #include <hbindicatorinterface.h>
       
    27 #include <hbindicatorplugininterface.h>
       
    28 #include <hbtranslator.h>
       
    29 
       
    30 
       
    31 /**
       
    32  * PSM indicator class. 
       
    33  * Handles client request and shows the indications. 
       
    34  */
       
    35 class PsmIndicatorPlugin : public HbIndicatorInterface, public HbIndicatorPluginInterface
       
    36 {
       
    37     Q_OBJECT
       
    38     Q_INTERFACES(HbIndicatorPluginInterface)
       
    39     
       
    40 public:
       
    41 
       
    42     PsmIndicatorPlugin();
       
    43     ~PsmIndicatorPlugin();
       
    44 public:
       
    45     //from HbindicatorInterface    
       
    46     bool handleInteraction(InteractionType type);
       
    47     QVariant indicatorData(int role) const;
       
    48     
       
    49 public:
       
    50     //from HbIndicatorPluginInterface
       
    51     QStringList indicatorTypes() const;
       
    52     bool accessAllowed(const QString &indicatorType,const QVariantMap &  securityInfo) const;   
       
    53     HbIndicatorInterface* createIndicator(const QString &indicatorType);
       
    54     int error() const;
       
    55 
       
    56       
       
    57 protected:
       
    58     //from HbindicatorInterface
       
    59     bool handleClientRequest(RequestType type, const QVariant &parameter);
       
    60    
       
    61    
       
    62 private:
       
    63 
       
    64     QString iDisplayName;
       
    65     QString iIcon;
       
    66     QProcess iProcess;
       
    67     QStringList iIndicatorTypes;
       
    68     HbTranslator *iTrans;
       
    69   
       
    70     
       
    71 private slots:
       
    72     void processError(QProcess::ProcessError err); // handler for error codes
       
    73 
       
    74 private:
       
    75     Q_DISABLE_COPY(PsmIndicatorPlugin)
       
    76     int mError;
       
    77     };
       
    78 
       
    79 #endif // PSMINDICATOR_H
       
    80