19 #define _RADIOWINDOW_H_ |
19 #define _RADIOWINDOW_H_ |
20 |
20 |
21 // System includes |
21 // System includes |
22 #include <HbMainWindow> |
22 #include <HbMainWindow> |
23 #include <HbEffect> |
23 #include <HbEffect> |
24 #include <QPointer> |
24 #include <QWeakPointer> |
25 #include <QScopedPointer> |
25 #include <QScopedPointer> |
|
26 #include <QSharedPointer> |
|
27 #include <qsysteminfo.h> |
|
28 using namespace QtMobility; // has to be here to be able to connect SLOT queryOfflineUsage |
26 |
29 |
27 // User includes |
30 // User includes |
28 #include "radiowidgetsexport.h" |
31 #include "radiowidgetsexport.h" |
29 |
32 |
30 // Forward declarations |
33 // Forward declarations |
31 class RadioViewBase; |
34 class RadioViewBase; |
32 class RadioUiEngine; |
35 class RadioUiEngine; |
33 class HbVolumeSliderPopup; |
36 class HbVolumeSliderPopup; |
|
37 class HbMessageBox; |
34 |
38 |
35 typedef QScopedPointer<HbVolumeSliderPopup> VolumeSliderPtr; |
39 typedef QScopedPointer<HbVolumeSliderPopup> VolumeSliderPtr; |
36 |
40 |
37 /** |
41 /** |
38 * QPointer is used to store the views because it tracks the deletion of the object and nulls |
42 * QWeakPointer is used to store the views because it tracks the deletion of the object and nulls |
39 * the reference. Transient view like RadioHistoryView is destroyed after they are closed |
43 * the reference. Transient view like RadioHistoryView is destroyed after they are closed |
40 * and QPointer will notice it. |
44 * and QWeakPointer will notice it. |
41 */ |
45 */ |
42 typedef QPointer<RadioViewBase> ViewPtr; |
46 typedef QWeakPointer<RadioViewBase> ViewPtr; |
43 |
47 |
44 // Class declaration |
48 // Class declaration |
45 class WIDGETS_DLL_EXPORT RadioWindow : public HbMainWindow |
49 class WIDGETS_DLL_EXPORT RadioWindow : public HbMainWindow |
46 { |
50 { |
47 Q_OBJECT |
51 Q_OBJECT |
48 Q_DISABLE_COPY( RadioWindow ) |
52 Q_DISABLE_COPY( RadioWindow ) |
49 |
53 |
50 public: |
54 public: |
51 |
55 |
52 RadioWindow( QWidget *parent = 0 ); |
56 RadioWindow( QWidget* parent = 0 ); |
53 |
57 |
54 ~RadioWindow(); |
58 ~RadioWindow(); |
55 |
59 |
56 void showErrorMessage( const QString& text ); |
60 void showErrorMessage( const QString& text ); |
57 |
61 |
58 void init(); |
62 void init( QSystemDeviceInfo* deviceInfo ); |
59 |
|
60 RadioUiEngine& uiEngine(); |
|
61 |
63 |
62 QString orientationSection(); |
64 QString orientationSection(); |
63 |
65 |
64 public slots: |
66 public slots: |
65 |
67 |
73 |
75 |
74 void initView(); |
76 void initView(); |
75 void updateOrientation( Qt::Orientation orientation ); |
77 void updateOrientation( Qt::Orientation orientation ); |
76 void showVolumeLevel( int volume ); |
78 void showVolumeLevel( int volume ); |
77 void updateAntennaStatus( bool connected ); |
79 void updateAntennaStatus( bool connected ); |
|
80 void queryOfflineUsage( QSystemDeviceInfo::Profile profile ); |
78 |
81 |
79 private: |
82 private: |
80 |
83 |
81 // New functions |
84 // New functions |
82 |
85 |
83 void activateView( ViewPtr& aMember, const QString& docmlFile, Hb::ViewSwitchFlags flags = Hb::ViewSwitchDefault ); |
86 void activateView( RadioViewBase* aMember, const QString& docmlFile, Hb::ViewSwitchFlags flags = Hb::ViewSwitchDefault ); |
84 |
87 |
85 private: // data |
88 private: // data |
86 |
89 |
87 /*! |
90 /*! |
88 * Pointer to the UI engine |
91 * Pointer to the UI engine |
89 * Own |
92 * Own, shared with views |
90 */ |
93 */ |
91 QScopedPointer<RadioUiEngine> mUiEngine; |
94 QSharedPointer<RadioUiEngine> mUiEngine; |
92 |
95 |
93 /** |
96 /** |
94 * Tuning view. |
97 * Tuning view. |
95 * Own. |
98 * Own. |
96 */ |
99 */ |
97 ViewPtr mMainView; |
100 ViewPtr mMainView; |
98 |
101 |
99 /** |
102 /** |
100 * Stations view |
103 * Stations view |
101 * Own. |
104 * Own. |
102 */ |
105 */ |
103 ViewPtr mStationsView; |
106 ViewPtr mStationsView; |
104 |
107 |
105 /** |
108 /** |
106 * Play history view |
109 * Play history view |
107 * Own. |
110 * Own. |
108 */ |
111 */ |
109 ViewPtr mHistoryView; |
112 ViewPtr mHistoryView; |
110 |
113 |
111 /** |
114 /** |
112 * Pointer to the volume slider |
115 * Pointer to the volume slider |
113 * Own. |
116 * Own. |
114 */ |
117 */ |
115 VolumeSliderPtr mVolSlider; |
118 VolumeSliderPtr mVolSlider; |
|
119 |
|
120 /** |
|
121 * Pointer to messagebox |
|
122 * Own. |
|
123 */ |
|
124 QScopedPointer<HbMessageBox> mMessageBox; |
|
125 |
|
126 /** |
|
127 * Pointer to qsystemdeviceinfo |
|
128 * Own. |
|
129 */ |
|
130 QScopedPointer<QSystemDeviceInfo> mDeviceInfo; |
116 |
131 |
117 }; |
132 }; |
118 |
133 |
119 |
134 |
120 #endif // _RADIOWINDOW_H_ |
135 #endif // _RADIOWINDOW_H_ |