equal
deleted
inserted
replaced
18 #ifndef IRSERVICECLIENT_H_ |
18 #ifndef IRSERVICECLIENT_H_ |
19 #define IRSERVICECLIENT_H_ |
19 #define IRSERVICECLIENT_H_ |
20 |
20 |
21 // System includes |
21 // System includes |
22 #include <QObject> |
22 #include <QObject> |
|
23 #include <QMutex> |
23 #include <xqappmgr.h> |
24 #include <xqappmgr.h> |
24 |
25 |
25 // User includes |
26 // User includes |
26 #include "irservicedef.h" |
27 #include "irservicedef.h" |
27 #include "irappinspector.h" |
28 #include "irappinspector.h" |
35 class IrServiceClient : public QObject |
36 class IrServiceClient : public QObject |
36 { |
37 { |
37 Q_OBJECT |
38 Q_OBJECT |
38 |
39 |
39 public: |
40 public: |
40 explicit IrServiceClient(QObject *aParent = 0); |
41 |
41 virtual ~IrServiceClient(); |
42 /*! |
|
43 * Get the instance of IrServiceClient |
|
44 * @return IrServiceClient* |
|
45 */ |
|
46 static IrServiceClient* openInstance(); |
|
47 |
|
48 /*! |
|
49 * Close the instance of IrServiceClient |
|
50 */ |
|
51 void closeInstance(); |
|
52 |
|
53 private: |
|
54 IrServiceClient(); |
|
55 virtual ~IrServiceClient(); |
42 |
56 |
43 public: |
57 public: |
44 bool startMonitoringIrState(); |
58 bool startMonitoringIrState(); |
45 void stopMonitoringIrState(); |
59 |
46 |
60 |
47 bool isStationPlayed(); |
61 bool isStationPlayed(); |
48 bool loadStationName(QString &aStationName); |
62 bool loadStationName(QString &aStationName); |
49 bool loadStationLogoFlag(); |
63 bool loadStationLogoFlag(); |
50 |
64 |
62 void metaDataUpdated(const QString &aMetaData); |
76 void metaDataUpdated(const QString &aMetaData); |
63 void irStateChanged(IrAppState::Type aNewState); |
77 void irStateChanged(IrAppState::Type aNewState); |
64 |
78 |
65 void controlFailed(); |
79 void controlFailed(); |
66 |
80 |
|
81 private: |
|
82 void notifyStationNameUpdated(const QString &aStationName); |
|
83 void notifyStationLogoUpdated(bool aIsLogoAvailable); |
|
84 void notifyMetaDataUpdated(const QString &aMetaData); |
|
85 void notifyIrStateChanged(IrAppState::Type aNewState); |
|
86 |
67 private slots: |
87 private slots: |
68 // used for return value from Monitor Service via Qt HighWay |
88 // used for return value from Monitor Service via Qt HighWay |
69 void handleMonitorRequestOk(const QVariant &aRetValue); |
89 void handleMonitorRequestOk(const QVariant &aRetValue); |
70 void handleMonitorRequestError(int aErrCode, const QString &aErrMessage); |
90 void handleMonitorRequestError(int aErrCode, const QString &aErrMessage); |
71 |
91 |
78 |
98 |
79 private: |
99 private: |
80 bool createControlServiceRequest(); |
100 bool createControlServiceRequest(); |
81 bool createMonitorServiceRequest(); |
101 bool createMonitorServiceRequest(); |
82 bool createRefreshServiceRequest(); |
102 bool createRefreshServiceRequest(); |
|
103 |
|
104 void clearMonitorServiceRequest(); |
83 |
105 |
84 enum IrAppVisibilty |
106 enum IrAppVisibilty |
85 { |
107 { |
86 DoNotChange, |
108 DoNotChange, |
87 ToForeground, |
109 ToForeground, |
94 void prepareRequestInfo(XQAiwRequest *aRequest, IrAppVisibilty aVisibility); |
116 void prepareRequestInfo(XQAiwRequest *aRequest, IrAppVisibilty aVisibility); |
95 |
117 |
96 void processNotificationData(const IrServiceData &aServiceData); |
118 void processNotificationData(const IrServiceData &aServiceData); |
97 |
119 |
98 void initHsWidgetNoRunStopped(); |
120 void initHsWidgetNoRunStopped(); |
99 void resetHsWidgetExitStopped(); |
|
100 |
121 |
101 private: |
122 void refreshAllActiveHsWidgets(); |
|
123 |
|
124 private: |
|
125 static QMutex mMutex; |
|
126 static int mRef; |
|
127 static bool mMonitoringStarted; |
|
128 static IrServiceClient *mInstatnce; |
|
129 |
|
130 QString mStationName; |
|
131 bool mStationLogoAvailable; // true if station has its own logo |
|
132 QString mMetaData; |
|
133 IrAppState::Type mIrState; |
|
134 |
102 IrAppInspector *mIrAppInspector; |
135 IrAppInspector *mIrAppInspector; |
103 |
136 |
104 bool mMonitorReqOngoing; |
137 bool mMonitorReqOngoing; |
105 bool mControlReqOngoing; |
138 bool mControlReqOngoing; |
106 |
139 |