systemsettings/accindicatorplugin/inc/accindicator.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 03 May 2010 12:40:23 +0300
changeset 28 b0b858956ed5
child 46 eea20ed08f4b
permissions -rw-r--r--
Revision: 201015 Kit: 201018

/*
 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
 * which accompanies this distribution, and is available
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
 *
 * Initial Contributors:
 * Nokia Corporation - initial contribution.
 *
 * Contributors:
 *
 * Description: Accessory Indicator class
 *
 */

#ifndef ACCINDICATOR_H
#define ACCINDICATOR_H

#include <QObject>

#include <QVariant>
#include <QtCore/QProcess>

#include <hbindicatorinterface.h>
#include <hbindicatorplugininterface.h>

#include <accpolaccessorymode.h>

/**
 * Accessory indicator class. 
 * Handles client request and shows the indications. 
 */
class AccIndicatorPlugin : public HbIndicatorInterface, public HbIndicatorPluginInterface
{
    Q_OBJECT
    Q_INTERFACES(HbIndicatorPluginInterface)
public:

    AccIndicatorPlugin();
    ~AccIndicatorPlugin();
public:
    //from HbindicatorInterface    
    bool handleInteraction(InteractionType type);
    QVariant indicatorData(int role) const;
    
public:
    //from HbIndicatorPluginInterface
    QStringList indicatorTypes() const;
    bool accessAllowed(const QString &indicatorType,
                               const HbSecurityInfo *securityInfo) const;   
    HbIndicatorInterface* createIndicator(const QString &indicatorType);
    int error() const;

protected:
    //from HbindicatorInterface
    bool handleClientRequest(RequestType type, const QVariant &parameter);
    
private: 
    void prepareDisplayName();
   
private:

    QString mDisplayName;
    QProcess mProcess;
    TAccMode mAccMode;
    int mAccType;
    QStringList mIndicatorTypes;
    QStringList mArgs;
    
private slots:
    void processError(QProcess::ProcessError err); // handler for error codes

private:
    Q_DISABLE_COPY(AccIndicatorPlugin)
    int mError;
    };

#endif // ACCINDICATOR_H