idlehomescreen/xmluirendering/uiengine/src/xncomposer.cpp
branchRCL_3
changeset 26 1b758917cafc
parent 23 7be2816dbabd
child 28 d721605b30d0
equal deleted inserted replaced
25:137ebc85284b 26:1b758917cafc
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 // System includes
    18 // System includes
    19 #include <s32file.h>
    19 #include <s32file.h>
       
    20 #include <UTF.h>
    20 
    21 
    21 // User includes
    22 // User includes
    22 #include "xncomposer.h"
    23 #include "xncomposer.h"
    23 #include "xnplugindata.h"
    24 #include "xnplugindata.h"
    24 #include "xnrootdata.h"
    25 #include "xnrootdata.h"
    58 // ItemValueL
    59 // ItemValueL
    59 // Get property value from configuration.
    60 // Get property value from configuration.
    60 // --------------------------------------------------------------------------
    61 // --------------------------------------------------------------------------
    61 //
    62 //
    62 static HBufC* ItemValueL( CHspsConfiguration& aConfiguration, 
    63 static HBufC* ItemValueL( CHspsConfiguration& aConfiguration, 
    63     const TDesC8& aItemId, const TDesC8& aName )
    64     const TDesC8& aItemId,
       
    65     const TDesC8& aName,
       
    66     const TBool aUseUtfConversion = EFalse )
    64     {
    67     {
    65     HBufC* ret = NULL;
    68     HBufC* ret = NULL;
    66 
    69 
    67     RPointerArray<CItemMap>& settingsList = aConfiguration.Settings();    
    70     RPointerArray<CItemMap>& settingsList = aConfiguration.Settings();    
    68     for( TInt i = 0; i < settingsList.Count(); i++ )
    71     for( TInt i = 0; i < settingsList.Count(); i++ )
    84                     continue;
    87                     continue;
    85                     }
    88                     }
    86                 
    89                 
    87                 if( property->Name() == aName )
    90                 if( property->Name() == aName )
    88                     {
    91                     {
    89                     ret = HBufC::NewL( property->Value().Length() );
    92                     if( aUseUtfConversion )
    90                     ret->Des().Copy( property->Value() );
    93                         {
       
    94                         ret = CnvUtfConverter::ConvertToUnicodeFromUtf8L( property->Value() );
       
    95                         }
       
    96                     else
       
    97                         {
       
    98                         ret = HBufC::NewL( property->Value().Length() );
       
    99                         ret->Des().Copy( property->Value() );
       
   100                         }
       
   101                     
    91                     break;
   102                     break;
    92                     }
   103                     }
    93                 }            
   104                 }            
    94             break;
   105             break;
    95             }    
   106             }    
   637         CXnBackgroundManager& bgManager = appui->ViewAdapter().BgManager();
   648         CXnBackgroundManager& bgManager = appui->ViewAdapter().BgManager();
   638         
   649         
   639         // if page specific wallpaper feature is enabled
   650         // if page specific wallpaper feature is enabled
   640         if( bgManager.WallpaperType() == CXnBackgroundManager::EPageSpecific )
   651         if( bgManager.WallpaperType() == CXnBackgroundManager::EPageSpecific )
   641             {
   652             {
   642             HBufC* bgImage = ItemValueL( *configuration, KWallpaper, KPath );
   653             HBufC* bgImage = ItemValueL( *configuration,
       
   654                                          KWallpaper,
       
   655                                          KPath,
       
   656                                          ETrue );
   643             if ( bgImage )
   657             if ( bgImage )
   644                 {
   658                 {
   645                 CleanupStack::PushL( bgImage );
   659                 CleanupStack::PushL( bgImage );
   646                 bgImage->Des().Trim();
   660                 bgImage->Des().Trim();
   647                 if( bgImage && bgImage->Length() > 0 )
   661                 if( bgImage && bgImage->Length() > 0 )