43 public: |
39 public: |
44 ~IRNowPlayingView(); |
40 ~IRNowPlayingView(); |
45 |
41 |
46 protected: |
42 protected: |
47 IRNowPlayingView(IRApplication* aApplication, TIRViewId aViewId); |
43 IRNowPlayingView(IRApplication* aApplication, TIRViewId aViewId); |
48 //from base class IRBaseView |
|
49 TIRHandleResult handleSystemEvent(TIRSystemEventType aEvent); |
|
50 |
44 |
51 //from base class IRBaseView |
45 //from base class IRBaseView |
|
46 void launchAction(); |
52 TIRHandleResult handleCommand(TIRViewCommand aCommand, TIRViewCommandReason aReason); |
47 TIRHandleResult handleCommand(TIRViewCommand aCommand, TIRViewCommandReason aReason); |
53 |
48 |
54 //from base class IRBaseView |
|
55 void launchAction(); |
|
56 |
|
57 |
|
58 |
49 |
59 private slots: |
50 private slots: |
60 void presetLogoDownload(IRQPreset* aPreset); |
51 // slots for logo download |
61 void playStopControl(); |
52 void handleLogoDownloaded(IRQPreset* aPreset); |
62 void stop(); |
53 |
63 void playingStarted(); |
54 // slots for network event |
64 void playingStopped(); |
55 void handleNetworkEvent(IRQNetworkEvent aEvent); |
65 void add2FavControl(); |
56 |
66 void flipControl(); |
57 // slots for orientation change |
67 void hidePlayingWidgetComplete(HbEffect::EffectStatus status); |
58 void handleOrientationChanged(Qt::Orientation); |
68 void hideDetailsWidgetComplete(HbEffect::EffectStatus status); |
59 |
69 void stereoControl(); |
60 // slots for play controller |
70 void openWebAddressControl(); |
61 void handlePlayStarted(); |
71 void launchSettingsView(); |
62 void handlePlayStopped(); |
72 void updateSongInfo(IRQMetaData*); |
63 void updateMetaData(IRQMetaData* aMetaData); |
73 void updateLogoInfo(); |
64 |
74 void initializeLogo(); |
65 // slots for media key |
75 void networkRequestNotified(IRQNetworkEvent aEvent); |
66 void handlePlayPauseMediaKey(); |
76 void findInMusicShop(); |
67 void handleStopMediaKey(); |
77 void helpAction(); |
68 |
78 void playPressed(); |
69 // slots for toolbar action |
79 void gotoMusicStore(); |
70 void handleMusicStoreAction(); |
80 void recognizeSong(); |
71 void handleIdentifySongAction(); |
|
72 void handlePlayStopAction(); |
|
73 void handleAddToFavAction(); |
|
74 void handleDetailInfoAction(); |
|
75 |
|
76 // slots for menu action |
|
77 void handleGoToStationAction(); |
|
78 void handleShareStationAction(); |
|
79 void handleSettingAction(); |
|
80 |
|
81 #ifdef ADV_ENABLED |
|
82 // since this maybe called during handleLogoDownloaded(), |
|
83 // so make it as slot connected to a single timer. |
|
84 void updateAdvImage(); |
|
85 #endif |
|
86 |
|
87 private: |
|
88 void initialize(); |
|
89 void initMenu(); |
|
90 void initToolBar(); |
|
91 void initWidget(); |
|
92 |
|
93 void updateWidgets(); |
|
94 void updateMusicStoreStatus(); |
|
95 void updateForLauchAction(); |
|
96 |
|
97 void updateStationLogo(); |
|
98 |
|
99 void lazyInit(); |
|
100 void normalInit(); |
|
101 |
|
102 #ifdef ADV_ENABLED |
|
103 void mousePressEvent(QGraphicsSceneMouseEvent *aEvent); |
81 void openAdvLink(); |
104 void openAdvLink(); |
82 void shareStationViaMms(); |
105 #endif |
83 void prepareMenu(); |
106 |
84 |
|
85 private: |
107 private: |
86 void createMenu(); |
|
87 void createToolBar(); |
|
88 void updateStationInfo(); |
|
89 void updateAdvImage(); |
|
90 void showWidget(); |
|
91 void initialize(); |
|
92 void updateMusicStatus(); |
|
93 |
|
94 private: |
|
95 // preset to save station big logo |
|
96 IRQPreset *iLogoPreset; |
|
97 IRNowPlayingContainer *iNowPlayingContainer; |
|
98 IRStationDetailsContainer *iStationDetailsContainer; |
|
99 // save the pointer of idle container |
|
100 QGraphicsWidget *iIdleContainer; |
|
101 IRQMusicShop *iMusicShop; |
|
102 IRQStatisticsReporter *iStatisticsReporter; |
108 IRQStatisticsReporter *iStatisticsReporter; |
103 IRQStationExporter *iStationExporter; |
109 IRQNetworkController *iNetworkController; |
104 |
|
105 // menu bar actions |
|
106 HbAction *iStereoAction; |
|
107 |
110 |
108 // tool bar actions |
111 // tool bar actions |
109 HbAction *iMusicShopAction; |
|
110 HbAction *iPlayStopAction; |
112 HbAction *iPlayStopAction; |
111 HbAction *iAdd2FavAction; |
113 |
112 HbAction *iFlipAction; |
114 bool iLaunchActionNeeded; |
113 |
115 |
114 QString iAdvImageUrl; |
116 enum LogoDownloadState |
115 QString iTempAdvClickThroughUrl; |
|
116 QString iAdvClickThroughUrl; |
|
117 bool iGettingAdv; |
|
118 HbIcon *iStationLogo; |
|
119 |
|
120 int iStereoMode; |
|
121 bool iShowStationInfo; |
|
122 |
|
123 enum LogoState |
|
124 { |
117 { |
125 EDefaultLogo = 0, // Use default logo |
118 EIdle = 0, |
126 ERequestIssued = 1, // Issue request to get logo from server |
119 #ifdef ADV_ENABLED |
127 ELogoDetermined = 2, // Logo got from server or user defined |
120 EDownLoadAdvImage = 1, |
128 // stations with default logo |
121 #endif |
|
122 EDownloadLogo = 2 |
129 }; |
123 }; |
130 LogoState iLogoStatus; |
124 LogoDownloadState iLogoDownloadState; |
131 |
125 |
|
126 HbLabel *iSongName; |
|
127 HbLabel *iArtistName; |
|
128 HbLabel *iStationName; |
|
129 HbLabel *iStationLogo; |
|
130 bool iLogoNeedUpdate; |
|
131 |
132 bool iFindinNmsAllowed; |
132 bool iFindinNmsAllowed; |
133 |
|
134 bool iSongNameAvailable; |
133 bool iSongNameAvailable; |
135 |
134 |
|
135 #ifdef ADV_ENABLED |
|
136 HbLabel *iAdvImage; |
|
137 bool iAdvImageNeedUpdate; |
|
138 QString iAdvUrl; |
|
139 #endif |
136 friend class IRViewManager; |
140 friend class IRViewManager; |
137 }; |
141 }; |
138 |
142 |
139 #endif //IRNOWPLAYINGVIEW_H |
143 #endif //IRNOWPLAYINGVIEW_H |