camerauis/cameraapp/generic/src/CamNaviCounterModel.cpp
branchRCL_3
changeset 16 d486e5e3cc9a
parent 7 dbec5787fa68
equal deleted inserted replaced
12:8c55c525d5d7 16:d486e5e3cc9a
   535   iStorageLocation = 
   535   iStorageLocation = 
   536     static_cast<TCamMediaStorage>( iController.IntegerSettingValue( key ) );
   536     static_cast<TCamMediaStorage>( iController.IntegerSettingValue( key ) );
   537     
   537     
   538   if (ECamMediaStorageMassStorage ==iStorageLocation)
   538   if (ECamMediaStorageMassStorage ==iStorageLocation)
   539    {
   539    {
   540    iStorageLocation = iController.ExistMassStorage()?ECamMediaStorageMassStorage:ECamMediaStoragePhone;
   540    iStorageLocation = iController.ExistMassStorage()?
       
   541                        ECamMediaStorageMassStorage:
       
   542                        iController.IntegerSettingValue( ECamSettingItemRemovePhoneMemoryUsage )?
       
   543                        ECamMediaStorageNone:
       
   544                        ECamMediaStoragePhone;
   541    }
   545    }
   542   }
   546   }
   543 
   547 
   544 // ---------------------------------------------------------
   548 // ---------------------------------------------------------
   545 // CCamNaviCounterModel::HandleSelfTimerEvent
   549 // CCamNaviCounterModel::HandleSelfTimerEvent
   891 CCamNaviCounterModel::DrawStorageIconToBitmap( CFbsBitGc& aBmpGc, 
   895 CCamNaviCounterModel::DrawStorageIconToBitmap( CFbsBitGc& aBmpGc, 
   892                                                CFbsBitGc& aBmpMaskGc  ) const
   896                                                CFbsBitGc& aBmpMaskGc  ) const
   893   {
   897   {
   894   CFbsBitmap* icon = NULL;
   898   CFbsBitmap* icon = NULL;
   895   CFbsBitmap* mask = NULL;
   899   CFbsBitmap* mask = NULL;
   896   if ( iStorageLocation == ECamMediaStoragePhone )
   900   switch( iStorageLocation )
   897     {
   901       {
   898     icon = iPhoneIcon;
   902       case ECamMediaStoragePhone:
   899     mask = iPhoneIconMask;
   903           {
   900     }
   904           icon = iPhoneIcon;
   901   else if ( iStorageLocation == ECamMediaStorageMassStorage )
   905           mask = iPhoneIconMask;
   902     {
   906           }
   903     icon = iMassStorageIcon;
   907           break;
   904     mask = iMassStorageIconMask;
   908       case ECamMediaStorageMassStorage:
   905     }
   909           {
   906   else
   910           icon = iMassStorageIcon;
   907     {
   911           mask = iMassStorageIconMask;
   908     icon = iMMCIcon;
   912           }
   909     mask = iMMCIconMask;
   913           break;            
   910     }
   914       case ECamMediaStorageCard:
       
   915           {
       
   916           icon = iMMCIcon;
       
   917           mask = iMMCIconMask;
       
   918           }
       
   919           break;            
       
   920       case ECamMediaStorageNone:
       
   921       default:
       
   922           {
       
   923           //TODO: Get icons when none is available
       
   924           }
       
   925           break;
       
   926       }
   911   // Should use layout                
   927   // Should use layout                
   912   aBmpGc.BitBlt(TPoint(0,0), icon);
   928   aBmpGc.BitBlt(TPoint(0,0), icon);
   913   aBmpMaskGc.BitBlt(TPoint(0,0), mask);
   929   aBmpMaskGc.BitBlt(TPoint(0,0), mask);
   914   }
   930   }
   915 
   931 
   921 void 
   937 void 
   922 CCamNaviCounterModel::DrawStorageIcon( CBitmapContext& aGc ) const
   938 CCamNaviCounterModel::DrawStorageIcon( CBitmapContext& aGc ) const
   923   {
   939   {
   924   CFbsBitmap* icon = NULL;
   940   CFbsBitmap* icon = NULL;
   925   CFbsBitmap* mask = NULL;
   941   CFbsBitmap* mask = NULL;
   926   if ( iStorageLocation == ECamMediaStoragePhone )
   942   switch( iStorageLocation )
   927     {
   943     {
   928     icon = iPhoneIcon;
   944     case ECamMediaStoragePhone:
   929     mask = iPhoneIconMask;
   945         {
   930     }
   946         icon = iPhoneIcon;
   931   else if ( iStorageLocation == ECamMediaStorageMassStorage )
   947         mask = iPhoneIconMask;
   932     {
   948         }
   933     icon = iMassStorageIcon;
   949         break;
   934     mask = iMassStorageIconMask;
   950     case ECamMediaStorageMassStorage:
   935     }
   951         {
   936   else
   952         icon = iMassStorageIcon;
   937     {
   953         mask = iMassStorageIconMask;
   938     icon = iMMCIcon;
   954         }
   939     mask = iMMCIconMask;
   955         break;            
   940     }
   956     case ECamMediaStorageCard:
       
   957         {
       
   958         icon = iMMCIcon;
       
   959         mask = iMMCIconMask;
       
   960         }
       
   961         break;            
       
   962     case ECamMediaStorageNone:
       
   963     default:
       
   964         {
       
   965         //TODO: Get icons when none is available
       
   966         }
       
   967         break;
       
   968     }
       
   969   
       
   970   if( icon == NULL || mask == NULL)
       
   971       {
       
   972       return;
       
   973       }
   941   
   974   
   942   if ( iMode == ECamControllerVideo )
   975   if ( iMode == ECamControllerVideo )
   943     {
   976     {
   944     CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() );    
   977     CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() );    
   945   
   978   
  1248             iController.IntegerSettingValue( key ) );
  1281             iController.IntegerSettingValue( key ) );
  1249     }
  1282     }
  1250   
  1283   
  1251   if (ECamMediaStorageMassStorage ==iStorageLocation)
  1284   if (ECamMediaStorageMassStorage ==iStorageLocation)
  1252     {
  1285     {
  1253     iStorageLocation = iController.ExistMassStorage()?ECamMediaStorageMassStorage:ECamMediaStoragePhone;
  1286     TCamMediaStorage storage = iController.IntegerSettingValue( ECamSettingItemRemovePhoneMemoryUsage )?
       
  1287                                 ECamMediaStorageNone:
       
  1288                                 ECamMediaStoragePhone;
       
  1289     iStorageLocation = iController.ExistMassStorage()?ECamMediaStorageMassStorage:storage;
  1254     }
  1290     }
  1255   UpdateCounter();    
  1291   UpdateCounter();    
  1256 
  1292 
  1257   TRAP_IGNORE( UpdateRecordTimeAvailableL() );
  1293   TRAP_IGNORE( UpdateRecordTimeAvailableL() );
  1258   PRINT( _L("Camera <= CCamNaviCounterModel::ForceNaviPaneUpdate" ))
  1294   PRINT( _L("Camera <= CCamNaviCounterModel::ForceNaviPaneUpdate" ))
  1310            }
  1346            }
  1311         //CreateNaviBitmapsL( ETrue );
  1347         //CreateNaviBitmapsL( ETrue );
  1312         
  1348         
  1313         if (ECamMediaStorageMassStorage ==iStorageLocation)
  1349         if (ECamMediaStorageMassStorage ==iStorageLocation)
  1314           {
  1350           {
  1315           iStorageLocation = iController.ExistMassStorage()?ECamMediaStorageMassStorage:ECamMediaStoragePhone;
  1351           TCamMediaStorage storage = iController.IntegerSettingValue( ECamSettingItemRemovePhoneMemoryUsage )?
       
  1352                                      ECamMediaStorageNone:
       
  1353                                      ECamMediaStoragePhone;  
       
  1354           iStorageLocation = iController.ExistMassStorage()?ECamMediaStorageMassStorage:storage;
  1316           }
  1355           }
  1317         }
  1356         }
  1318       BroadcastEvent( ECamObserverEventNaviModelUpdated );
  1357       BroadcastEvent( ECamObserverEventNaviModelUpdated );
  1319       break;
  1358       break;
  1320       }
  1359       }