1 /* |
1 /* |
2 * Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
62 // |
62 // |
63 void CAppMngr2WidgetRuntime::LoadIconsL( CAknIconArray& aIconArray ) |
63 void CAppMngr2WidgetRuntime::LoadIconsL( CAknIconArray& aIconArray ) |
64 { |
64 { |
65 MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); |
65 MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); |
66 HBufC* iconFilePath = NULL; |
66 HBufC* iconFilePath = NULL; |
67 |
67 |
68 iconFilePath = FullBitmapFileNameLC( KAppMngr2WidgetIconFileNameMif ); |
68 iconFilePath = FullBitmapFileNameLC( KAppMngr2WidgetIconFileNameMif ); |
69 |
69 |
70 // Icon 0: Widget application icon, qgn_menu_am_widget |
70 // Icon 0: Widget application icon, qgn_menu_am_widget |
71 CGulIcon* icon = AknsUtils::CreateGulIconL( skinInstance, |
71 CGulIcon* icon = AknsUtils::CreateGulIconL( skinInstance, |
72 KAknsIIDQgnMenuAmWidget, *iconFilePath, |
72 KAknsIIDQgnMenuAmWidget, *iconFilePath, |
84 // --------------------------------------------------------------------------- |
84 // --------------------------------------------------------------------------- |
85 // |
85 // |
86 void CAppMngr2WidgetRuntime::GetSupportedDataTypesL( |
86 void CAppMngr2WidgetRuntime::GetSupportedDataTypesL( |
87 CDataTypeArray& aDataTypeArray ) |
87 CDataTypeArray& aDataTypeArray ) |
88 { |
88 { |
89 TDataType wgzWidget( KDataTypeWgzWidget ); |
89 TDataType zipFile( KDataTypeWidget ); |
90 aDataTypeArray.AppendL( wgzWidget ); |
90 aDataTypeArray.AppendL( zipFile ); |
91 TDataType wgtWidget( KDataTypeWgtWidget ); |
|
92 aDataTypeArray.AppendL( wgtWidget ); |
|
93 } |
91 } |
94 |
92 |
95 // --------------------------------------------------------------------------- |
93 // --------------------------------------------------------------------------- |
96 // CAppMngr2WidgetRuntime::GetInstallationFilesL() |
94 // CAppMngr2WidgetRuntime::GetInstallationFilesL() |
97 // --------------------------------------------------------------------------- |
95 // --------------------------------------------------------------------------- |
145 CAppMngr2WidgetAppInfo* appObj = NULL; |
143 CAppMngr2WidgetAppInfo* appObj = NULL; |
146 TRAPD( err, appObj = CAppMngr2WidgetAppInfo::NewL( *this, |
144 TRAPD( err, appObj = CAppMngr2WidgetAppInfo::NewL( *this, |
147 *( widgetInfoArray[ index ] ), aFsSession ) ); |
145 *( widgetInfoArray[ index ] ), aFsSession ) ); |
148 if( err == KErrNone ) |
146 if( err == KErrNone ) |
149 { |
147 { |
150 CleanupStack::PushL( appObj ); |
148 CleanupStack::PushL( appObj ); |
151 aApps.Append( appObj ); |
149 aApps.Append( appObj ); |
152 CleanupStack::Pop( appObj ); |
150 CleanupStack::Pop( appObj ); |
153 } |
151 } |
154 } |
152 } |
155 |
153 |
156 CleanupStack::PopAndDestroy( &widgetInfoArray ); |
154 CleanupStack::PopAndDestroy( &widgetInfoArray ); |
157 |
155 |
158 TRequestStatus* status = &aStatus; |
156 TRequestStatus* status = &aStatus; |
159 User::RequestComplete( status, KErrNone ); |
157 User::RequestComplete( status, KErrNone ); |
160 } |
158 } |
161 |
159 |
162 // --------------------------------------------------------------------------- |
160 // --------------------------------------------------------------------------- |
166 void CAppMngr2WidgetRuntime::CancelGetInstalledApps() |
164 void CAppMngr2WidgetRuntime::CancelGetInstalledApps() |
167 { |
165 { |
168 } |
166 } |
169 |
167 |
170 // --------------------------------------------------------------------------- |
168 // --------------------------------------------------------------------------- |
171 // CAppMngr2WidgetRuntime::GetMimeTypeL() |
|
172 // --------------------------------------------------------------------------- |
|
173 // |
|
174 HBufC8* CAppMngr2WidgetRuntime::GetMimeTypeL( const TUid& aWidgetUid ) |
|
175 { |
|
176 CWidgetPropertyValue* prop = iWidgetRegistry.GetWidgetPropertyValueL( aWidgetUid, EMimeType ); |
|
177 CleanupStack::PushL( prop ); |
|
178 |
|
179 const TPtrC valuePtr( *prop ); |
|
180 HBufC8* retStr = HBufC8::NewLC( valuePtr.Length() ); |
|
181 TPtr8 retPtr( retStr->Des() ); |
|
182 retPtr.Copy( valuePtr ); |
|
183 CleanupStack::Pop( retStr ); |
|
184 |
|
185 CleanupStack::PopAndDestroy( prop ); |
|
186 return retStr; |
|
187 } |
|
188 |
|
189 // --------------------------------------------------------------------------- |
|
190 // CAppMngr2WidgetRuntime::CAppMngr2WidgetRuntime() |
169 // CAppMngr2WidgetRuntime::CAppMngr2WidgetRuntime() |
191 // --------------------------------------------------------------------------- |
170 // --------------------------------------------------------------------------- |
192 // |
171 // |
193 CAppMngr2WidgetRuntime::CAppMngr2WidgetRuntime( MAppMngr2RuntimeObserver& aObserver ) |
172 CAppMngr2WidgetRuntime::CAppMngr2WidgetRuntime( MAppMngr2RuntimeObserver& aObserver ) |
194 : CAppMngr2Runtime( aObserver ) |
173 : CAppMngr2Runtime( aObserver ) |
195 { |
174 { |
196 } |
175 } |
197 |
176 |
198 // --------------------------------------------------------------------------- |
177 // --------------------------------------------------------------------------- |
199 // CAppMngr2WidgetRuntime::ConstructL() |
178 // CAppMngr2WidgetRuntime::ConstructL() |