112
|
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: camificonengine.h
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef CAMIFICONENGINE_H
|
|
19 |
#define CAMIFICONENGINE_H
|
|
20 |
|
|
21 |
#include <QIconEngineV2>
|
|
22 |
#include <QPixmap>
|
|
23 |
#include <QCache>
|
|
24 |
|
|
25 |
class CaMifIconEngine : public QIconEngineV2
|
|
26 |
{
|
|
27 |
public:
|
|
28 |
CaMifIconEngine();
|
|
29 |
CaMifIconEngine(const CaMifIconEngine &other);
|
|
30 |
~CaMifIconEngine();
|
|
31 |
void paint(QPainter *painter, const QRect &rect,
|
|
32 |
QIcon::Mode mode, QIcon::State state);
|
|
33 |
|
|
34 |
QSize actualSize(const QSize &size,
|
|
35 |
QIcon::Mode mode,
|
|
36 |
QIcon::State state);
|
|
37 |
|
|
38 |
QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state);
|
|
39 |
|
|
40 |
void addPixmap(const QPixmap &pixmap,
|
|
41 |
QIcon::Mode mode,
|
|
42 |
QIcon::State state);
|
|
43 |
|
|
44 |
void addFile(const QString &fileName,
|
|
45 |
const QSize &size,
|
|
46 |
QIcon::Mode mode,
|
|
47 |
QIcon::State state);
|
|
48 |
|
|
49 |
QString key() const;
|
|
50 |
QIconEngineV2 *clone() const;
|
|
51 |
|
|
52 |
private:
|
|
53 |
QString pmcKey(const QSize &size);
|
|
54 |
void getPixmapFromBitmap(const QSize &size, QPixmap& pixmap);
|
|
55 |
void cacheBitmapL();
|
|
56 |
|
|
57 |
private:
|
|
58 |
QString mMifFilename;
|
|
59 |
QCache<QString, QPixmap> mCache;
|
|
60 |
CFbsBitmap *mBitmapCached;
|
|
61 |
CFbsBitmap *mMaskBitmapCached;
|
|
62 |
};
|
|
63 |
|
|
64 |
#endif // CAMIFICONENGINE_H
|