author | hgs |
Thu, 08 Jul 2010 12:44:18 +0300 | |
changeset 36 | ba22309243a1 |
parent 34 | bc10a61bd7d3 |
child 37 | 451b2e1545b2 |
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 RADIOENGINEWRAPPER_H |
|
19 |
#define RADIOENGINEWRAPPER_H |
|
20 |
||
21 |
// System includes |
|
34 | 22 |
#include <QScopedPointer> |
24 | 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 |
{ |
|
34 | 37 |
Q_DECLARE_PRIVATE_D( d_ptr.data(), RadioEngineWrapper ) |
24 | 38 |
Q_DISABLE_COPY( RadioEngineWrapper ) |
39 |
||
40 |
public: |
|
41 |
||
42 |
/** |
|
43 |
* Constructor and destructor |
|
44 |
*/ |
|
45 |
RadioEngineWrapper( RadioStationHandlerIf& stationHandler ); |
|
46 |
~RadioEngineWrapper(); |
|
47 |
||
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
48 |
bool init(); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
49 |
|
24 | 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; |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
65 |
bool isFrequencyValid( uint frequency ) const; |
24 | 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 |
||
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
76 |
void setManualSeekMode( bool manualSeek ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
77 |
bool isInManualSeekMode() const; |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
78 |
|
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
79 |
void setRdsEnabled( bool rdsEnabled ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
80 |
|
24 | 81 |
/** |
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
82 |
* Tunes to the given frequency |
24 | 83 |
*/ |
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
84 |
void setFrequency( uint frequency, const int reason = TuneReason::Unspecified ); |
24 | 85 |
|
86 |
/*! |
|
87 |
* Audio update command functions for the engine |
|
88 |
*/ |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
89 |
void increaseVolume(); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
90 |
void decreaseVolume(); |
24 | 91 |
void setVolume( int volume ); |
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
92 |
void setMute( bool muted, bool updateSettings = true ); |
24 | 93 |
void toggleAudioRoute(); |
94 |
||
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
95 |
void startSeeking( Seek::Direction direction, const int reason = TuneReason::Unspecified ); |
24 | 96 |
void cancelSeeking(); |
97 |
||
98 |
private: // data |
|
99 |
||
100 |
/** |
|
101 |
* Unmodifiable pointer to the private implementation |
|
102 |
*/ |
|
34 | 103 |
const QScopedPointer<RadioEngineWrapperPrivate> d_ptr; |
24 | 104 |
|
105 |
}; |
|
106 |
||
107 |
#endif // RADIOENGINEWRAPPER_H |