imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailcenrep.cpp
branchRCL_3
changeset 20 2b4b06654caa
parent 7 2eb74cf6572e
equal deleted inserted replaced
19:f759b6186ab5 20:2b4b06654caa
    65         case EAudioGridThumbnailSize:
    65         case EAudioGridThumbnailSize:
    66         case EAudioListThumbnailSize:
    66         case EAudioListThumbnailSize:
    67         case EAudioFullScreenThumbnailSize:
    67         case EAudioFullScreenThumbnailSize:
    68             iSourceType = EAudio;
    68             iSourceType = EAudio;
    69             break;
    69             break;
       
    70         case EContactGridThumbnailSize:
       
    71         case EContactListThumbnailSize:
       
    72         case EContactFullScreenThumbnailSize:
       
    73             iSourceType = EContact;
       
    74             break;
    70         default:
    75         default:
    71             iSourceType = EUnknownSourceType;        
    76             iSourceType = EUnknownSourceType;        
    72         }
    77         }
    73 
    78 
    74     }
    79     }
    78 // ---------------------------------------------------------------------------
    83 // ---------------------------------------------------------------------------
    79 //
    84 //
    80 TThumbnailAutoCreate::TThumbnailAutoCreate()
    85 TThumbnailAutoCreate::TThumbnailAutoCreate()
    81     : iImageGrid(EFalse), iImageList(EFalse), iImageFullscreen(EFalse),
    86     : iImageGrid(EFalse), iImageList(EFalse), iImageFullscreen(EFalse),
    82       iVideoGrid(EFalse), iVideoList(EFalse), iVideoFullscreen(EFalse),
    87       iVideoGrid(EFalse), iVideoList(EFalse), iVideoFullscreen(EFalse),
    83       iAudioGrid(EFalse), iAudioList(EFalse), iAudioFullscreen(EFalse)
    88       iAudioGrid(EFalse), iAudioList(EFalse), iAudioFullscreen(EFalse),
       
    89       iContactGrid(EFalse), iContactList(EFalse), iContactFullscreen(EFalse)
    84     {
    90     {
    85     // No implementation required
    91     // No implementation required
    86     }
    92     }
    87 
    93 
    88 // ======== MEMBER FUNCTIONS ========
    94 // ======== MEMBER FUNCTIONS ========
   105 //
   111 //
   106 CThumbnailCenRep::~CThumbnailCenRep()
   112 CThumbnailCenRep::~CThumbnailCenRep()
   107     {
   113     {
   108     iPersistentSizes.Close();
   114     iPersistentSizes.Close();
   109     delete iAutoCreate;
   115     delete iAutoCreate;
       
   116     iAutoCreate = NULL;
   110     delete iRepository;
   117     delete iRepository;
       
   118     iRepository = NULL;
   111     }
   119     }
   112 
   120 
   113 // ---------------------------------------------------------------------------
   121 // ---------------------------------------------------------------------------
   114 // CThumbnailCenRep::NewL()
   122 // CThumbnailCenRep::NewL()
   115 // Two-phased constructor.
   123 // Two-phased constructor.
   201     User::LeaveIfError( iRepository->Get( KSizeAudioFullscreenHeight, ySize ));
   209     User::LeaveIfError( iRepository->Get( KSizeAudioFullscreenHeight, ySize ));
   202     User::LeaveIfError( iRepository->Get( KAutoCreateAudioFullscreen, autoCreate ));
   210     User::LeaveIfError( iRepository->Get( KAutoCreateAudioFullscreen, autoCreate ));
   203     
   211     
   204     iPersistentSizes.AppendL( TThumbnailPersistentSize( EAudioFullScreenThumbnailSize, TSize( xSize, ySize ),
   212     iPersistentSizes.AppendL( TThumbnailPersistentSize( EAudioFullScreenThumbnailSize, TSize( xSize, ySize ),
   205                               flags, static_cast <TDisplayMode> (raw_mode), format, autoCreate, TThumbnailPersistentSize::EFullscreen ));     
   213                               flags, static_cast <TDisplayMode> (raw_mode), format, autoCreate, TThumbnailPersistentSize::EFullscreen ));     
       
   214 
       
   215 // Contact TN, set default values if not found
       
   216     if(iRepository->Get( KSizeContactGridWidth, xSize ) != KErrNone)
       
   217         {
       
   218         xSize = 54;
       
   219         }
       
   220     if( iRepository->Get( KSizeContactGridHeight, ySize ) != KErrNone)
       
   221         {
       
   222         ySize = 54;
       
   223         }
       
   224     
       
   225     if( iRepository->Get( KAutoCreateContactGrid, autoCreate ) != KErrNone)
       
   226     {
       
   227         autoCreate = 1;
       
   228     }
       
   229 
       
   230     iPersistentSizes.AppendL( TThumbnailPersistentSize( EContactGridThumbnailSize, TSize( xSize, ySize ),
       
   231             KGridAndListThumbnailCropped, static_cast <TDisplayMode> (raw_mode), format, autoCreate, TThumbnailPersistentSize::EGrid ));
       
   232     
       
   233     if(  iRepository->Get( KSizeContactListWidth, xSize ) != KErrNone)
       
   234         {
       
   235         xSize = 64;
       
   236         }
       
   237     if(  iRepository->Get( KSizeContactListHeight, ySize ) != KErrNone)
       
   238         {
       
   239         ySize = 64;
       
   240         }
       
   241     if(  iRepository->Get( KAutoCreateContactList, autoCreate ) != KErrNone)
       
   242         {
       
   243         autoCreate = 1;
       
   244         }
       
   245 
       
   246     iPersistentSizes.AppendL( TThumbnailPersistentSize( EContactListThumbnailSize, TSize( xSize, ySize ),
       
   247             KGridAndListThumbnailCropped, static_cast <TDisplayMode> (raw_mode), format, autoCreate, TThumbnailPersistentSize::EList ));
       
   248     
       
   249     if( iRepository->Get( KSizeContactFullscreenWidth, xSize ) != KErrNone)
       
   250         {
       
   251         xSize = 250;
       
   252         }
       
   253     if( iRepository->Get( KSizeContactFullscreenHeight, ySize ) != KErrNone)
       
   254         {
       
   255         ySize = 250;
       
   256         }
       
   257     if( iRepository->Get( KAutoCreateContactFullscreen, autoCreate) != KErrNone)
       
   258         {
       
   259         autoCreate = 1;
       
   260         }
       
   261     
       
   262     iPersistentSizes.AppendL( TThumbnailPersistentSize( EContactFullScreenThumbnailSize, TSize( xSize, ySize ),
       
   263                               flags, static_cast <TDisplayMode> (raw_mode), format, autoCreate, TThumbnailPersistentSize::EFullscreen ));     
       
   264     
   206     
   265     
   207     iAutoCreate = new (ELeave) TThumbnailAutoCreate();
   266     iAutoCreate = new (ELeave) TThumbnailAutoCreate();
   208     
   267     
   209     User::LeaveIfError( iRepository->Get( KAutoCreateImageGrid, iAutoCreate->iImageGrid ));
   268     User::LeaveIfError( iRepository->Get( KAutoCreateImageGrid, iAutoCreate->iImageGrid ));
   210     User::LeaveIfError( iRepository->Get( KAutoCreateImageList, iAutoCreate->iImageList ));
   269     User::LeaveIfError( iRepository->Get( KAutoCreateImageList, iAutoCreate->iImageList ));
   213     User::LeaveIfError( iRepository->Get( KAutoCreateVideoList, iAutoCreate->iVideoList ));
   272     User::LeaveIfError( iRepository->Get( KAutoCreateVideoList, iAutoCreate->iVideoList ));
   214     User::LeaveIfError( iRepository->Get( KAutoCreateVideoFullscreen, iAutoCreate->iVideoFullscreen ));
   273     User::LeaveIfError( iRepository->Get( KAutoCreateVideoFullscreen, iAutoCreate->iVideoFullscreen ));
   215     User::LeaveIfError( iRepository->Get( KAutoCreateAudioGrid, iAutoCreate->iAudioGrid ));
   274     User::LeaveIfError( iRepository->Get( KAutoCreateAudioGrid, iAutoCreate->iAudioGrid ));
   216     User::LeaveIfError( iRepository->Get( KAutoCreateAudioList, iAutoCreate->iAudioList ));
   275     User::LeaveIfError( iRepository->Get( KAutoCreateAudioList, iAutoCreate->iAudioList ));
   217     User::LeaveIfError( iRepository->Get( KAutoCreateAudioFullscreen, iAutoCreate->iAudioFullscreen ));    
   276     User::LeaveIfError( iRepository->Get( KAutoCreateAudioFullscreen, iAutoCreate->iAudioFullscreen ));    
       
   277     
       
   278     if( iRepository->Get( KAutoCreateContactGrid, iAutoCreate->iContactGrid ) != KErrNone )
       
   279         {
       
   280         iAutoCreate->iContactGrid = 1;
       
   281         }
       
   282     if( iRepository->Get( KAutoCreateContactList, iAutoCreate->iContactList ) != KErrNone )
       
   283         {
       
   284         iAutoCreate->iContactList = 1;
       
   285         }
       
   286     if( iRepository->Get( KAutoCreateContactFullscreen, iAutoCreate->iContactFullscreen ) != KErrNone )
       
   287         {
       
   288         iAutoCreate->iContactFullscreen = 1;
       
   289         }
   218     }
   290     }
   219 
   291 
   220 // ---------------------------------------------------------------------------
   292 // ---------------------------------------------------------------------------
   221 // CThumbnailCenRep::GetPersistentSizes()
   293 // CThumbnailCenRep::GetPersistentSizes()
   222 // ---------------------------------------------------------------------------
   294 // ---------------------------------------------------------------------------