20 |
20 |
21 #include <hbmainwindow.h> |
21 #include <hbmainwindow.h> |
22 #include <xqserviceprovider.h> |
22 #include <xqserviceprovider.h> |
23 #include <QStringList> |
23 #include <QStringList> |
24 #include <xqsharablefile.h> |
24 #include <xqsharablefile.h> |
|
25 #include <QModelIndex> |
|
26 #include <QAbstractItemModel> |
25 |
27 |
26 //FORWARD CLASS DECLARATION |
28 //FORWARD CLASS DECLARATION |
27 class GlxView; |
|
28 class HbPushButton; |
|
29 class HbMenu; |
|
30 class QGraphicsGridLayout; |
|
31 class GlxGetImageService; |
29 class GlxGetImageService; |
32 class GlxMediaModel; |
|
33 class QModelIndex; |
|
34 class GlxImageViewerService; |
30 class GlxImageViewerService; |
35 class GlxStateManager; |
31 class GlxStateManager; |
36 class CGlxImageViewerManager; |
32 class CGlxImageViewerManager; |
37 class GlxGetImageServiceNSDI; |
33 class GlxGetImageServiceNSDI; |
38 class GlxGetImageServiceDSDI; |
34 class GlxGetImageServiceDSDI; |
39 |
35 |
40 /** |
36 class GlxExternalUtility; |
41 * GlxAiwServiceHandler |
37 /** |
|
38 * This is qthigway service handler class for all services provide by photos. |
42 * |
39 * |
43 */ |
40 */ |
44 class GlxAiwServiceHandler: public HbMainWindow |
41 class GlxAiwServiceHandler: public HbMainWindow |
45 { |
42 { |
46 Q_OBJECT |
43 Q_OBJECT |
52 |
49 |
53 /** |
50 /** |
54 * Destructor. |
51 * Destructor. |
55 */ |
52 */ |
56 ~GlxAiwServiceHandler(); |
53 ~GlxAiwServiceHandler(); |
|
54 |
|
55 /** |
|
56 * launch image fetcher view |
|
57 * @param viewTitle title for image fetcher |
|
58 */ |
57 void launchFetcher(QString viewTitle); |
59 void launchFetcher(QString viewTitle); |
58 void launchImageViewer(); |
60 |
|
61 /** |
|
62 * launch image viewer |
|
63 * @param viewTitle title for image fetcher |
|
64 */ |
|
65 void launchImageViewer(QString viewTitle); |
|
66 |
59 public slots: |
67 public slots: |
60 void itemSelected(const QModelIndex & index); |
68 /** |
|
69 * This slot is called when image to be returned to fetcher |
|
70 * client is selected |
|
71 * @param index index of the selected image |
|
72 * @param model model for the current view where image is selected |
|
73 */ |
|
74 void itemSelected(const QModelIndex & index,QAbstractItemModel & model); |
|
75 |
|
76 /** |
|
77 * This slot is called when service client is closed |
|
78 * |
|
79 */ |
61 void handleClientDisconnect(); |
80 void handleClientDisconnect(); |
62 void itemSpecificMenuTriggered(qint32,QPointF ); |
81 |
63 void openFSView(); |
82 private: |
64 void handleFSSelect(); |
83 /// state manager for the services |
65 void closeContextMenu(); |
|
66 |
|
67 private: |
|
68 GlxMediaModel *mModel; |
|
69 GlxView* mView; |
|
70 GlxStateManager *mStateMgr; |
84 GlxStateManager *mStateMgr; |
71 GlxView* mFSView; |
85 /// image fetcher service provider |
72 HbMenu *mFetcherContextMenu; |
|
73 |
|
74 GlxGetImageService* mFetcherService; |
86 GlxGetImageService* mFetcherService; |
|
87 /// image fetcher service provider with new service name and depricated interface name |
75 GlxGetImageServiceNSDI* mNSDIService; |
88 GlxGetImageServiceNSDI* mNSDIService; |
|
89 /// image fetcher service provider with depricated name and depricated inaterface name |
76 GlxGetImageServiceDSDI* mDSDIService; |
90 GlxGetImageServiceDSDI* mDSDIService; |
77 GlxImageViewerService* mImageViewerService; |
91 GlxImageViewerService* mImageViewerService; |
|
92 GlxExternalUtility *mUtil; |
78 }; |
93 }; |
79 |
94 |
80 /** |
95 /** |
81 * GlxGetImageService |
96 * GlxGetImageService : Image fetcher service provider |
82 * |
97 * |
83 */ |
98 */ |
84 class GlxGetImageService : public XQServiceProvider |
99 class GlxGetImageService : public XQServiceProvider |
85 { |
100 { |
86 Q_OBJECT |
101 Q_OBJECT |
87 public: |
102 public: |
|
103 /** |
|
104 * Constructor |
|
105 */ |
88 GlxGetImageService( GlxAiwServiceHandler *parent = 0 ); |
106 GlxGetImageService( GlxAiwServiceHandler *parent = 0 ); |
|
107 |
|
108 /** |
|
109 * Destructor. |
|
110 */ |
89 ~GlxGetImageService(); |
111 ~GlxGetImageService(); |
|
112 |
|
113 /** |
|
114 * check if service is active |
|
115 */ |
90 bool isActive(); |
116 bool isActive(); |
|
117 |
|
118 /** |
|
119 * called to complete fetch service and return to client |
|
120 * @param fileList list of Uri to be returned to client |
|
121 */ |
91 void complete( QStringList filesList); |
122 void complete( QStringList filesList); |
92 |
123 |
93 public slots://for QTHighway to notify provider about request |
124 public slots: |
|
125 /** |
|
126 * slot for qthighway to notify provider about request |
|
127 */ |
94 void fetch(); |
128 void fetch(); |
95 |
129 |
96 public slots://for provider to notify client |
130 /** |
|
131 * slot for service provider to notify client about error |
|
132 */ |
97 void fetchFailed( int errorCode ); |
133 void fetchFailed( int errorCode ); |
98 |
134 |
99 private: |
135 private: |
|
136 /** |
|
137 * called to complete qthighway service |
|
138 * @param fileList list of Uri to be returned to client |
|
139 */ |
100 void doComplete( QStringList filesList); |
140 void doComplete( QStringList filesList); |
101 |
141 |
102 private: |
142 private: |
|
143 /// current service request id |
103 int mImageRequestIndex; |
144 int mImageRequestIndex; |
|
145 /// service handler for all photos services |
104 GlxAiwServiceHandler* mServiceApp; |
146 GlxAiwServiceHandler* mServiceApp; |
105 }; |
147 }; |
106 |
148 |
107 /** |
149 /** |
|
150 * Class Description |
108 * GlxGetImageServiceDSDI |
151 * GlxGetImageServiceDSDI |
109 * Service provide for new service and depricated interface |
152 * Service provide for new service and depricated interface |
110 */ |
153 */ |
111 class GlxGetImageServiceNSDI : public XQServiceProvider |
154 class GlxGetImageServiceNSDI : public XQServiceProvider |
112 { |
155 { |
113 Q_OBJECT |
156 Q_OBJECT |
114 public: |
157 public: |
|
158 /** |
|
159 * Constructor |
|
160 */ |
115 GlxGetImageServiceNSDI( GlxAiwServiceHandler *parent = 0 ); |
161 GlxGetImageServiceNSDI( GlxAiwServiceHandler *parent = 0 ); |
|
162 /** |
|
163 * Destructor. |
|
164 */ |
116 ~GlxGetImageServiceNSDI(); |
165 ~GlxGetImageServiceNSDI(); |
|
166 |
|
167 /** |
|
168 * check if service is active |
|
169 */ |
117 bool isActive(); |
170 bool isActive(); |
|
171 |
|
172 /** |
|
173 * called to complete fetch service and return to client |
|
174 * @param fileList list of Uri to be returned to client |
|
175 */ |
118 void complete( QStringList filesList); |
176 void complete( QStringList filesList); |
119 |
177 |
120 public slots://for QTHighway to notify provider about request |
178 public slots: |
|
179 /** |
|
180 * slot for qthighway to notify provider about request |
|
181 */ |
121 void fetch( QVariantMap filter , QVariant flag ); |
182 void fetch( QVariantMap filter , QVariant flag ); |
|
183 |
|
184 /** |
|
185 * slot for qthighway to notify provider about request |
|
186 */ |
122 void fetch(); |
187 void fetch(); |
123 |
188 |
124 public slots://for provider to notify client |
189 public slots: |
|
190 /** |
|
191 * slot for service provider to notify client about error |
|
192 */ |
125 void fetchFailed( int errorCode ); |
193 void fetchFailed( int errorCode ); |
126 |
194 |
127 private: |
195 private: |
|
196 /** |
|
197 * called to complete fetch service and return to client |
|
198 * @param fileList list of Uri to be returned to client |
|
199 */ |
128 void doComplete( QStringList filesList); |
200 void doComplete( QStringList filesList); |
129 |
201 |
130 private: |
202 private: |
|
203 /// current service request id |
131 int mImageRequestIndex; |
204 int mImageRequestIndex; |
|
205 /// service handler for all photos services |
132 GlxAiwServiceHandler* mServiceApp; |
206 GlxAiwServiceHandler* mServiceApp; |
133 }; |
207 }; |
134 |
208 |
135 /** |
209 /** |
136 * GlxGetImageServiceDSDI |
210 * GlxGetImageServiceDSDI |
138 */ |
212 */ |
139 class GlxGetImageServiceDSDI : public XQServiceProvider |
213 class GlxGetImageServiceDSDI : public XQServiceProvider |
140 { |
214 { |
141 Q_OBJECT |
215 Q_OBJECT |
142 public: |
216 public: |
|
217 /** |
|
218 * Constructor |
|
219 */ |
143 GlxGetImageServiceDSDI( GlxAiwServiceHandler *parent = 0 ); |
220 GlxGetImageServiceDSDI( GlxAiwServiceHandler *parent = 0 ); |
|
221 /** |
|
222 * Destructor. |
|
223 */ |
144 ~GlxGetImageServiceDSDI(); |
224 ~GlxGetImageServiceDSDI(); |
|
225 |
|
226 /** |
|
227 * check if service is active |
|
228 */ |
145 bool isActive(); |
229 bool isActive(); |
|
230 |
|
231 /** |
|
232 * called to complete fetch service and return to client |
|
233 * @param fileList list of Uri to be returned to client |
|
234 */ |
146 void complete( QStringList filesList); |
235 void complete( QStringList filesList); |
147 |
236 |
148 public slots://for QTHighway to notify provider about request |
237 public slots: |
|
238 /** |
|
239 * slot for qthighway to notify provider about request |
|
240 */ |
149 void fetch( QVariantMap filter, QVariant flag); |
241 void fetch( QVariantMap filter, QVariant flag); |
150 |
242 |
151 public slots://for provider to notify client |
243 public slots: |
|
244 /** |
|
245 * slot for service provider to notify client about error |
|
246 */ |
152 void fetchFailed( int errorCode ); |
247 void fetchFailed( int errorCode ); |
153 |
248 |
154 private: |
249 private: |
|
250 /** |
|
251 * called to complete fetch service and return to client |
|
252 * @param fileList list of Uri to be returned to client |
|
253 */ |
155 void doComplete( QStringList filesList); |
254 void doComplete( QStringList filesList); |
156 |
255 |
157 private: |
256 private: |
|
257 /// current service request id |
158 int mImageRequestIndex; |
258 int mImageRequestIndex; |
|
259 /// service handler for all photos services |
159 GlxAiwServiceHandler* mServiceApp; |
260 GlxAiwServiceHandler* mServiceApp; |
160 }; |
261 }; |
161 |
262 |
162 |
263 /** |
|
264 * Image viewer service provider |
|
265 */ |
163 class GlxImageViewerService : public XQServiceProvider |
266 class GlxImageViewerService : public XQServiceProvider |
164 { |
267 { |
165 Q_OBJECT |
268 Q_OBJECT |
166 public: |
269 public: |
167 GlxImageViewerService( GlxAiwServiceHandler *parent = 0 ); |
270 /** |
168 ~GlxImageViewerService(); |
271 * Constructor |
169 void complete(bool ok); |
272 */ |
170 |
273 GlxImageViewerService( GlxAiwServiceHandler *parent = 0 ); |
171 public slots: |
274 |
172 bool view(QString file); |
275 /** |
173 bool view(XQSharableFile file); |
276 * Destructor. |
174 bool asyncRequest() {return mAsyncRequest;} |
277 */ |
175 |
278 ~GlxImageViewerService(); |
176 private: |
279 |
177 GlxAiwServiceHandler* mServiceApp; |
280 /** |
178 int mAsyncReqId; |
281 * compete request |
179 bool mRetValue; |
282 * @param ok true id success else false |
180 bool mAsyncRequest; |
283 */ |
181 CGlxImageViewerManager* mImageViewerInstance; |
284 void complete(bool ok); |
|
285 |
|
286 /** |
|
287 * check if request is aSync |
|
288 * @return true if async else false |
|
289 */ |
|
290 bool asyncRequest() {return mAsyncRequest;} |
|
291 |
|
292 public slots: |
|
293 /** |
|
294 * slot for qthighway to notify provider about request |
|
295 */ |
|
296 bool view(QString file); |
|
297 |
|
298 /** |
|
299 * slot for qthighway to notify provider about request |
|
300 */ |
|
301 bool view(XQSharableFile file); |
|
302 |
|
303 private: |
|
304 /// service handler for all photos services |
|
305 GlxAiwServiceHandler* mServiceApp; |
|
306 /// current request id |
|
307 int mAsyncReqId; |
|
308 bool mRetValue; |
|
309 bool mAsyncRequest; |
|
310 /// image viewer manager instance to get info regarding file |
|
311 CGlxImageViewerManager* mImageViewerInstance; |
182 }; |
312 }; |
183 |
313 |
184 |
314 |
185 #endif //GLXFETCHER_H |
315 #endif //GLXFETCHER_H |