92
|
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: ?Description
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include <e32std.h>
|
|
19 |
#include <e32base.h>
|
|
20 |
#include <QBitmap>
|
|
21 |
#include <QDebug>
|
|
22 |
#include <AknIconUtils.h> // avkon
|
|
23 |
#include <APGICNFL.H> // fbsbitmap
|
|
24 |
|
|
25 |
#include "cabitmapadapter.h"
|
|
26 |
#include "camenuiconmifutility.h"
|
|
27 |
|
|
28 |
|
|
29 |
void CaMenuIconMifUtility::GetPixmapByFilenameL(TDesC& fileName,
|
|
30 |
const QSize &size, QPixmap& pixmap)
|
|
31 |
{
|
|
32 |
CFbsBitmap *bitamp(0);
|
|
33 |
CFbsBitmap *mask(0);
|
|
34 |
|
93
|
35 |
TInt bitmapIndex = 0;
|
|
36 |
TInt maskIndex = 1;
|
|
37 |
// it will change bitmap ids if it is mif (checking inside)
|
|
38 |
AknIconUtils::ValidateLogicalAppIconId( fileName,
|
92
|
39 |
bitmapIndex, maskIndex );
|
93
|
40 |
AknIconUtils::CreateIconLC( bitamp, mask, fileName,
|
|
41 |
bitmapIndex, maskIndex );
|
92
|
42 |
|
93
|
43 |
if (AknIconUtils::IsMifFile(fileName)) {
|
|
44 |
AknIconUtils::DisableCompression(bitamp);
|
|
45 |
AknIconUtils::SetSize(bitamp, TSize(size.width(), size.height()),
|
|
46 |
EAspectRatioPreservedAndUnusedSpaceRemoved);
|
92
|
47 |
|
93
|
48 |
CaBitmapAdapter::fromBitmapAndMaskToPixmapL(bitamp, mask, pixmap);
|
|
49 |
} else {
|
|
50 |
CaBitmapAdapter::fromBitmapAndMaskToPixmapL(bitamp, mask, pixmap);
|
|
51 |
pixmap.scaled(size);
|
|
52 |
}
|
92
|
53 |
|
|
54 |
// bitmap and icon, AknsUtils::CreateIconLC doesn't specify the order
|
|
55 |
CleanupStack::Pop(2);
|
|
56 |
}
|