systemsettings/accindicatorplugin/inc/accindicator.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: Accessory Indicator class
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef ACCINDICATOR_H
       
    19 #define ACCINDICATOR_H
       
    20 
       
    21 #include <QObject>
       
    22 
       
    23 #include <QVariant>
       
    24 #include <QtCore/QProcess>
       
    25 
       
    26 #include <hbindicatorinterface.h>
       
    27 #include <hbindicatorplugininterface.h>
       
    28 
       
    29 #include <accpolaccessorymode.h>
       
    30 
       
    31 /**
       
    32  * Accessory indicator class. 
       
    33  * Handles client request and shows the indications. 
       
    34  */
       
    35 class AccIndicatorPlugin : public HbIndicatorInterface, public HbIndicatorPluginInterface
       
    36 {
       
    37     Q_OBJECT
       
    38     Q_INTERFACES(HbIndicatorPluginInterface)
       
    39 public:
       
    40 
       
    41     AccIndicatorPlugin();
       
    42     ~AccIndicatorPlugin();
       
    43 public:
       
    44     //from HbindicatorInterface    
       
    45     bool handleInteraction(InteractionType type);
       
    46     QVariant indicatorData(int role) const;
       
    47     
       
    48 public:
       
    49     //from HbIndicatorPluginInterface
       
    50     QStringList indicatorTypes() const;
       
    51     bool accessAllowed(const QString &indicatorType, const QVariantMap &securityInfo) const;   
       
    52     HbIndicatorInterface* createIndicator(const QString &indicatorType);
       
    53     int error() const;
       
    54 
       
    55 protected:
       
    56     //from HbindicatorInterface
       
    57     bool handleClientRequest(RequestType type, const QVariant &parameter);
       
    58     
       
    59 private: 
       
    60     void prepareDisplayName();
       
    61    
       
    62 private:
       
    63 
       
    64     QString mDisplayName;
       
    65     QProcess mProcess;
       
    66     TAccMode mAccMode;
       
    67     int mAccType;
       
    68     QStringList mIndicatorTypes;
       
    69     QStringList mArgs;
       
    70     
       
    71 private slots:
       
    72     void processError(QProcess::ProcessError err); // handler for error codes
       
    73 
       
    74 private:
       
    75     Q_DISABLE_COPY(AccIndicatorPlugin)
       
    76     int mError;
       
    77     };
       
    78 
       
    79 #endif // ACCINDICATOR_H
       
    80