connectionmonitoring/cellularindicatorplugin/inc/cellularindicatorplugin.h
changeset 18 fcbbe021d614
child 20 9c97ad6591ae
equal deleted inserted replaced
4:77415202bfc8 18:fcbbe021d614
       
     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 CELLULARINDICATORPLUGIN_H
       
    19 #define CELLULARINDICATORPLUGIN_H
       
    20 
       
    21 #include <hbindicatorplugininterface.h>
       
    22 #include <hbindicatorinterface.h>
       
    23 #include <QtCore/QProcess>
       
    24 #include <QtCore/QVariant>
       
    25 
       
    26 
       
    27 /**
       
    28  * This class describes cellular indicator plug-in
       
    29  */
       
    30 class CellularIndicatorPlugin : public HbIndicatorInterface,
       
    31     public HbIndicatorPluginInterface
       
    32 {
       
    33 
       
    34     Q_OBJECT
       
    35     Q_INTERFACES(HbIndicatorPluginInterface)
       
    36 
       
    37 public:
       
    38 
       
    39     CellularIndicatorPlugin();
       
    40     ~CellularIndicatorPlugin();
       
    41 
       
    42 public:
       
    43 
       
    44     //from HbIndicatorPluginInterface
       
    45     
       
    46     // Return indicator type of indicator
       
    47     QStringList indicatorTypes() const;
       
    48     
       
    49     // Access is allowed allways
       
    50     bool accessAllowed(const QString &indicatorType,
       
    51                        const HbSecurityInfo *securityInfo) const;
       
    52     
       
    53     // Create indicator. Currently installs translation.
       
    54     HbIndicatorInterface* createIndicator(const QString &indicatorType);
       
    55     
       
    56     // Return error if any
       
    57     int error() const;
       
    58 
       
    59 public:
       
    60 
       
    61     //from HbIndicatorInterface
       
    62     
       
    63     // Client requests are directed to here
       
    64     bool handleClientRequest (RequestType type, const QVariant &parameter);
       
    65     
       
    66     // This called when item is selected in indicator menu
       
    67     bool handleInteraction(InteractionType type);
       
    68     
       
    69     // Used to get indicator data (icon or text)
       
    70     QVariant indicatorData(int role) const;
       
    71 
       
    72 private slots:
       
    73     // handler for error codes
       
    74     void processError(QProcess::ProcessError err);
       
    75 
       
    76 private: // data
       
    77 
       
    78     // Disable copy constructor
       
    79     Q_DISABLE_COPY(CellularIndicatorPlugin)
       
    80     // Indicator type
       
    81     QStringList mIndicatorTypes;
       
    82     // Error stored to member variable
       
    83     int mError;
       
    84     // Used to store the connection info
       
    85     QVariant mParameter;
       
    86     // Process to start external programs
       
    87     QProcess process;
       
    88 };
       
    89 
       
    90 
       
    91 
       
    92 
       
    93 #endif // CELLULARINDICATORPLUGIN_H