119
|
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 |
//------------------------------------------------------------------------------
|
125
|
20 |
/**
|
|
21 |
* Constructor - initialize provider instance
|
|
22 |
* @param observer - thumnail observer
|
|
23 |
* @param obj - object which request and receive new thumnails using signal/slot interface
|
|
24 |
*/
|
119
|
25 |
TsThumbnailProvider::TsThumbnailProvider(MTsThumbnailObserver& observer, QObject* obj)
|
|
26 |
:
|
|
27 |
mObserver(observer)
|
|
28 |
{
|
|
29 |
connect(this,
|
|
30 |
SIGNAL(createThumbnail(QPixmap,int,const void*)),
|
|
31 |
obj,
|
|
32 |
SLOT(createThumbnail(QPixmap,int,const void*)));
|
|
33 |
|
|
34 |
connect(obj,
|
|
35 |
SIGNAL(thumbnailCreated(QPixmap, const void*)),
|
|
36 |
this,
|
|
37 |
SLOT(thumbnailCreated(QPixmap, const void*)));
|
|
38 |
}
|
|
39 |
//------------------------------------------------------------------------------
|
125
|
40 |
/**
|
|
41 |
* Function create interface for Symbian clients.
|
|
42 |
*/
|
119
|
43 |
void TsThumbnailProvider::createThumbnail(CFbsBitmap& source, int angle)
|
|
44 |
{
|
|
45 |
emit createThumbnail(QPixmap::fromSymbianCFbsBitmap(&source),
|
|
46 |
angle,
|
|
47 |
this);
|
|
48 |
}
|
|
49 |
|
|
50 |
//------------------------------------------------------------------------------
|
125
|
51 |
/**
|
|
52 |
* Retrieve requests done by Symbian interface and forward results to observer
|
|
53 |
*/
|
119
|
54 |
void TsThumbnailProvider::thumbnailCreated(const QPixmap& thumbnail,
|
|
55 |
const void *userData)
|
|
56 |
{
|
|
57 |
if (this != userData) {
|
|
58 |
return;
|
|
59 |
}
|
|
60 |
CFbsBitmap *bitmap(thumbnail.toSymbianCFbsBitmap());
|
|
61 |
if(0 != bitmap) {
|
125
|
62 |
mObserver.ThumbnailCreated(*bitmap);
|
119
|
63 |
}
|
|
64 |
delete bitmap;
|
|
65 |
}
|