phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetengine.h
changeset 22 6bb1b21d2484
child 27 2f8f8080a020
equal deleted inserted replaced
21:92ab7f8d0eab 22:6bb1b21d2484
       
     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 INFOWIDGETENGINE_H_
       
    19 #define INFOWIDGETENGINE_H_
       
    20 
       
    21 
       
    22 #include <QObject>
       
    23 #include <QString>
       
    24 
       
    25 class InfoWidgetNetworkHandler;
       
    26 class InfoWidgetSatHandler;
       
    27 class InfoWidgetLineHandler;
       
    28 
       
    29 class InfoWidgetEngine : public QObject 
       
    30     {
       
    31     Q_OBJECT
       
    32     
       
    33 public:     
       
    34     
       
    35     enum HandlerEntity {
       
    36         NotDefined = 0, 
       
    37         NetworkHandler, 
       
    38         SatHandler, 
       
    39         LineHandler
       
    40     };
       
    41     
       
    42     class ModelData {    
       
    43     public: 
       
    44         int mcnIndicatorType() const { return m_mcnIndicatorType; }; 
       
    45         void setMcnIndicatorType(const int type){ m_mcnIndicatorType = type; };
       
    46         
       
    47         int homeZoneIndicatorType() const { return m_homeZoneIndicatorType; }; 
       
    48         void setHomeZoneIndicatorType(const int type){ m_homeZoneIndicatorType = type; };
       
    49 
       
    50         int activeLine() const { return m_activeLine; }; 
       
    51         void setActiveLine(const int line){ m_activeLine = line; };
       
    52 
       
    53         const QString& mcnName() const { return m_mcnName; };
       
    54         void setMcnName(const QString& name){ m_mcnName = name; };
       
    55 
       
    56         const QString& serviceProviderName() const { return m_serviceProviderName; };
       
    57         void setServiceProviderName(const QString& name){ m_serviceProviderName = name; };
       
    58         
       
    59         const QString& homeZoneTextTag() const { return m_homeZoneTextTag; };
       
    60         void setHomeZoneTextTag(const QString& tag){ m_homeZoneTextTag = tag; };
       
    61 
       
    62         const QString& satDisplayText() const { return m_satDisplayText; };
       
    63         void setSatDisplayText(const QString& text){ m_satDisplayText = text; };
       
    64         
       
    65     private: 
       
    66         int m_mcnIndicatorType; 
       
    67         int m_homeZoneIndicatorType;
       
    68         int m_activeLine; 
       
    69         
       
    70         QString m_mcnName;
       
    71         QString m_serviceProviderName;
       
    72         QString m_homeZoneTextTag;
       
    73         QString m_satDisplayText;
       
    74     }; 
       
    75     
       
    76 public:
       
    77     InfoWidgetEngine(QObject *parent = 0);
       
    78     ~InfoWidgetEngine();    
       
    79     
       
    80     const InfoWidgetEngine::ModelData &modelData() const;  
       
    81     
       
    82     void logModelData();
       
    83     
       
    84 signals:
       
    85     void modelError(int operation, int errorCode);
       
    86     void modelChanged(); 
       
    87     
       
    88 public slots: 
       
    89     void updateNetworkDataToModel();
       
    90     void updateSatDataToModel();
       
    91     void updateLineDataToModel();
       
    92 
       
    93     void handleNetworkError(int operation, int errorCode); 
       
    94     void handleSatError(int operation, int errorCode); 
       
    95     void handleLineError(int operation, int errorCode);
       
    96     
       
    97 private: 
       
    98     ModelData m_modelData;
       
    99     
       
   100     // Own
       
   101     QScopedPointer<InfoWidgetNetworkHandler> m_networkHandler;
       
   102     }; 
       
   103 
       
   104 #endif /* INFOWIDGETENGINE_H_ */
       
   105 
       
   106