diff -r f759b6186ab5 -r 2b4b06654caa imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnailobjectsource.cpp --- a/imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnailobjectsource.cpp Thu Jul 15 18:59:26 2010 +0300 +++ b/imagehandlingutilities/thumbnailmanager/thumbnailclient/src/thumbnailobjectsource.cpp Thu Aug 19 10:13:51 2010 +0300 @@ -24,6 +24,7 @@ // --------------------------------------------------------------------------- // CThumbnailObjectSource::NewL() +// CThumbnailObjectSource::NewLC() // Two-phased constructor. // --------------------------------------------------------------------------- // @@ -36,12 +37,6 @@ return self; } - -// --------------------------------------------------------------------------- -// CThumbnailObjectSource::NewLC() -// Two-phased constructor. -// --------------------------------------------------------------------------- -// EXPORT_C CThumbnailObjectSource* CThumbnailObjectSource::NewLC( const TDesC& aUri, const TDesC& aMimeType ) { @@ -51,11 +46,6 @@ return self; } -// --------------------------------------------------------------------------- -// CThumbnailObjectSource::NewL() -// Two-phased constructor. -// --------------------------------------------------------------------------- -// EXPORT_C CThumbnailObjectSource* CThumbnailObjectSource::NewL( const RFile64& aFile, const TDesC& aMimeType ) { @@ -65,12 +55,6 @@ return self; } - -// --------------------------------------------------------------------------- -// CThumbnailObjectSource::NewLC() -// Two-phased constructor. -// --------------------------------------------------------------------------- -// EXPORT_C CThumbnailObjectSource* CThumbnailObjectSource::NewLC( const RFile64& aFile, const TDesC& aMimeType ) { @@ -80,15 +64,16 @@ return self; } - -EXPORT_C CThumbnailObjectSource* CThumbnailObjectSource::NewL( CFbsBitmap* aBitmap, const TDesC& aUri ) +EXPORT_C CThumbnailObjectSource* CThumbnailObjectSource::NewL( CFbsBitmap* aBitmap, + const TDesC& aUri ) { CThumbnailObjectSource* self = CThumbnailObjectSource::NewLC( aBitmap, aUri ); CleanupStack::Pop( self ); return self; } -EXPORT_C CThumbnailObjectSource* CThumbnailObjectSource::NewLC( CFbsBitmap* aBitmap, const TDesC& aUri ) +EXPORT_C CThumbnailObjectSource* CThumbnailObjectSource::NewLC( CFbsBitmap* aBitmap, + const TDesC& aUri ) { CThumbnailObjectSource* self = new( ELeave )CThumbnailObjectSource(); CleanupStack::PushL( self ); @@ -96,21 +81,60 @@ return self; } -EXPORT_C CThumbnailObjectSource* CThumbnailObjectSource::NewL( TDesC8* aBuffer, TDesC& aMimeType, const TDesC& aUri) +EXPORT_C CThumbnailObjectSource* CThumbnailObjectSource::NewL( TDesC8* aBuffer, + TDesC& aMimeType, const TDesC& aUri) { - CThumbnailObjectSource* self = CThumbnailObjectSource::NewLC( aBuffer, aMimeType, aUri ); + CThumbnailObjectSource* self = CThumbnailObjectSource::NewLC( aBuffer, + aMimeType, aUri ); CleanupStack::Pop( self ); return self; } -EXPORT_C CThumbnailObjectSource* CThumbnailObjectSource::NewLC( TDesC8* aBuffer, TDesC& aMimeType, const TDesC& aUri) +EXPORT_C CThumbnailObjectSource* CThumbnailObjectSource::NewLC( TDesC8* aBuffer, + TDesC& aMimeType, const TDesC& aUri) { CThumbnailObjectSource* self = new( ELeave )CThumbnailObjectSource(); CleanupStack::PushL( self ); self->ConstructL( aBuffer, aMimeType, aUri ); return self; } - + +EXPORT_C CThumbnailObjectSource* CThumbnailObjectSource::NewL( const TDesC& + aUri, const TThumbnailId aThumbnailId, const TDesC& aMimeType ) + { + CThumbnailObjectSource* self = CThumbnailObjectSource::NewLC( aUri, + aThumbnailId, aMimeType ); + CleanupStack::Pop( self ); + return self; + } + +EXPORT_C CThumbnailObjectSource* CThumbnailObjectSource::NewLC( const TDesC& aUri, + const TThumbnailId aThumbnailId, const TDesC& aMimeType ) + { + CThumbnailObjectSource* self = new( ELeave )CThumbnailObjectSource(); + CleanupStack::PushL( self ); + self->ConstructL( aUri, aMimeType, aThumbnailId ); + return self; + } + +EXPORT_C CThumbnailObjectSource* CThumbnailObjectSource::NewL( const TDesC& aUri, + const TDesC& aTargetUri, const TDesC& aMimeType ) + { + CThumbnailObjectSource* self = CThumbnailObjectSource::NewLC( aUri, aTargetUri, + aMimeType ); + CleanupStack::Pop( self ); + return self; + } + +EXPORT_C CThumbnailObjectSource* CThumbnailObjectSource::NewLC( const TDesC& aUri, + const TDesC& aTargetUri, const TDesC& aMimeType ) + { + CThumbnailObjectSource* self = new( ELeave )CThumbnailObjectSource(); + CleanupStack::PushL( self ); + self->ConstructL( aUri, aTargetUri, aMimeType ); + return self; + } + // --------------------------------------------------------------------------- // CThumbnailObjectSource::CThumbnailObjectSource() @@ -134,15 +158,11 @@ iUri = aUri.AllocL(); iMimeType = HBufC8::NewL( aMimeType.Length() ); iMimeType->Des().Copy( aMimeType ); + iThumbnailId = 0; iBitmap = NULL; + iTargetUri = NULL; } - -// --------------------------------------------------------------------------- -// CThumbnailObjectSource::ConstructL() -// Symbian 2nd phase constructor can leave. -// --------------------------------------------------------------------------- -// void CThumbnailObjectSource::ConstructL( const RFile64& aFile, const TDesC& aMimeType ) { @@ -151,26 +171,18 @@ iMimeType->Des().Copy( aMimeType ); iThumbnailId = 0; iBitmap = NULL; + iTargetUri = NULL; } -// --------------------------------------------------------------------------- -// CThumbnailObjectSource::ConstructL() -// Symbian 2nd phase constructor can leave. -// --------------------------------------------------------------------------- -// -void CThumbnailObjectSource::ConstructL( CFbsBitmap* aBitmap, const TDesC& - aUri ) +void CThumbnailObjectSource::ConstructL( CFbsBitmap* aBitmap, const TDesC& + aUri ) { iBitmap = aBitmap; iUri = aUri.AllocL(); iThumbnailId = 0; + iTargetUri = NULL; } -// --------------------------------------------------------------------------- -// CThumbnailObjectSource::ConstructL() -// Symbian 2nd phase constructor can leave. -// --------------------------------------------------------------------------- -// void CThumbnailObjectSource::ConstructL( TDesC8* aBuffer, const TDesC& aMimeType, const TDesC& aUri ) { @@ -180,13 +192,9 @@ iUri = aUri.AllocL(); iThumbnailId = 0; iBitmap = NULL; + iTargetUri = NULL; } -// --------------------------------------------------------------------------- -// CThumbnailObjectSource::ConstructL() -// Symbian 2nd phase constructor can leave. -// --------------------------------------------------------------------------- -// void CThumbnailObjectSource::ConstructL( const TDesC& aUri, const TDesC& aMimeType, TThumbnailId aThumbnailId ) { @@ -194,6 +202,18 @@ iMimeType = HBufC8::NewL( aMimeType.Length() ); iMimeType->Des().Copy( aMimeType ); iThumbnailId = aThumbnailId; + iTargetUri = NULL; + } + +void CThumbnailObjectSource::ConstructL( const TDesC& aUri, const TDesC& + aTargetUri, const TDesC& aMimeType ) + { + iUri = aUri.AllocL(); + iTargetUri = aTargetUri.AllocL(); + iMimeType = HBufC8::NewL( aMimeType.Length() ); + iMimeType->Des().Copy( aMimeType ); + iThumbnailId = 0; + iBitmap = NULL; } @@ -219,12 +239,11 @@ // CThumbnailObjectSourceImpl::FileHandle() // --------------------------------------------------------------------------- // -EXPORT_C RFile64& CThumbnailObjectSource::FileHandle() +EXPORT_C RFile64& CThumbnailObjectSource::FileHandle() { return iFile; } - // --------------------------------------------------------------------------- // CThumbnailObjectSourceImpl::Uri() // --------------------------------------------------------------------------- @@ -271,35 +290,15 @@ return KNullDesC8; } +// --------------------------------------------------------------------------- +// CThumbnailObjectSourceImpl::Id() +// --------------------------------------------------------------------------- +// EXPORT_C TThumbnailId CThumbnailObjectSource::Id() { return iThumbnailId; } -EXPORT_C CThumbnailObjectSource* CThumbnailObjectSource::NewL( const TDesC& -aUri, const TThumbnailId aThumbnailId, const TDesC& aMimeType ) -{ -CThumbnailObjectSource* self = CThumbnailObjectSource::NewLC( aUri, - aThumbnailId, aMimeType ); -CleanupStack::Pop( self ); -return self; - } - - -// --------------------------------------------------------------------------- -// CThumbnailObjectSource::NewLC() -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -EXPORT_C CThumbnailObjectSource* CThumbnailObjectSource::NewLC( const TDesC& aUri, - const TThumbnailId aThumbnailId, const TDesC& aMimeType ) - { - CThumbnailObjectSource* self = new( ELeave )CThumbnailObjectSource(); - CleanupStack::PushL( self ); - self->ConstructL( aUri, aMimeType, aThumbnailId ); - return self; - } - // --------------------------------------------------------------------------- // CThumbnailObjectSourceImpl::Bitmap() // --------------------------------------------------------------------------- @@ -320,4 +319,18 @@ return temp; } +// --------------------------------------------------------------------------- +// CThumbnailObjectSourceImpl::TargetUri() +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC& CThumbnailObjectSource::TargetUri() + { + if ( iTargetUri ) + { + return * iTargetUri; + } + return KNullDesC; + } + + // End of file