|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Moc impl for image fetcher api. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "xqaiwgetimageclient.h" |
|
20 #include "hsimagegridwidget.h" |
|
21 |
|
22 // --------------------------------------------------------------------------- |
|
23 // --------------------------------------------------------------------------- |
|
24 // |
|
25 XQAIWGetImageClient::XQAIWGetImageClient(): |
|
26 mImageGrid(0) |
|
27 { |
|
28 setProperty("testSetToFail", QVariant(true)); |
|
29 } |
|
30 |
|
31 // --------------------------------------------------------------------------- |
|
32 // --------------------------------------------------------------------------- |
|
33 // |
|
34 XQAIWGetImageClient::~XQAIWGetImageClient() |
|
35 { |
|
36 } |
|
37 |
|
38 // --------------------------------------------------------------------------- |
|
39 // --------------------------------------------------------------------------- |
|
40 // |
|
41 void XQAIWGetImageClient::fetch() |
|
42 { |
|
43 if (property("testSetToFail").value<bool>() == true) |
|
44 { |
|
45 imageSelectionCancelled(); |
|
46 } |
|
47 else |
|
48 { |
|
49 imageSelected(QString("")); |
|
50 } |
|
51 } |
|
52 |
|
53 // --------------------------------------------------------------------------- |
|
54 // --------------------------------------------------------------------------- |
|
55 // |
|
56 void XQAIWGetImageClient::imageSelected(const QString& val) |
|
57 { |
|
58 emit fetchCompleted(val); |
|
59 } |
|
60 |
|
61 // --------------------------------------------------------------------------- |
|
62 // --------------------------------------------------------------------------- |
|
63 // |
|
64 void XQAIWGetImageClient::requestCompleted(const QVariant& val) |
|
65 { |
|
66 Q_UNUSED(val) |
|
67 } |
|
68 |
|
69 void XQAIWGetImageClient::imageSelectionCancelled() |
|
70 { |
|
71 emit fetchFailed(-1, QString()); //KErrNotFound |
|
72 } |