|
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 |
|
23 // User includes |
|
24 #include "radiowrapperexport.h" |
|
25 #include "radio_global.h" |
|
26 |
|
27 // Forward declarations |
|
28 class RadioEngineWrapperPrivate; |
|
29 class RadioSettings; |
|
30 class RadioStationHandlerIf; |
|
31 class RadioEngineWrapperObserver; |
|
32 |
|
33 // Class declaration |
|
34 class WRAPPER_DLL_EXPORT RadioEngineWrapper |
|
35 { |
|
36 Q_DECLARE_PRIVATE_D( d_ptr, RadioEngineWrapper ) |
|
37 Q_DISABLE_COPY( RadioEngineWrapper ) |
|
38 |
|
39 public: |
|
40 |
|
41 /** |
|
42 * Constructor and destructor |
|
43 */ |
|
44 RadioEngineWrapper( RadioStationHandlerIf& stationHandler, RadioEngineWrapperObserver& observer ); |
|
45 ~RadioEngineWrapper(); |
|
46 |
|
47 /** |
|
48 * Checks if the radio engine has been constructed properly |
|
49 */ |
|
50 bool isEngineConstructed(); |
|
51 |
|
52 /** |
|
53 * Getters for things owned by the engine |
|
54 */ |
|
55 RadioSettings& settings(); |
|
56 |
|
57 /** |
|
58 * Getters for region and other region dependent settings |
|
59 */ |
|
60 RadioRegion::Region region() const; |
|
61 uint minFrequency() const; |
|
62 uint maxFrequency() const; |
|
63 uint frequencyStepSize() const; |
|
64 bool isFrequencyValid( uint frequency ); |
|
65 |
|
66 /** |
|
67 * Getters for current radio status |
|
68 */ |
|
69 bool isRadioOn() const; |
|
70 bool isScanning() const; |
|
71 uint currentFrequency() const; |
|
72 bool isMuted() const; |
|
73 bool isAntennaAttached() const; |
|
74 bool isUsingLoudspeaker() const; |
|
75 |
|
76 /** |
|
77 * Slots to tune to given frequency or preset |
|
78 */ |
|
79 void tuneFrequency( uint frequency, const int sender = CommandSender::Unspecified ); |
|
80 void tuneWithDelay( uint frequency, const int sender = CommandSender::Unspecified ); |
|
81 |
|
82 /*! |
|
83 * volume update command slot for the engine |
|
84 */ |
|
85 void setVolume( int volume ); |
|
86 void toggleMute(); |
|
87 void toggleAudioRoute(); |
|
88 |
|
89 void startSeeking( Seeking::Direction direction ); |
|
90 void scanFrequencyBand(); |
|
91 void cancelScanFrequencyBand(); |
|
92 |
|
93 private: // data |
|
94 |
|
95 /** |
|
96 * Unmodifiable pointer to the private implementation |
|
97 */ |
|
98 RadioEngineWrapperPrivate* const d_ptr; |
|
99 |
|
100 }; |
|
101 |
|
102 #endif // RADIOENGINEWRAPPER_H |