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