author | hgs |
Thu, 14 Oct 2010 17:54:23 +0530 | |
changeset 72 | 0a8e959402e5 |
parent 71 | 27f2d7aec52a |
permissions | -rw-r--r-- |
26
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
14 |
* Description: ?Description |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
15 |
* |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
|
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
#include <hbapplication.h> |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
19 |
#include <hbview.h> |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
20 |
#include <hbmenu.h> |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
21 |
#include <hbaction.h> |
45 | 22 |
#include <hbnotificationdialog.h> |
26
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
23 |
|
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
24 |
#include <QtDebug> |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
25 |
#include <Qt> |
41 | 26 |
#include <QDir> |
27 |
#include <QStringList> |
|
26
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
28 |
|
54 | 29 |
#include <xqserviceutil.h> |
30 |
#include <xqaiwdeclplat.h> |
|
31 |
#include <xqappmgr.h> |
|
65 | 32 |
#include <xqaiwdecl.h> |
54 | 33 |
|
34 |
#include <glxmodelroles.h> |
|
26
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
35 |
#include <glxaiwservicehandler.h> |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
36 |
#include <glxstatemanager.h> |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
37 |
#include <glximageviewermanager.h> |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
38 |
#include <glxexternalutility.h> |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
39 |
#include "glxlocalisationstrings.h" |
41 | 40 |
|
41 |
#define IMAGE_FETCHER_SERVICE_NAME QLatin1String("photos.com.nokia.symbian.IImageFetch") |
|
42 |
#define IMAGE_FETCHER_SERVICE_DEPINTERFACE_NAME QLatin1String("photos.Image") |
|
43 |
#define IMAGE_FETCHER_DEPSERVICE_DEPINTERFACE_NAME QLatin1String("com.nokia.services.media.Image") |
|
44 |
#define FILE_VIEWER_SERVICE_NAME QLatin1String("photos.com.nokia.symbian.IFileView") |
|
71 | 45 |
#define FILE_BROWSER_SERVICE_NAME QLatin1String("photos.com.nokia.symbian.IImageBrowse") |
65 | 46 |
#define XQINFO_KEY_FILTER_TYPE QLatin1String("GlxFetcherFilter") |
26
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
47 |
|
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
48 |
// ---------------------------------------------------------------------------- |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
49 |
// GlxAiwServiceHandler() |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
50 |
// ---------------------------------------------------------------------------- |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
51 |
// |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
52 |
GlxAiwServiceHandler::GlxAiwServiceHandler() : |
41 | 53 |
HbMainWindow(), |
54 |
mStateMgr(NULL), |
|
55 |
mFetcherService(NULL), |
|
56 |
mNSDIService(NULL), |
|
57 |
mDSDIService(NULL), |
|
71 | 58 |
mImageViewerService(NULL), |
59 |
mImageBrowserService(NULL) |
|
26
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
60 |
{ |
44 | 61 |
QString currentInterfaceName = XQServiceUtil::interfaceName(); |
62 |
if( 0 == currentInterfaceName.compare(QLatin1String("com.nokia.symbian.IImageFetch"))) |
|
63 |
{ |
|
64 |
mFetcherService = new GlxGetImageService(this); |
|
65 |
} |
|
66 |
else if( 0 == currentInterfaceName.compare(QLatin1String("Image"))) |
|
67 |
{ |
|
68 |
mNSDIService = new GlxGetImageServiceNSDI(this); |
|
69 |
mDSDIService = new GlxGetImageServiceDSDI(this); |
|
70 |
} |
|
71 |
else if( 0 == currentInterfaceName.compare(QLatin1String("com.nokia.symbian.IFileView"))) |
|
72 |
{ |
|
45 | 73 |
viewport()->setAttribute(Qt::WA_AcceptTouchEvents); |
74 |
viewport()->grabGesture(Qt::PinchGesture); |
|
44 | 75 |
mImageViewerService = new GlxImageViewerService(this); |
76 |
} |
|
71 | 77 |
else if( 0 == currentInterfaceName.compare(QLatin1String("com.nokia.symbian.IImageBrowse"))) |
78 |
{ |
|
79 |
mImageBrowserService = new GlxBrowseImageService(this); |
|
80 |
} |
|
26
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
81 |
|
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
82 |
#ifdef _DEBUG |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
83 |
QString t; |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
84 |
QStringList args = QApplication::arguments(); |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
85 |
foreach (QString arg, args) |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
86 |
{ |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
87 |
t += "GlxAiwServiceHandler::cmdline arg=" + arg + "\n"; |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
88 |
} |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
89 |
qDebug()<< t; |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
90 |
#endif |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
91 |
} |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
92 |
|
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
93 |
// ---------------------------------------------------------------------------- |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
94 |
// ~GlxAiwServiceHandler() |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
95 |
// ---------------------------------------------------------------------------- |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
96 |
// |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
97 |
GlxAiwServiceHandler::~GlxAiwServiceHandler() |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
98 |
{ |
41 | 99 |
delete mStateMgr; |
100 |
delete mFetcherService; |
|
101 |
delete mNSDIService; |
|
102 |
delete mDSDIService; |
|
103 |
delete mImageViewerService; |
|
71 | 104 |
delete mImageBrowserService; |
26
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
105 |
} |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
106 |
|
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
107 |
void GlxAiwServiceHandler::handleClientDisconnect() |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
108 |
{ |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
109 |
// Just quit application |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
110 |
qApp->quit(); |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
111 |
} |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
112 |
|
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
113 |
// ---------------------------------------------------------------------------- |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
114 |
// itemSelected() |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
115 |
// ---------------------------------------------------------------------------- |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
116 |
// |
54 | 117 |
void GlxAiwServiceHandler::itemSelected(const QModelIndex & index,QAbstractItemModel & model) |
26
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
118 |
{ |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
119 |
qDebug() << "GlxFetcher::itemSelected"; |
44 | 120 |
if (mFetcherService && mFetcherService->isActive()) |
26
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
121 |
{ |
41 | 122 |
qDebug() << "GlxFetcher::itemSelected mFetcherService->isActive()"; |
54 | 123 |
QVariant variant = model.data(index, GlxUriRole); |
26
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
124 |
if (variant.isValid()) |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
125 |
{ |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
126 |
QString itemPath = variant.value<QString> (); |
54 | 127 |
qDebug() << "GlxFetcher::itemSelected mFetcherService->isActive()::PATH = " << itemPath; |
41 | 128 |
QStringList list = (QStringList() << itemPath); |
129 |
mFetcherService->complete(list); |
|
130 |
} |
|
131 |
} |
|
132 |
||
44 | 133 |
else if (mNSDIService && mNSDIService->isActive()) |
41 | 134 |
{ |
135 |
qDebug() << "GlxFetcher::itemSelected mNSDIService->isActive()"; |
|
54 | 136 |
QVariant variant = model.data(index, GlxUriRole); |
41 | 137 |
if (variant.isValid()) |
138 |
{ |
|
139 |
QString itemPath = variant.value<QString> (); |
|
26
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
140 |
QStringList list = (QStringList() << itemPath); |
41 | 141 |
mNSDIService->complete(list); |
142 |
} |
|
143 |
} |
|
144 |
||
44 | 145 |
else if (mDSDIService && mDSDIService->isActive()) |
41 | 146 |
{ |
147 |
qDebug() << "GlxFetcher::itemSelected mDSDIService->isActive()"; |
|
54 | 148 |
QVariant variant = model.data(index, GlxUriRole); |
41 | 149 |
if (variant.isValid()) |
150 |
{ |
|
151 |
QString itemPath = variant.value<QString> (); |
|
152 |
QStringList list = (QStringList() << itemPath); |
|
153 |
mDSDIService->complete(list); |
|
26
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
154 |
} |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
155 |
} |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
156 |
} |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
157 |
|
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
158 |
|
65 | 159 |
void GlxAiwServiceHandler::launchFetcher(QString viewTitle,int fetcherFilterType) |
26
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
160 |
{ |
41 | 161 |
qDebug() << "GlxAiwServiceHandler::launchFetcher START"; |
44 | 162 |
qApp->setApplicationName(viewTitle); |
26
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
163 |
|
54 | 164 |
mUtil = GlxExternalUtility::instance(); |
165 |
mUtil->setMainWindow(this); |
|
26
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
166 |
|
54 | 167 |
mStateMgr = new GlxStateManager(); |
168 |
int err = connect(mStateMgr, SIGNAL(gridItemSelected(const QModelIndex &,QAbstractItemModel &)), this, |
|
169 |
SLOT( itemSelected(const QModelIndex &,QAbstractItemModel &))); |
|
170 |
qDebug() << "GlxAiwServiceHandler::launchFetcher err = "<< err; |
|
171 |
||
65 | 172 |
mStateMgr->launchFetcher(fetcherFilterType); |
54 | 173 |
return; |
26
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
174 |
} |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
175 |
|
54 | 176 |
void GlxAiwServiceHandler::launchImageViewer(QString viewTitle) |
26
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
177 |
{ |
54 | 178 |
qApp->setApplicationName(viewTitle); |
179 |
mUtil = GlxExternalUtility::instance(); |
|
180 |
mUtil->setMainWindow(this); |
|
26
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
181 |
|
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
182 |
mStateMgr = new GlxStateManager(); |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
183 |
mStateMgr->launchFromExternal(); |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
184 |
if (mImageViewerService && mImageViewerService->asyncRequest()) |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
185 |
{ |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
186 |
connect(mImageViewerService, SIGNAL(returnValueDelivered()), this, |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
187 |
SLOT(handleAnswerDelivered())); |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
188 |
mImageViewerService->complete(true); |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
189 |
} |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
190 |
return; |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
191 |
} |
71 | 192 |
|
193 |
void GlxAiwServiceHandler::launchImageBrowser(QString viewTitle) |
|
194 |
{ |
|
195 |
qApp->setApplicationName(viewTitle); |
|
196 |
mStateMgr = new GlxStateManager(); |
|
197 |
mStateMgr->launchFetcher(0); |
|
198 |
if (mImageBrowserService && mImageBrowserService->asyncRequest()) |
|
199 |
{ |
|
200 |
connect(mImageBrowserService, SIGNAL(returnValueDelivered()), this, |
|
201 |
SLOT(handleAnswerDelivered())); |
|
202 |
mImageBrowserService->complete(true); |
|
203 |
} |
|
204 |
return; |
|
205 |
} |
|
206 |
||
26
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
207 |
// ---------------------------------------------------------------------------- |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
208 |
// GlxGetImageService() |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
209 |
// ---------------------------------------------------------------------------- |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
210 |
// |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
211 |
GlxGetImageService::GlxGetImageService(GlxAiwServiceHandler* parent) : |
41 | 212 |
XQServiceProvider(IMAGE_FETCHER_SERVICE_NAME, parent), |
26
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
213 |
mServiceApp(parent) |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
214 |
{ |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
215 |
mImageRequestIndex = -1; |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
216 |
publishAll(); |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
217 |
connect(this, SIGNAL(clientDisconnected()), mServiceApp, |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
218 |
SLOT(handleClientDisconnect())); |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
219 |
} |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
220 |
|
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
221 |
// ---------------------------------------------------------------------------- |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
222 |
// ~GlxGetImageService() |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
223 |
// ---------------------------------------------------------------------------- |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
224 |
// |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
225 |
GlxGetImageService::~GlxGetImageService() |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
226 |
{ |
54 | 227 |
qDebug() << "GlxGetImageService::~GlxGetImageService()"; |
26
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
228 |
} |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
229 |
|
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
230 |
// ---------------------------------------------------------------------------- |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
231 |
// fetchFailed() |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
232 |
// ---------------------------------------------------------------------------- |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
233 |
// |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
234 |
void GlxGetImageService::fetchFailed(int errorCode) |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
235 |
{ |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
236 |
QStringList filesList; |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
237 |
filesList.insert(0, QString::number(errorCode));//result |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
238 |
doComplete(filesList); |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
239 |
} |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
240 |
|
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
241 |
// ---------------------------------------------------------------------------- |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
242 |
// complete() |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
243 |
// ---------------------------------------------------------------------------- |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
244 |
// |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
245 |
void GlxGetImageService::complete(QStringList filesList) |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
246 |
{ |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
247 |
doComplete(filesList); |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
248 |
} |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
249 |
|
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
250 |
// ---------------------------------------------------------------------------- |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
251 |
// doComplete() |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
252 |
// ---------------------------------------------------------------------------- |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
253 |
// |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
254 |
void GlxGetImageService::doComplete(QStringList filesList) |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
255 |
{ |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
256 |
if (isActive()) |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
257 |
{ |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
258 |
completeRequest(mImageRequestIndex, filesList); |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
259 |
mImageRequestIndex = -1; |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
260 |
connect(this, SIGNAL(returnValueDelivered()), qApp, SLOT(quit())); |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
261 |
} |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
262 |
} |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
263 |
|
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
264 |
// ---------------------------------------------------------------------------- |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
265 |
// isActive() |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
266 |
// ---------------------------------------------------------------------------- |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
267 |
// |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
268 |
bool GlxGetImageService::isActive() |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
269 |
{ |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
270 |
return mImageRequestIndex > -1; |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
271 |
} |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
272 |
|
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
273 |
// ---------------------------------------------------------------------------- |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
274 |
// fetch() |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
275 |
// ---------------------------------------------------------------------------- |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
276 |
// |
41 | 277 |
void GlxGetImageService::fetch() |
278 |
{ |
|
279 |
mImageRequestIndex = setCurrentRequestAsync(); |
|
65 | 280 |
|
281 |
QString title = requestInfo().info(XQINFO_KEY_WINDOW_TITLE).toString(); |
|
282 |
if(title.isNull()){ |
|
283 |
title = GLX_TITLE; |
|
284 |
} |
|
285 |
||
286 |
int fetcherFilterType = 0; //no filter |
|
287 |
if(requestInfo().info(XQINFO_KEY_FILTER_TYPE).canConvert<int>()){ |
|
288 |
fetcherFilterType = (requestInfo().info(XQINFO_KEY_FILTER_TYPE)).toInt(); |
|
289 |
qDebug()<< "GlxGetImageService::fetch() fetcherFilterType = " << fetcherFilterType; |
|
290 |
} |
|
291 |
mServiceApp->launchFetcher(title,fetcherFilterType); |
|
41 | 292 |
} |
293 |
||
294 |
// ---------------------------------------------------------------------------- |
|
295 |
// GlxGetImageService() |
|
296 |
// ---------------------------------------------------------------------------- |
|
297 |
// |
|
298 |
GlxGetImageServiceNSDI::GlxGetImageServiceNSDI(GlxAiwServiceHandler* parent) : |
|
299 |
XQServiceProvider(IMAGE_FETCHER_SERVICE_DEPINTERFACE_NAME, parent), |
|
300 |
mServiceApp(parent) |
|
301 |
{ |
|
302 |
mImageRequestIndex = -1; |
|
303 |
publishAll(); |
|
304 |
connect(this, SIGNAL(clientDisconnected()), mServiceApp, |
|
305 |
SLOT(handleClientDisconnect())); |
|
306 |
} |
|
307 |
||
308 |
// ---------------------------------------------------------------------------- |
|
309 |
// ~GlxGetImageService() |
|
310 |
// ---------------------------------------------------------------------------- |
|
311 |
// |
|
312 |
GlxGetImageServiceNSDI::~GlxGetImageServiceNSDI() |
|
313 |
{ |
|
314 |
} |
|
315 |
||
316 |
// ---------------------------------------------------------------------------- |
|
317 |
// fetchFailed() |
|
318 |
// ---------------------------------------------------------------------------- |
|
319 |
// |
|
320 |
void GlxGetImageServiceNSDI::fetchFailed(int errorCode) |
|
321 |
{ |
|
322 |
QStringList filesList; |
|
323 |
filesList.insert(0, QString::number(errorCode));//result |
|
324 |
doComplete(filesList); |
|
325 |
} |
|
326 |
||
327 |
// ---------------------------------------------------------------------------- |
|
328 |
// complete() |
|
329 |
// ---------------------------------------------------------------------------- |
|
330 |
// |
|
331 |
void GlxGetImageServiceNSDI::complete(QStringList filesList) |
|
332 |
{ |
|
333 |
doComplete(filesList); |
|
334 |
} |
|
335 |
||
336 |
// ---------------------------------------------------------------------------- |
|
337 |
// doComplete() |
|
338 |
// ---------------------------------------------------------------------------- |
|
339 |
// |
|
340 |
void GlxGetImageServiceNSDI::doComplete(QStringList filesList) |
|
341 |
{ |
|
342 |
if (isActive()) |
|
343 |
{ |
|
344 |
completeRequest(mImageRequestIndex, filesList); |
|
345 |
mImageRequestIndex = -1; |
|
346 |
connect(this, SIGNAL(returnValueDelivered()), qApp, SLOT(quit())); |
|
347 |
} |
|
348 |
} |
|
349 |
||
350 |
// ---------------------------------------------------------------------------- |
|
351 |
// isActive() |
|
352 |
// ---------------------------------------------------------------------------- |
|
353 |
// |
|
354 |
bool GlxGetImageServiceNSDI::isActive() |
|
355 |
{ |
|
356 |
return mImageRequestIndex > -1; |
|
357 |
} |
|
358 |
||
359 |
// ---------------------------------------------------------------------------- |
|
360 |
// fetch() |
|
361 |
// ---------------------------------------------------------------------------- |
|
362 |
// |
|
363 |
void GlxGetImageServiceNSDI::fetch(QVariantMap filter, QVariant flag) |
|
364 |
{ |
|
365 |
qDebug() << "GlxGetImageServiceNSDI::fetch WITH PARAMETER START"; |
|
366 |
Q_UNUSED(filter) |
|
367 |
Q_UNUSED(flag) |
|
368 |
fetch(); |
|
369 |
qDebug() << "GlxGetImageServiceNSDI::fetch WITH PARAMETER END"; |
|
370 |
} |
|
371 |
||
372 |
// ---------------------------------------------------------------------------- |
|
373 |
// fetch() |
|
374 |
// ---------------------------------------------------------------------------- |
|
375 |
// |
|
376 |
void GlxGetImageServiceNSDI::fetch() |
|
377 |
{ |
|
378 |
qDebug() << "GlxGetImageServiceNSDI::fetch START"; |
|
379 |
mImageRequestIndex = setCurrentRequestAsync(); |
|
65 | 380 |
|
381 |
QString title = requestInfo().info(XQINFO_KEY_WINDOW_TITLE).toString(); |
|
382 |
if(title.isNull()){ |
|
383 |
title = GLX_TITLE; |
|
384 |
} |
|
385 |
||
44 | 386 |
mServiceApp->launchFetcher(title); |
41 | 387 |
qDebug() << "GlxGetImageServiceNSDI::fetch END"; |
388 |
} |
|
389 |
||
390 |
//==============================================================================// |
|
391 |
// ---------------------------------------------------------------------------- |
|
392 |
// GlxGetImageService() |
|
393 |
// ---------------------------------------------------------------------------- |
|
394 |
// |
|
395 |
GlxGetImageServiceDSDI::GlxGetImageServiceDSDI(GlxAiwServiceHandler* parent) : |
|
396 |
XQServiceProvider(IMAGE_FETCHER_DEPSERVICE_DEPINTERFACE_NAME, parent), |
|
397 |
mServiceApp(parent) |
|
398 |
{ |
|
399 |
mImageRequestIndex = -1; |
|
400 |
publishAll(); |
|
401 |
connect(this, SIGNAL(clientDisconnected()), mServiceApp, |
|
402 |
SLOT(handleClientDisconnect())); |
|
403 |
} |
|
404 |
||
405 |
// ---------------------------------------------------------------------------- |
|
406 |
// ~GlxGetImageService() |
|
407 |
// ---------------------------------------------------------------------------- |
|
408 |
// |
|
409 |
GlxGetImageServiceDSDI::~GlxGetImageServiceDSDI() |
|
410 |
{ |
|
411 |
} |
|
412 |
||
413 |
// ---------------------------------------------------------------------------- |
|
414 |
// fetchFailed() |
|
415 |
// ---------------------------------------------------------------------------- |
|
416 |
// |
|
417 |
void GlxGetImageServiceDSDI::fetchFailed(int errorCode) |
|
418 |
{ |
|
419 |
QStringList filesList; |
|
420 |
filesList.insert(0, QString::number(errorCode));//result |
|
421 |
doComplete(filesList); |
|
422 |
} |
|
423 |
||
424 |
// ---------------------------------------------------------------------------- |
|
425 |
// complete() |
|
426 |
// ---------------------------------------------------------------------------- |
|
427 |
// |
|
428 |
void GlxGetImageServiceDSDI::complete(QStringList filesList) |
|
429 |
{ |
|
430 |
doComplete(filesList); |
|
431 |
} |
|
432 |
||
433 |
// ---------------------------------------------------------------------------- |
|
434 |
// doComplete() |
|
435 |
// ---------------------------------------------------------------------------- |
|
436 |
// |
|
437 |
void GlxGetImageServiceDSDI::doComplete(QStringList filesList) |
|
438 |
{ |
|
439 |
if (isActive()) |
|
440 |
{ |
|
441 |
completeRequest(mImageRequestIndex, filesList); |
|
442 |
mImageRequestIndex = -1; |
|
443 |
connect(this, SIGNAL(returnValueDelivered()), qApp, SLOT(quit())); |
|
444 |
} |
|
445 |
} |
|
446 |
||
447 |
// ---------------------------------------------------------------------------- |
|
448 |
// isActive() |
|
449 |
// ---------------------------------------------------------------------------- |
|
450 |
// |
|
451 |
bool GlxGetImageServiceDSDI::isActive() |
|
452 |
{ |
|
453 |
return mImageRequestIndex > -1; |
|
454 |
} |
|
455 |
||
456 |
// ---------------------------------------------------------------------------- |
|
457 |
// fetch() |
|
458 |
// ---------------------------------------------------------------------------- |
|
459 |
// |
|
460 |
void GlxGetImageServiceDSDI::fetch(QVariantMap filter, QVariant flag) |
|
26
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
461 |
{ |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
462 |
Q_UNUSED(filter) |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
463 |
Q_UNUSED(flag) |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
464 |
mImageRequestIndex = setCurrentRequestAsync(); |
65 | 465 |
QString title = requestInfo().info(XQINFO_KEY_WINDOW_TITLE).toString(); |
466 |
if(title.isNull()){ |
|
467 |
title = GLX_TITLE; |
|
468 |
} |
|
469 |
||
44 | 470 |
mServiceApp->launchFetcher(title); |
26
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
471 |
} |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
472 |
|
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
473 |
// ----------GlxImageViewerService--------------- |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
474 |
|
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
475 |
GlxImageViewerService::GlxImageViewerService(GlxAiwServiceHandler* parent) : |
41 | 476 |
XQServiceProvider(FILE_VIEWER_SERVICE_NAME, parent), |
26
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
477 |
mServiceApp(parent), mAsyncReqId(-1), mAsyncRequest(false), |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
478 |
mImageViewerInstance(NULL) |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
479 |
|
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
480 |
{ |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
481 |
publishAll(); |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
482 |
connect(this, SIGNAL(clientDisconnected()), mServiceApp, |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
483 |
SLOT(handleClientDisconnect())); |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
484 |
} |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
485 |
|
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
486 |
GlxImageViewerService::~GlxImageViewerService() |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
487 |
{ |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
488 |
if (mImageViewerInstance) |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
489 |
{ |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
490 |
mImageViewerInstance->Close(); |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
491 |
} |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
492 |
} |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
493 |
|
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
494 |
void GlxImageViewerService::complete(bool ok) |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
495 |
{ |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
496 |
if (mAsyncReqId == -1) |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
497 |
return; |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
498 |
completeRequest(mAsyncReqId, QVariant(ok)); |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
499 |
} |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
500 |
|
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
501 |
bool GlxImageViewerService::view(QString file) |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
502 |
{ |
45 | 503 |
XQApplicationManager appmgr; |
504 |
QFile tempfile(file); |
|
505 |
QVariantList attrValues; |
|
506 |
QList<int> attrNames; |
|
507 |
attrNames.append(XQApplicationManager::IsProtected); |
|
508 |
bool ok = appmgr.getDrmAttributes(tempfile, attrNames, attrValues); |
|
509 |
if(attrValues.at(0).toBool()){ |
|
510 |
HbNotificationDialog::launchDialog("NOT SUPPORTED"); |
|
511 |
connect(this, SIGNAL(returnValueDelivered()), mServiceApp, |
|
512 |
SLOT(handleAnswerDelivered())); |
|
513 |
complete(true); |
|
514 |
return false; |
|
515 |
} |
|
516 |
||
26
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
517 |
XQRequestInfo info = requestInfo(); |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
518 |
mAsyncRequest = !info.isSynchronous(); |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
519 |
if (!mImageViewerInstance) |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
520 |
{ |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
521 |
mImageViewerInstance = CGlxImageViewerManager::InstanceL(); |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
522 |
} |
42 | 523 |
QString filepath(QDir::toNativeSeparators(file)); |
41 | 524 |
TPtrC16 str(reinterpret_cast<const TUint16*> (filepath.utf16())); |
26
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
525 |
HBufC* uri = str.Alloc(); |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
526 |
|
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
527 |
mImageViewerInstance->SetImageUriL(*uri); |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
528 |
if (mAsyncRequest) |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
529 |
{ |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
530 |
mAsyncReqId = setCurrentRequestAsync(); |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
531 |
} |
54 | 532 |
|
65 | 533 |
QString title = requestInfo().info(XQINFO_KEY_WINDOW_TITLE).toString(); |
54 | 534 |
if(title.isNull()){ |
535 |
title =GLX_IMAGE_VIEWER; |
|
536 |
} |
|
537 |
||
538 |
mServiceApp->launchImageViewer(title); |
|
26
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
539 |
return true; |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
540 |
} |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
541 |
|
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
542 |
bool GlxImageViewerService::view(XQSharableFile sf) |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
543 |
{ |
65 | 544 |
XQApplicationManager appmgr; |
545 |
QFile tempfile(sf.fileName()); |
|
546 |
QVariantList attrValues; |
|
547 |
QList<int> attrNames; |
|
548 |
attrNames.append(XQApplicationManager::IsProtected); |
|
549 |
bool ok1 = appmgr.getDrmAttributes(tempfile, attrNames, attrValues); |
|
550 |
if(ok1 && attrValues.at(0).toBool()){ |
|
551 |
HbNotificationDialog::launchDialog("NOT SUPPORTED"); |
|
552 |
connect(this, SIGNAL(returnValueDelivered()), mServiceApp, |
|
553 |
SLOT(handleAnswerDelivered())); |
|
554 |
complete(true); |
|
555 |
return false; |
|
556 |
} |
|
557 |
||
26
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
558 |
if (!mImageViewerInstance) |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
559 |
{ |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
560 |
mImageViewerInstance = CGlxImageViewerManager::InstanceL(); |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
561 |
} |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
562 |
RFile file; |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
563 |
bool ok = sf.getHandle(file); |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
564 |
if (ok) |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
565 |
{ |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
566 |
mImageViewerInstance->SetImageFileHandleL(file); |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
567 |
sf.close(); |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
568 |
} |
54 | 569 |
|
65 | 570 |
QString title = requestInfo().info(XQINFO_KEY_WINDOW_TITLE).toString(); |
54 | 571 |
if(title.isNull()){ |
572 |
title = GLX_IMAGE_VIEWER; |
|
573 |
} |
|
574 |
||
575 |
mServiceApp->launchImageViewer(title); |
|
26
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
576 |
mAsyncRequest = !XQServiceUtil::isEmbedded(); |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
577 |
|
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
578 |
if (mAsyncRequest) |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
579 |
{ |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
580 |
mAsyncReqId = setCurrentRequestAsync(); |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
581 |
connect(this, SIGNAL(clientDisconnected()), this, |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
582 |
SLOT(handleClientDisconnect())); |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
583 |
} |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
584 |
return true; |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
585 |
} |
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
586 |
|
71 | 587 |
// ----------GlxBrowseImageService--------------- |
588 |
||
589 |
GlxBrowseImageService::GlxBrowseImageService(GlxAiwServiceHandler* parent) : |
|
590 |
XQServiceProvider(FILE_BROWSER_SERVICE_NAME, parent), |
|
591 |
mServiceApp(parent), mAsyncReqId(-1), mAsyncRequest(false) |
|
592 |
||
593 |
{ |
|
594 |
publishAll(); |
|
595 |
connect(this, SIGNAL(clientDisconnected()), mServiceApp, |
|
596 |
SLOT(handleClientDisconnect())); |
|
597 |
} |
|
598 |
||
599 |
GlxBrowseImageService::~GlxBrowseImageService() |
|
600 |
{ |
|
601 |
} |
|
602 |
||
603 |
void GlxBrowseImageService::complete(bool ok) |
|
604 |
{ |
|
605 |
if (mAsyncReqId == -1) |
|
606 |
return; |
|
607 |
completeRequest(mAsyncReqId, QVariant(ok)); |
|
608 |
} |
|
609 |
||
610 |
void GlxBrowseImageService::browse() |
|
611 |
{ |
|
612 |
mServiceApp->launchImageBrowser(GLX_TITLE); |
|
613 |
XQRequestInfo info = requestInfo(); |
|
614 |
mAsyncRequest = !info.isSynchronous(); |
|
615 |
||
616 |
if (mAsyncRequest) |
|
617 |
{ |
|
618 |
mAsyncReqId = setCurrentRequestAsync(); |
|
619 |
connect(this, SIGNAL(clientDisconnected()), this, |
|
620 |
SLOT(handleClientDisconnect())); |
|
621 |
} |
|
622 |
} |
|
26
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
623 |
|
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
624 |