13 * |
13 * |
14 * Description: Implementation of VideoServiceUriFetch |
14 * Description: Implementation of VideoServiceUriFetch |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 // Version : %version: 3 % |
18 // Version : %version: 4 % |
19 |
19 |
20 #include <hbapplication.h> |
20 #include <hbapplication.h> |
21 |
21 |
22 #include "videoservices.h" |
22 #include "videoservices.h" |
23 #include "videoservicebrowse.h" |
23 #include "videoservicebrowse.h" |
24 #include "mpxhbvideocommondefs.h" |
24 #include "mpxhbvideocommondefs.h" |
25 #include "mpxvideo_debug.h" |
25 #include "mpxvideo_debug.h" |
|
26 #include <xqaiwdecl.h> |
26 |
27 |
27 // ------------------------------------------------------------------------------------------------- |
28 // ------------------------------------------------------------------------------------------------- |
28 // VideoServiceBrowse() |
29 // VideoServiceBrowse() |
29 // ------------------------------------------------------------------------------------------------- |
30 // ------------------------------------------------------------------------------------------------- |
30 // |
31 // |
31 VideoServiceBrowse::VideoServiceBrowse( VideoServices* parent ) |
32 VideoServiceBrowse::VideoServiceBrowse(VideoServices* parent, QLatin1String service) |
32 : XQServiceProvider( QLatin1String("com.nokia.Videos.IVideoBrowse"), parent ) |
33 : XQServiceProvider( service, parent ) |
33 , mRequestIndex( 0 ) |
34 , mRequestIndex( 0 ) |
34 , mServiceApp( parent ) |
35 , mServiceApp( parent ) |
35 , mCategory( 0 ) |
36 , mCategory( 0 ) |
36 , mTitle( "" ) |
37 , mTitle( "" ) |
37 , mSortRole( 0 ) |
38 , mSortRole( 0 ) |
126 |
127 |
127 mTitle = appTitle; |
128 mTitle = appTitle; |
128 mCategory = category; |
129 mCategory = category; |
129 mSortRole = sortRole; |
130 mSortRole = sortRole; |
130 |
131 |
|
132 // store async request id |
|
133 mRequestIndex = setCurrentRequestAsync(); |
|
134 |
131 // start service |
135 // start service |
132 mServiceApp->setCurrentService(VideoServices::EBrowse); |
136 mServiceApp->setCurrentService(VideoServices::EBrowse); |
133 emit mServiceApp->titleReady(appTitle); |
137 emit mServiceApp->titleReady(appTitle); |
134 emit mServiceApp->activated(MpxHbVideoCommon::ActivateCollectionView); |
138 emit mServiceApp->activated(MpxHbVideoCommon::ActivateCollectionView); |
135 |
139 |
136 // store async request id |
|
137 mRequestIndex = setCurrentRequestAsync(); |
|
138 MPX_DEBUG(_L("VideoServiceBrowse::browseVideos() : mRequestIndex = %d"), mRequestIndex ); |
140 MPX_DEBUG(_L("VideoServiceBrowse::browseVideos() : mRequestIndex = %d"), mRequestIndex ); |
139 } |
141 } |
140 |
142 |
|
143 // ---------------------------------------------------------------------------- |
|
144 // isActive() |
|
145 // ---------------------------------------------------------------------------- |
|
146 // |
|
147 bool VideoServiceBrowse::isActive() |
|
148 { |
|
149 MPX_DEBUG(_L("VideoServiceBrowse::isActive() ret %d"), mRequestIndex ); |
|
150 |
|
151 return (mRequestIndex > 0); |
|
152 } |
|
153 |
|
154 // ------------------------------------------------------------------------------------------------- |
|
155 // browseVideos() |
|
156 // ------------------------------------------------------------------------------------------------- |
|
157 // |
|
158 void VideoServiceBrowse::browseVideos(int category, int sortRole) |
|
159 { |
|
160 MPX_ENTER_EXIT(_L("VideoServiceBrowse::browseVideos()")); |
|
161 |
|
162 // set application title |
|
163 XQRequestInfo info = requestInfo(); |
|
164 |
|
165 QVariant variant = info.info("WindowTitle"); |
|
166 |
|
167 QString appTitle; |
|
168 |
|
169 if(variant.isValid()) |
|
170 { |
|
171 appTitle = variant.toString(); |
|
172 } |
|
173 |
|
174 if (appTitle.isEmpty()) |
|
175 { |
|
176 appTitle = hbTrId("txt_videos_title_videos"); |
|
177 } |
|
178 |
|
179 mTitle = appTitle; |
|
180 mCategory = category; |
|
181 mSortRole = sortRole; |
|
182 |
|
183 // store async request id |
|
184 mRequestIndex = setCurrentRequestAsync(); |
|
185 |
|
186 // start service |
|
187 mServiceApp->setCurrentService(VideoServices::EBrowse); |
|
188 emit mServiceApp->titleReady(appTitle); |
|
189 emit mServiceApp->activated(MpxHbVideoCommon::ActivateCollectionView); |
|
190 |
|
191 MPX_DEBUG(_L("VideoServiceBrowse::browseVideos() : mRequestIndex = %d"), mRequestIndex ); |
|
192 } |
|
193 |
|
194 |
141 // End of file |
195 // End of file |