|
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 RADIOSCANNERENGINE_H |
|
19 #define RADIOSCANNERENGINE_H |
|
20 |
|
21 // System includes |
|
22 #include <QObject> |
|
23 #include <QScopedPointer> |
|
24 #include <QMap> |
|
25 |
|
26 // User includes |
|
27 #include "radiouiengineexport.h" |
|
28 |
|
29 // Forward declarations |
|
30 class RadioScannerEnginePrivate; |
|
31 class RadioUiEnginePrivate; |
|
32 class RadioStationHandlerIf; |
|
33 class RadioStation; |
|
34 |
|
35 // Constants |
|
36 |
|
37 // Class declaration |
|
38 class UI_ENGINE_DLL_EXPORT RadioScannerEngine : public QObject |
|
39 { |
|
40 Q_OBJECT |
|
41 Q_DECLARE_PRIVATE_D( d_ptr.data(), RadioScannerEngine ) |
|
42 Q_DISABLE_COPY( RadioScannerEngine ) |
|
43 |
|
44 friend class RadioUiEngine; |
|
45 |
|
46 public: |
|
47 |
|
48 explicit RadioScannerEngine( RadioUiEnginePrivate& uiEngine ); |
|
49 ~RadioScannerEngine(); |
|
50 |
|
51 // New functions |
|
52 |
|
53 /*! |
|
54 * Starts the scanning from minimum frequency |
|
55 */ |
|
56 void startScanning(); |
|
57 |
|
58 /*! |
|
59 * Continues the scanning upwards from current frequency |
|
60 */ |
|
61 void continueScanning(); |
|
62 |
|
63 /*! |
|
64 * Checks if the scanning is ongoing |
|
65 */ |
|
66 bool isScanning() const; |
|
67 |
|
68 /*! |
|
69 * Cancels the scanning process |
|
70 */ |
|
71 void cancel(); |
|
72 |
|
73 /*! |
|
74 * Adds a new station that was found |
|
75 * @param frequency Frequency of the found station |
|
76 */ |
|
77 void addScannedFrequency( const uint frequency ); |
|
78 |
|
79 signals: |
|
80 |
|
81 void stationFound( const RadioStation& station ); |
|
82 |
|
83 private: |
|
84 |
|
85 void emitStationFound( const RadioStation& station ); |
|
86 |
|
87 private: // data |
|
88 |
|
89 /** |
|
90 * Unmodifiable pointer to the private implementation |
|
91 */ |
|
92 const QScopedPointer<RadioScannerEnginePrivate> d_ptr; |
|
93 |
|
94 }; |
|
95 |
|
96 #endif // RADIOSCANNERENGINE_H |