diff -r 92ab7f8d0eab -r 6bb1b21d2484 phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetengine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidgetengine.h Fri Apr 16 14:58:25 2010 +0300 @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2009 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: + * + */ + +#ifndef INFOWIDGETENGINE_H_ +#define INFOWIDGETENGINE_H_ + + +#include +#include + +class InfoWidgetNetworkHandler; +class InfoWidgetSatHandler; +class InfoWidgetLineHandler; + +class InfoWidgetEngine : public QObject + { + Q_OBJECT + +public: + + enum HandlerEntity { + NotDefined = 0, + NetworkHandler, + SatHandler, + LineHandler + }; + + class ModelData { + public: + int mcnIndicatorType() const { return m_mcnIndicatorType; }; + void setMcnIndicatorType(const int type){ m_mcnIndicatorType = type; }; + + int homeZoneIndicatorType() const { return m_homeZoneIndicatorType; }; + void setHomeZoneIndicatorType(const int type){ m_homeZoneIndicatorType = type; }; + + int activeLine() const { return m_activeLine; }; + void setActiveLine(const int line){ m_activeLine = line; }; + + const QString& mcnName() const { return m_mcnName; }; + void setMcnName(const QString& name){ m_mcnName = name; }; + + const QString& serviceProviderName() const { return m_serviceProviderName; }; + void setServiceProviderName(const QString& name){ m_serviceProviderName = name; }; + + const QString& homeZoneTextTag() const { return m_homeZoneTextTag; }; + void setHomeZoneTextTag(const QString& tag){ m_homeZoneTextTag = tag; }; + + const QString& satDisplayText() const { return m_satDisplayText; }; + void setSatDisplayText(const QString& text){ m_satDisplayText = text; }; + + private: + int m_mcnIndicatorType; + int m_homeZoneIndicatorType; + int m_activeLine; + + QString m_mcnName; + QString m_serviceProviderName; + QString m_homeZoneTextTag; + QString m_satDisplayText; + }; + +public: + InfoWidgetEngine(QObject *parent = 0); + ~InfoWidgetEngine(); + + const InfoWidgetEngine::ModelData &modelData() const; + + void logModelData(); + +signals: + void modelError(int operation, int errorCode); + void modelChanged(); + +public slots: + void updateNetworkDataToModel(); + void updateSatDataToModel(); + void updateLineDataToModel(); + + void handleNetworkError(int operation, int errorCode); + void handleSatError(int operation, int errorCode); + void handleLineError(int operation, int errorCode); + +private: + ModelData m_modelData; + + // Own + QScopedPointer m_networkHandler; + }; + +#endif /* INFOWIDGETENGINE_H_ */ + +