--- a/qtinternetradio/irhswidgetplugin/inc/irserviceclient.h Wed Jun 23 18:04:00 2010 +0300
+++ b/qtinternetradio/irhswidgetplugin/inc/irserviceclient.h Tue Jul 06 14:07:20 2010 +0300
@@ -20,6 +20,7 @@
// System includes
#include <QObject>
+#include <QMutex>
#include <xqappmgr.h>
// User includes
@@ -37,12 +38,25 @@
Q_OBJECT
public:
- explicit IrServiceClient(QObject *aParent = 0);
- virtual ~IrServiceClient();
+
+ /*!
+ * Get the instance of IrServiceClient
+ * @return IrServiceClient*
+ */
+ static IrServiceClient* openInstance();
+
+ /*!
+ * Close the instance of IrServiceClient
+ */
+ void closeInstance();
+
+private:
+ IrServiceClient();
+ virtual ~IrServiceClient();
public:
bool startMonitoringIrState();
- void stopMonitoringIrState();
+
bool isStationPlayed();
bool loadStationName(QString &aStationName);
@@ -64,6 +78,12 @@
void controlFailed();
+private:
+ void notifyStationNameUpdated(const QString &aStationName);
+ void notifyStationLogoUpdated(bool aIsLogoAvailable);
+ void notifyMetaDataUpdated(const QString &aMetaData);
+ void notifyIrStateChanged(IrAppState::Type aNewState);
+
private slots:
// used for return value from Monitor Service via Qt HighWay
void handleMonitorRequestOk(const QVariant &aRetValue);
@@ -80,6 +100,8 @@
bool createControlServiceRequest();
bool createMonitorServiceRequest();
bool createRefreshServiceRequest();
+
+ void clearMonitorServiceRequest();
enum IrAppVisibilty
{
@@ -96,9 +118,20 @@
void processNotificationData(const IrServiceData &aServiceData);
void initHsWidgetNoRunStopped();
- void resetHsWidgetExitStopped();
+
+ void refreshAllActiveHsWidgets();
-private:
+private:
+ static QMutex mMutex;
+ static int mRef;
+ static bool mMonitoringStarted;
+ static IrServiceClient *mInstatnce;
+
+ QString mStationName;
+ bool mStationLogoAvailable; // true if station has its own logo
+ QString mMetaData;
+ IrAppState::Type mIrState;
+
IrAppInspector *mIrAppInspector;
bool mMonitorReqOngoing;