|
1 /* |
|
2 * Copyright (c) 2002 - 2007 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: for testing the method of the CHuiTextVisual |
|
15 * |
|
16 */ |
|
17 |
|
18 #include <uiacceltk\huiimageloaderutil.h> |
|
19 |
|
20 #include "testuiaifcoretoolkit.h" |
|
21 |
|
22 const TInt KWidth = 10; |
|
23 const TInt KHeight = 10; |
|
24 const TInt KMajor = 5; |
|
25 const TInt KMinor = 0; |
|
26 |
|
27 enum TTestEnum |
|
28 { |
|
29 EBitmapId, |
|
30 EBitmapMaskId |
|
31 }; |
|
32 |
|
33 // ----------------------------------------------------------------------------- |
|
34 // Ctestplatalfcoretoolkit::TestHuiImageLoaderUtilConstructor |
|
35 // ----------------------------------------------------------------------------- |
|
36 // |
|
37 TInt CTestUiAifCoreToolkit::TestHuiImageLoaderUtilConstructorL( CStifItemParser& /*aItem*/ ) |
|
38 { |
|
39 |
|
40 // Print to UI |
|
41 _LIT( Ktestplatalfcoretoolkit, "testplatalfcoretoolkit" ); |
|
42 _LIT( KTestHuiImageLoaderUtilConstructor, "In TestHuiImageLoaderUtilConstructor" ); |
|
43 TestModuleIf().Printf( 0, Ktestplatalfcoretoolkit, KTestHuiImageLoaderUtilConstructor ); |
|
44 // Print to log file |
|
45 iLog->Log( KTestHuiImageLoaderUtilConstructor ); |
|
46 |
|
47 iHuiImageLoaderUtil = new( ELeave ) CHuiImageLoaderUtil(); |
|
48 |
|
49 return KErrNone; |
|
50 |
|
51 } |
|
52 |
|
53 // ----------------------------------------------------------------------------- |
|
54 // Ctestplatalfcoretoolkit::TestHuiImageLoaderUtilDelete |
|
55 // ----------------------------------------------------------------------------- |
|
56 // |
|
57 TInt CTestUiAifCoreToolkit::TestHuiImageLoaderUtilDelete( CStifItemParser& /*aItem*/ ) |
|
58 { |
|
59 |
|
60 // Print to UI |
|
61 _LIT( Ktestplatalfcoretoolkit, "testplatalfcoretoolkit" ); |
|
62 _LIT( KTestHuiImageLoaderUtilDelete, "In TestHuiImageLoaderUtilDelete" ); |
|
63 TestModuleIf().Printf( 0, Ktestplatalfcoretoolkit, KTestHuiImageLoaderUtilDelete ); |
|
64 // Print to log file |
|
65 iLog->Log( KTestHuiImageLoaderUtilDelete ); |
|
66 |
|
67 delete iHuiImageLoaderUtil; |
|
68 iHuiImageLoaderUtil = NULL; |
|
69 |
|
70 return KErrNone; |
|
71 |
|
72 } |
|
73 |
|
74 // ----------------------------------------------------------------------------- |
|
75 // Ctestplatalfcoretoolkit::TestHuiImageLoaderUtilCreateImageLoaderL |
|
76 // ----------------------------------------------------------------------------- |
|
77 // |
|
78 TInt CTestUiAifCoreToolkit::TestHuiImageLoaderUtilCreateImageLoaderL( CStifItemParser& /*aItem*/ ) |
|
79 { |
|
80 |
|
81 // Print to UI |
|
82 _LIT( Ktestplatalfcoretoolkit, "testplatalfcoretoolkit" ); |
|
83 _LIT( KTestHuiImageLoaderUtilCreateImageLoaderL, "In TestHuiImageLoaderUtilCreateImageLoaderL" ); |
|
84 TestModuleIf().Printf( 0, Ktestplatalfcoretoolkit, KTestHuiImageLoaderUtilCreateImageLoaderL ); |
|
85 // Print to log file |
|
86 iLog->Log( KTestHuiImageLoaderUtilCreateImageLoaderL ); |
|
87 |
|
88 TAknsItemID id; |
|
89 id.Set( KMajor, KMinor ); |
|
90 |
|
91 iHuiImageLoaderUtil->CreateImageLoaderL( id, _L("test.bmp"), EBitmapId, EBitmapMaskId ); |
|
92 |
|
93 return KErrNone; |
|
94 |
|
95 } |
|
96 |
|
97 // ----------------------------------------------------------------------------- |
|
98 // Ctestplatalfcoretoolkit::TestHuiImageLoaderUtilCreateImageLoaderLWithAppUid |
|
99 // ----------------------------------------------------------------------------- |
|
100 // |
|
101 TInt CTestUiAifCoreToolkit::TestHuiImageLoaderUtilCreateImageLoaderLWithAppUidL( CStifItemParser& /*aItem*/ ) |
|
102 { |
|
103 |
|
104 // Print to UI |
|
105 _LIT( Ktestplatalfcoretoolkit, "testplatalfcoretoolkit" ); |
|
106 _LIT( KTestHuiImageLoaderUtilCreateImageLoaderLWithAppUid, "In TestHuiImageLoaderUtilCreateImageLoaderLWithAppUid" ); |
|
107 TestModuleIf().Printf( 0, Ktestplatalfcoretoolkit, KTestHuiImageLoaderUtilCreateImageLoaderLWithAppUid ); |
|
108 // Print to log file |
|
109 iLog->Log( KTestHuiImageLoaderUtilCreateImageLoaderLWithAppUid ); |
|
110 |
|
111 TUid uid = { KTestScreenBufferUidValue }; |
|
112 |
|
113 iHuiImageLoaderUtil->CreateImageLoaderL( uid, EAknsAppIconTypeList ); |
|
114 |
|
115 return KErrNone; |
|
116 |
|
117 } |
|
118 |
|
119 // ----------------------------------------------------------------------------- |
|
120 // Ctestplatalfcoretoolkit::TestHuiImageLoaderUtilSetSize |
|
121 // ----------------------------------------------------------------------------- |
|
122 // |
|
123 TInt CTestUiAifCoreToolkit::TestHuiImageLoaderUtilSetSize( CStifItemParser& /*aItem*/ ) |
|
124 { |
|
125 |
|
126 // Print to UI |
|
127 _LIT( Ktestplatalfcoretoolkit, "testplatalfcoretoolkit" ); |
|
128 _LIT( KTestHuiImageLoaderUtilSetSize, "In TestHuiImageLoaderUtilSetSize" ); |
|
129 TestModuleIf().Printf( 0, Ktestplatalfcoretoolkit, KTestHuiImageLoaderUtilSetSize ); |
|
130 // Print to log file |
|
131 iLog->Log( KTestHuiImageLoaderUtilSetSize ); |
|
132 |
|
133 TSize size( KWidth, KHeight ); |
|
134 |
|
135 iHuiImageLoaderUtil->SetSize( size ); |
|
136 |
|
137 return KErrNone; |
|
138 |
|
139 } |
|
140 |
|
141 // ----------------------------------------------------------------------------- |
|
142 // Ctestplatalfcoretoolkit::TestHuiImageLoaderUtilSetSkinInstance |
|
143 // ----------------------------------------------------------------------------- |
|
144 // |
|
145 TInt CTestUiAifCoreToolkit::TestHuiImageLoaderUtilSetSkinInstance( CStifItemParser& /*aItem*/ ) |
|
146 { |
|
147 |
|
148 // Print to UI |
|
149 _LIT( Ktestplatalfcoretoolkit, "testplatalfcoretoolkit" ); |
|
150 _LIT( KTestHuiImageLoaderUtilSetSkinInstance, "In TestHuiImageLoaderUtilSetSkinInstance" ); |
|
151 TestModuleIf().Printf( 0, Ktestplatalfcoretoolkit, KTestHuiImageLoaderUtilSetSkinInstance ); |
|
152 // Print to log file |
|
153 iLog->Log( KTestHuiImageLoaderUtilSetSkinInstance ); |
|
154 |
|
155 MAknsSkinInstance* skinInstance = NULL; |
|
156 |
|
157 iHuiImageLoaderUtil->SetSkinInstance( skinInstance ); |
|
158 |
|
159 return KErrNone; |
|
160 |
|
161 } |
|
162 |
|
163 // ----------------------------------------------------------------------------- |
|
164 // Ctestplatalfcoretoolkit::TestHuiImageLoaderUtilImageLoaderExtension |
|
165 // ----------------------------------------------------------------------------- |
|
166 // |
|
167 TInt CTestUiAifCoreToolkit::TestHuiImageLoaderUtilImageLoaderExtension( CStifItemParser& /*aItem*/ ) |
|
168 { |
|
169 |
|
170 // Print to UI |
|
171 _LIT( Ktestplatalfcoretoolkit, "testplatalfcoretoolkit" ); |
|
172 _LIT( KTestHuiImageLoaderUtilImageLoaderExtension, "In TestHuiImageLoaderUtilImageLoaderExtension" ); |
|
173 TestModuleIf().Printf( 0, Ktestplatalfcoretoolkit, KTestHuiImageLoaderUtilImageLoaderExtension ); |
|
174 // Print to log file |
|
175 iLog->Log( KTestHuiImageLoaderUtilImageLoaderExtension ); |
|
176 |
|
177 TUid uid; |
|
178 uid.Null(); |
|
179 |
|
180 iHuiImageLoaderUtil->ImageLoaderExtension( uid, NULL ); |
|
181 |
|
182 return KErrNone; |
|
183 |
|
184 } |
|
185 |
|
186 // End of files |