author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Fri, 11 Jun 2010 13:38:32 +0300 | |
changeset 28 | 075425b8d9a4 |
parent 24 | 6df133bd92e1 |
child 32 | 189d20c34778 |
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> |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
23 |
#include <QPointer> |
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 |
||
46 |
public slots: |
|
47 |
||
48 |
void requestNotifications(); // Slot called by Qt Highway |
|
49 |
void requestAllData(); // Slot called by Qt Highway |
|
50 |
||
51 |
private slots: |
|
52 |
||
53 |
void notifyRadioStatus(); |
|
54 |
void notifyFavoriteCount(); |
|
55 |
void notifyStationChange( const RadioStation& station ); |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
56 |
void sendNotifications(); |
24 | 57 |
|
58 |
private: |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
59 |
|
24 | 60 |
// from base class RadioEngineWrapperObserver |
61 |
||
62 |
void tunedToFrequency( uint frequency, int reason ); |
|
63 |
||
64 |
// New functions |
|
65 |
||
66 |
RadioStatus::Status determineRadioStatus() const; |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
67 |
|
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
68 |
void checkIfCurrentStationIsFavorite(); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
69 |
|
24 | 70 |
void notify( const QVariant& notification ); |
71 |
void notifyList( const QVariantList& list ); |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
72 |
|
24 | 73 |
private: // data |
74 |
||
75 |
RadioUiEnginePrivate& mUiEngine; |
|
76 |
||
77 |
QList<int> mRequestIndexes; |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
78 |
|
24 | 79 |
RadioStatus::Status mRadioStatus; |
80 |
||
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
81 |
QVariantList mNotificationList; |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
82 |
|
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
83 |
QPointer<QTimer> mNotificationTimer; |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
84 |
|
24 | 85 |
}; |
86 |
||
87 |
#endif // RADIOMONITORSERVICE_H |