wlanutilities/wlanindicatorplugin/inc/wlanindicatorplugin.h
changeset 19 10810c91db26
child 22 498f36116140
equal deleted inserted replaced
3:ff3b37722600 19:10810c91db26
       
     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 #ifndef WLANINDICATORPLUGIN_H
       
    19 #define WLANINDICATORPLUGIN_H
       
    20 
       
    21 #include <QtCore/QVariant>
       
    22 #include <QtCore/QProcess>
       
    23 #include <hbindicatorplugininterface.h>
       
    24 #include <hbindicatorinterface.h>
       
    25 
       
    26 const int wlanNotConnected = 0;
       
    27 const int wlanConnected = 1;
       
    28 
       
    29 class WlanIndicatorPlugin : public HbIndicatorInterface, public HbIndicatorPluginInterface
       
    30 {
       
    31     Q_OBJECT
       
    32     Q_INTERFACES(HbIndicatorPluginInterface)
       
    33     
       
    34 #ifdef WLANINDICATOR_UT    
       
    35     friend class WlanIndicatorUtCases;
       
    36 #endif
       
    37     
       
    38 public:
       
    39     WlanIndicatorPlugin();
       
    40     ~WlanIndicatorPlugin();
       
    41 
       
    42 public:
       
    43     //from HbIndicatorPluginInterface
       
    44     QStringList indicatorTypes() const;
       
    45     bool accessAllowed(const QString &indicatorType,
       
    46                        const HbSecurityInfo *securityInfo) const;
       
    47     HbIndicatorInterface* createIndicator(const QString &indicatorType);
       
    48     int error() const;
       
    49 public:
       
    50     //from HbIndicatorInterface
       
    51     bool handleClientRequest (RequestType type, const QVariant &parameter);
       
    52     bool handleInteraction (InteractionType type); 
       
    53     QVariant indicatorData(int role) const;
       
    54 
       
    55 private slots:
       
    56     void processError(QProcess::ProcessError err); // handler for error codes
       
    57     
       
    58 private:
       
    59     
       
    60     Q_DISABLE_COPY(WlanIndicatorPlugin)
       
    61     QStringList mIndicatorTypes;  // Type of indicator
       
    62     int mError;                   // Indicator error
       
    63     QVariant mParameter;          // Used to contain the status of wlan    
       
    64     QProcess process;             // Process to start external programs
       
    65 };
       
    66 #endif //WLANINDICATORPLUGIN_H