|
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 _RADIOUIUTILITIES_H_ |
|
19 #define _RADIOUIUTILITIES_H_ |
|
20 |
|
21 // System includes |
|
22 #include <QWeakPointer> |
|
23 |
|
24 // User includes |
|
25 #include "radio_global.h" |
|
26 |
|
27 // Forward declarations |
|
28 class RadioFrequencyStrip; |
|
29 class RadioStationCarousel; |
|
30 class RadioFrequencyScanner; |
|
31 class HbNotificationDialog; |
|
32 |
|
33 struct EffectInfo |
|
34 { |
|
35 EffectInfo( QGraphicsItem* item, QString path, QString event ) : |
|
36 mItem( item ), |
|
37 mPath( path ), |
|
38 mEvent( event ) |
|
39 {} |
|
40 |
|
41 QGraphicsItem* mItem; |
|
42 QString mPath; |
|
43 QString mEvent; |
|
44 |
|
45 private: |
|
46 EffectInfo(); |
|
47 }; |
|
48 typedef QList<EffectInfo> QEffectList; |
|
49 |
|
50 // Class declaration |
|
51 class RadioUtil |
|
52 { |
|
53 public: |
|
54 |
|
55 static bool addEffects( QEffectList list ); |
|
56 |
|
57 static RadioFrequencyStrip* frequencyStrip(); |
|
58 static RadioStationCarousel* carousel(); |
|
59 static bool isScannerAlive(); |
|
60 static Scan::Status scanStatus(); |
|
61 |
|
62 static void setFrequencyStrip( RadioFrequencyStrip* frequencyStrip ); |
|
63 static void setCarousel( RadioStationCarousel* carousel ); |
|
64 static void setFrequencyScanner( RadioFrequencyScanner* scanner ); |
|
65 static void setScanStatus( Scan::Status status ); |
|
66 |
|
67 static Scroll::Direction scrollDirectionFromSkipMode( int skipMode ); |
|
68 static Scroll::Direction scrollDirection( int direction ); |
|
69 static TuneReason::Reason tuneReason( int tuneReason ); |
|
70 |
|
71 static void showDiscreetNote( const QString& text ); |
|
72 |
|
73 private: |
|
74 |
|
75 RadioUtil(); |
|
76 ~RadioUtil(); |
|
77 |
|
78 static RadioUtil& instance(); |
|
79 |
|
80 private: // data |
|
81 |
|
82 QWeakPointer<RadioFrequencyStrip> mFrequencyStrip; |
|
83 |
|
84 QWeakPointer<RadioStationCarousel> mCarousel; |
|
85 |
|
86 QWeakPointer<RadioFrequencyScanner> mScanner; |
|
87 |
|
88 QWeakPointer<HbNotificationDialog> mNotificationDialog; |
|
89 |
|
90 Scan::Status mScanStatus; |
|
91 |
|
92 }; |
|
93 |
|
94 |
|
95 #endif // _RADIOUIUTILITIES_H_ |