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 RADIOENGINEWRAPPER_H |
|
19 #define RADIOENGINEWRAPPER_H |
|
20 |
|
21 // System includes |
|
22 #include <QScopedPointer> |
|
23 |
|
24 // User includes |
|
25 #include "radiowrapperexport.h" |
|
26 #include "radio_global.h" |
|
27 |
|
28 // Forward declarations |
|
29 class RadioEngineWrapperPrivate; |
|
30 class RadioSettingsIf; |
|
31 class RadioStationHandlerIf; |
|
32 class RadioEngineWrapperObserver; |
|
33 |
|
34 // Class declaration |
|
35 class WRAPPER_DLL_EXPORT RadioEngineWrapper |
|
36 { |
|
37 Q_DECLARE_PRIVATE_D( d_ptr.data(), RadioEngineWrapper ) |
|
38 Q_DISABLE_COPY( RadioEngineWrapper ) |
|
39 |
|
40 public: |
|
41 |
|
42 /** |
|
43 * Constructor and destructor |
|
44 */ |
|
45 RadioEngineWrapper( RadioStationHandlerIf& stationHandler ); |
|
46 ~RadioEngineWrapper(); |
|
47 |
|
48 bool init(); |
|
49 |
|
50 void addObserver( RadioEngineWrapperObserver* observer ); |
|
51 void removeObserver( RadioEngineWrapperObserver* observer ); |
|
52 |
|
53 /** |
|
54 * Getters for things owned by the engine |
|
55 */ |
|
56 RadioSettingsIf& settings(); |
|
57 |
|
58 /** |
|
59 * Getters for region and other region dependent settings |
|
60 */ |
|
61 RadioRegion::Region region() const; |
|
62 uint minFrequency() const; |
|
63 uint maxFrequency() const; |
|
64 uint frequencyStepSize() const; |
|
65 bool isFrequencyValid( uint frequency ) const; |
|
66 |
|
67 /** |
|
68 * Getters for current radio status |
|
69 */ |
|
70 bool isRadioOn() const; |
|
71 uint currentFrequency() const; |
|
72 bool isMuted() const; |
|
73 bool isAntennaAttached() const; |
|
74 bool isUsingLoudspeaker() const; |
|
75 |
|
76 void setManualSeekMode( bool manualSeek ); |
|
77 bool isInManualSeekMode() const; |
|
78 |
|
79 void setRdsEnabled( bool rdsEnabled ); |
|
80 |
|
81 /** |
|
82 * Tunes to the given frequency |
|
83 */ |
|
84 void setFrequency( uint frequency, const int reason = TuneReason::Unspecified ); |
|
85 |
|
86 /*! |
|
87 * Audio update command functions for the engine |
|
88 */ |
|
89 void increaseVolume(); |
|
90 void decreaseVolume(); |
|
91 void setVolume( int volume ); |
|
92 void setMute( bool muted, bool updateSettings = true ); |
|
93 void toggleAudioRoute(); |
|
94 |
|
95 void startSeeking( Seek::Direction direction, const int reason = TuneReason::Unspecified ); |
|
96 void cancelSeeking(); |
|
97 |
|
98 private: // data |
|
99 |
|
100 /** |
|
101 * Unmodifiable pointer to the private implementation |
|
102 */ |
|
103 const QScopedPointer<RadioEngineWrapperPrivate> d_ptr; |
|
104 |
|
105 }; |
|
106 |
|
107 #endif // RADIOENGINEWRAPPER_H |
|