appinstaller/AppMngr2/Widget/src/appmngr2widgetruntime.cpp
branchRCL_3
changeset 26 8b7f4e561641
parent 25 7333d7932ef7
equal deleted inserted replaced
25:7333d7932ef7 26:8b7f4e561641
     1 /*
     1 /*
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2008-2010 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 zipFile( KDataTypeWidget );
    89     TDataType wgzWidget( KDataTypeWgzWidget );
    90     aDataTypeArray.AppendL( zipFile );
    90     aDataTypeArray.AppendL( wgzWidget );
       
    91     TDataType wgtWidget( KDataTypeWgtWidget );
       
    92     aDataTypeArray.AppendL( wgtWidget );
    91     }
    93     }
    92 
    94 
    93 // ---------------------------------------------------------------------------
    95 // ---------------------------------------------------------------------------
    94 // CAppMngr2WidgetRuntime::GetInstallationFilesL()
    96 // CAppMngr2WidgetRuntime::GetInstallationFilesL()
    95 // ---------------------------------------------------------------------------
    97 // ---------------------------------------------------------------------------
   143         CAppMngr2WidgetAppInfo* appObj = NULL;
   145         CAppMngr2WidgetAppInfo* appObj = NULL;
   144         TRAPD( err, appObj = CAppMngr2WidgetAppInfo::NewL( *this,
   146         TRAPD( err, appObj = CAppMngr2WidgetAppInfo::NewL( *this,
   145                 *( widgetInfoArray[ index ] ), aFsSession ) );
   147                 *( widgetInfoArray[ index ] ), aFsSession ) );
   146         if( err == KErrNone )
   148         if( err == KErrNone )
   147             {
   149             {
   148             CleanupStack::PushL( appObj ); 
   150             CleanupStack::PushL( appObj );
   149             aApps.Append( appObj );
   151             aApps.Append( appObj );
   150             CleanupStack::Pop( appObj );
   152             CleanupStack::Pop( appObj );
   151             }
   153             }
   152         }
   154         }
   153     
   155 
   154     CleanupStack::PopAndDestroy( &widgetInfoArray );
   156     CleanupStack::PopAndDestroy( &widgetInfoArray );
   155     
   157 
   156     TRequestStatus* status = &aStatus;
   158     TRequestStatus* status = &aStatus;
   157     User::RequestComplete( status, KErrNone );
   159     User::RequestComplete( status, KErrNone );
   158     }
   160     }
   159 
   161 
   160 // ---------------------------------------------------------------------------
   162 // ---------------------------------------------------------------------------
   164 void CAppMngr2WidgetRuntime::CancelGetInstalledApps()
   166 void CAppMngr2WidgetRuntime::CancelGetInstalledApps()
   165     {
   167     {
   166     }
   168     }
   167 
   169 
   168 // ---------------------------------------------------------------------------
   170 // ---------------------------------------------------------------------------
       
   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 // ---------------------------------------------------------------------------
   169 // CAppMngr2WidgetRuntime::CAppMngr2WidgetRuntime()
   190 // CAppMngr2WidgetRuntime::CAppMngr2WidgetRuntime()
   170 // ---------------------------------------------------------------------------
   191 // ---------------------------------------------------------------------------
   171 //
   192 //
   172 CAppMngr2WidgetRuntime::CAppMngr2WidgetRuntime( MAppMngr2RuntimeObserver& aObserver )
   193 CAppMngr2WidgetRuntime::CAppMngr2WidgetRuntime( MAppMngr2RuntimeObserver& aObserver )
   173         : CAppMngr2Runtime( aObserver ) 
   194         : CAppMngr2Runtime( aObserver )
   174     {
   195     {
   175     }
   196     }
   176 
   197 
   177 // ---------------------------------------------------------------------------
   198 // ---------------------------------------------------------------------------
   178 // CAppMngr2WidgetRuntime::ConstructL()
   199 // CAppMngr2WidgetRuntime::ConstructL()