author | hgs |
Fri, 15 Oct 2010 16:26:27 +0300 | |
changeset 57 | 21be958eb3ce |
parent 47 | 74b7c6e79031 |
permissions | -rw-r--r-- |
24 | 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 RADIOMONITORSERVICE_H |
|
19 |
#define RADIOMONITORSERVICE_H |
|
20 |
||
21 |
// System includes |
|
22 |
#include <xqserviceprovider.h> |
|
57 | 23 |
#include <QQueue> |
24 | 24 |
|
25 |
// User includes |
|
26 |
#include "radioservicedef.h" |
|
27 |
#include "radioenginewrapperobserver.h" |
|
28 |
||
29 |
// Forward declarations |
|
30 |
class RadioUiEnginePrivate; |
|
31 |
class RadioStation; |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
32 |
class QTimer; |
24 | 33 |
|
34 |
class RadioMonitorService : public XQServiceProvider |
|
35 |
, public RadioEngineWrapperObserver |
|
36 |
{ |
|
37 |
Q_OBJECT |
|
38 |
||
39 |
public: |
|
40 |
||
41 |
RadioMonitorService( RadioUiEnginePrivate& engine ); |
|
42 |
virtual ~RadioMonitorService(); |
|
43 |
||
44 |
void init(); |
|
45 |
||
57 | 46 |
public Q_SLOTS: |
24 | 47 |
|
48 |
void requestNotifications(); // Slot called by Qt Highway |
|
49 |
void requestAllData(); // Slot called by Qt Highway |
|
50 |
||
57 | 51 |
private Q_SLOTS: |
24 | 52 |
|
53 |
void notifyRadioStatus(); |
|
54 |
void notifyFavoriteCount(); |
|
47 | 55 |
void notifyLocalCount(); |
24 | 56 |
void notifyStationChange( const RadioStation& station ); |
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
57 |
void sendNotifications(); |
24 | 58 |
|
59 |
private: |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
60 |
|
24 | 61 |
// from base class RadioEngineWrapperObserver |
62 |
||
63 |
void tunedToFrequency( uint frequency, int reason ); |
|
64 |
||
65 |
// New functions |
|
66 |
||
67 |
RadioStatus::Status determineRadioStatus() const; |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
68 |
|
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
69 |
void checkIfCurrentStationIsFavorite(); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
70 |
|
34 | 71 |
QString trimHtmlTags( const QString& html ); |
72 |
||
24 | 73 |
void notify( const QVariant& notification ); |
57 | 74 |
void notify( const QVariantList& list ); |
24 | 75 |
void notifyList( const QVariantList& list ); |
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
76 |
|
24 | 77 |
private: // data |
78 |
||
79 |
RadioUiEnginePrivate& mUiEngine; |
|
80 |
||
81 |
QList<int> mRequestIndexes; |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
82 |
|
24 | 83 |
RadioStatus::Status mRadioStatus; |
84 |
||
57 | 85 |
QQueue<QVariantList> mNotificationQueue; |
86 |
||
34 | 87 |
QTimer* mNotificationTimer; |
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
88 |
|
24 | 89 |
}; |
90 |
||
91 |
#endif // RADIOMONITORSERVICE_H |