|
1 /* |
|
2 * Copyright (c) 2008 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: Task list entry |
|
15 * |
|
16 */ |
|
17 #include <fbs.h> |
|
18 #include "tsthumbnailprovider.h" |
|
19 //------------------------------------------------------------------------------ |
|
20 TsThumbnailProvider::TsThumbnailProvider(MTsThumbnailObserver& observer, QObject* obj) |
|
21 : |
|
22 mObserver(observer) |
|
23 { |
|
24 connect(this, |
|
25 SIGNAL(createThumbnail(QPixmap,int,const void*)), |
|
26 obj, |
|
27 SLOT(createThumbnail(QPixmap,int,const void*))); |
|
28 |
|
29 connect(obj, |
|
30 SIGNAL(thumbnailCreated(QPixmap, const void*)), |
|
31 this, |
|
32 SLOT(thumbnailCreated(QPixmap, const void*))); |
|
33 } |
|
34 //------------------------------------------------------------------------------ |
|
35 void TsThumbnailProvider::createThumbnail(CFbsBitmap& source, int angle) |
|
36 { |
|
37 emit createThumbnail(QPixmap::fromSymbianCFbsBitmap(&source), |
|
38 angle, |
|
39 this); |
|
40 } |
|
41 |
|
42 //------------------------------------------------------------------------------ |
|
43 void TsThumbnailProvider::thumbnailCreated(const QPixmap& thumbnail, |
|
44 const void *userData) |
|
45 { |
|
46 if (this != userData) { |
|
47 return; |
|
48 } |
|
49 CFbsBitmap *bitmap(thumbnail.toSymbianCFbsBitmap()); |
|
50 if(0 != bitmap) { |
|
51 mObserver.thumbnailCreated(*bitmap); |
|
52 } |
|
53 delete bitmap; |
|
54 } |