# HG changeset patch
# User hgs
# Date 1285590277 -10800
# Node ID 48dd0f169f0df476d94ce732db06ae0761489ea3
# Parent 2e2a89493e2b230c0f789f220203825922f1f599
201035_1
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/3gp_library_api/3gp_library_api.metaxml
--- a/imagehandling_plat/3gp_library_api/3gp_library_api.metaxml Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-
-
- 3GP Library API
- Interface to 3GP file composing and parsing library.
- c++
- 3gplibrary
-
-
-
-
-
-
-
-
- no
- no
-
-
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/3gp_library_api/group/bld.inf
--- a/imagehandling_plat/3gp_library_api/group/bld.inf Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: File that exports the files belonging to
-: 3GP Library API
-*
-*/
-
-
-#include
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-
-../inc/mp4lib.h MW_LAYER_PLATFORM_EXPORT_PATH(mp4lib.h)
-../inc/mp4config.h MW_LAYER_PLATFORM_EXPORT_PATH(mp4config.h)
-../inc/3GPMP4Lib.iby CORE_MW_LAYER_IBY_EXPORT_PATH(3GPMP4Lib.iby)
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/3gp_library_api/inc/3GPMP4Lib.iby
--- a/imagehandling_plat/3gp_library_api/inc/3GPMP4Lib.iby Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
-* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Iby file for 3GPMP4Lib.
-*
-*/
-
-
-#ifndef __3GPMP4LIB_IBY__
-#define __3GPMP4LIB_IBY__
-
-// 3GP/MP4 File Format Library
-
-// Utilizing constants from data_caging_paths_for_iby.hrh, included in higher level
-file=ABI_DIR\BUILD_DIR\3GPMP4LIB.DLL SHARED_LIB_DIR\3GPMP4LIB.DLL
-
-//data=ZSYSTEM\install\3GPMP4LibStub.sis system\install\3GPMP4LibStub.sis
-
-#endif //__3GPMP4LIB_IBY__
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/3gp_library_api/inc/mp4config.h
--- a/imagehandling_plat/3gp_library_api/inc/mp4config.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-/*
-* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: The operating system specific variables have been collected in this file
-*
-*/
-
-// transition header for 3GPMP4Lib clients, new location:
-#include <3gplibrary/mp4config.h>
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/3gp_library_api/inc/mp4lib.h
--- a/imagehandling_plat/3gp_library_api/inc/mp4lib.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-/*
-* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: This file is included by the library user.
-*
-*/
-
-// transition header for 3GPMP4Lib clients, new location:
-#include <3gplibrary/mp4lib.h>
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/group/bld.inf
--- a/imagehandling_plat/group/bld.inf Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Includes all the Domain API specific bld.inf files, which
-* export files.
-*
-*/
-
-
-
-#include "../image_handling_library_api/group/bld.inf"
-#include "../3gp_library_api/group/bld.inf"
-#include "../thumbnailmanager_api/group/bld.inf"
-
-
-
-// End of File
-
-
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/image_handling_library_api/group/bld.inf
--- a/imagehandling_plat/image_handling_library_api/group/bld.inf Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: File that exports the files belonging to
-: Image Handling Library API
-*
-*/
-
-
-#include
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-
-../inc/IHLProcessorFactory.h MW_LAYER_PLATFORM_EXPORT_PATH(IHLProcessorFactory.h)
-../inc/IHLBitmapUtil.h MW_LAYER_PLATFORM_EXPORT_PATH(IHLBitmapUtil.h)
-../inc/MIHLBitmap.h MW_LAYER_PLATFORM_EXPORT_PATH(MIHLBitmap.h)
-../inc/MIHLImage.h MW_LAYER_PLATFORM_EXPORT_PATH(MIHLImage.h)
-../inc/MIHLProcessor.h MW_LAYER_PLATFORM_EXPORT_PATH(MIHLProcessor.h)
-../inc/IHLViewerFactory.h MW_LAYER_PLATFORM_EXPORT_PATH(IHLViewerFactory.h)
-../inc/MIHLScaler.h MW_LAYER_PLATFORM_EXPORT_PATH(MIHLScaler.h)
-../inc/IHLImageFactory.h MW_LAYER_PLATFORM_EXPORT_PATH(IHLImageFactory.h)
-../inc/MIHLBitmapProcessor.h MW_LAYER_PLATFORM_EXPORT_PATH(MIHLBitmapProcessor.h)
-../inc/MIHLViewer.h MW_LAYER_PLATFORM_EXPORT_PATH(MIHLViewer.h)
-../inc/MIHLViewerObserver.h MW_LAYER_PLATFORM_EXPORT_PATH(MIHLViewerObserver.h)
-../inc/MIHLFileImage.h MW_LAYER_PLATFORM_EXPORT_PATH(MIHLFileImage.h)
-../inc/TIHLInterfaceType.h MW_LAYER_PLATFORM_EXPORT_PATH(TIHLInterfaceType.h)
-../inc/IHLInterfaceIds.h MW_LAYER_PLATFORM_EXPORT_PATH(IHLInterfaceIds.h)
-../inc/MIHLImageViewer.h MW_LAYER_PLATFORM_EXPORT_PATH(MIHLImageViewer.h)
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/image_handling_library_api/image_handling_library_api.metaxml
--- a/imagehandling_plat/image_handling_library_api/image_handling_library_api.metaxml Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-
-
- Image Handling Library API
- An interface for viewing images
- c++
- imagehandlinglib
-
-
-
-
-
-
-
-
- no
- no
-
-
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/image_handling_library_api/inc/IHLBitmapUtil.h
--- a/imagehandling_plat/image_handling_library_api/inc/IHLBitmapUtil.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,157 +0,0 @@
-/*
-* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Static utility class for synchronous CFbsBitmap operations.
-*
-*/
-
-
-#ifndef IHLBITMAPUTIL_H
-#define IHLBITMAPUTIL_H
-
-// INCLUDES
-#include
-
-// FORWARD DECLARATION
-class CFbsBitmap;
-
-// CLASS DECLARATION
-/**
-* IHLBitmapUtil
-*
-* Static utility class for synchronous CFbsBitmap operations.
-* @lib IHL.lib
-* @since 3.0
-*/
-class IHLBitmapUtil
- {
- public:
-
- /**
- * Create new bitmap instance using
- * same server handle as in given bitmap.
- * Note that modifying bitmap content will also change
- * all other bitmap content that has same server handle.
- * @since 3.0
- * @param aBitmap Duplicated bitmap reference.
- * @return Duplicated CFbsBitmap instance.
- */
- IMPORT_C static CFbsBitmap* DuplicateBitmapL( const CFbsBitmap& aBitmap );
-
- /**
- * Create new bitmap instance using
- * same server handle as in given bitmap.
- * Note that modifying bitmap content will also change
- * all other bitmap content that has same server handle.
- * New instance is pushed into CleanupStack.
- * @since 3.0
- * @param aBitmap Duplicated bitmap reference.
- * @return Duplicated CFbsBitmap instance.
- */
- IMPORT_C static CFbsBitmap* DuplicateBitmapLC( const CFbsBitmap& aBitmap );
-
- /**
- * Copy bitmap into new same sized bitmap.
- * New bitmap has unique server handle and it can be
- * modified without risk of changes in given source bitmap.
- * @since 3.0
- * @param aBitmap Copied bitmap reference.
- * @return Copied CFbsBitmap instance.
- */
- IMPORT_C static CFbsBitmap* CopyBitmapL( const CFbsBitmap& aBitmap );
-
- /**
- * Copy bitmap into new same sized bitmap.
- * New bitmap has unique server handle and it can be
- * modified without risk of changes in given source bitmap.
- * New instance is pushed into CleanupStack.
- * @since 3.0
- * @param aBitmap Copied bitmap reference.
- * @return Copied CFbsBitmap instance.
- */
- IMPORT_C static CFbsBitmap* CopyBitmapLC( const CFbsBitmap& aBitmap );
-
- /**
- * Copy user defined area from source bitmap into new bitmap.
- * New bitmap has unique server handle and it can be
- * modified without risk of changes in given source bitmap.
- * @since 3.0
- * @param aBitmap Source bitmap reference.
- * @param aRect Copied rectangle from source bitmap.
- * @return Copied CFbsBitmap instance, size of given rect.
- */
- IMPORT_C static CFbsBitmap* CopyBitmapL( const CFbsBitmap& aBitmap, const TRect& aRect );
-
- /**
- * Copy user defined area from source bitmap into new bitmap.
- * New bitmap has unique server handle and it can be
- * modified without risk of changes in given source bitmap.
- * New instance is pushed into CleanupStack.
- * @since 3.0
- * @param aBitmap Source bitmap reference.
- * @param aRect Copied rectangle from source bitmap.
- * @return Copied CFbsBitmap instance, size of given rect.
- */
- IMPORT_C static CFbsBitmap* CopyBitmapLC( const CFbsBitmap& aBitmap, const TRect& aRect );
-
- /**
- * Synchronous bitmap scaler. Use only with small bitmaps!
- * Prefer asynchronous MIHLScaler instead.
- *
- * Scale source bitmap into destination bitmap.
- * @since 3.0
- * @param aSrcBitmap Source bitmap reference.
- * @param aDstBitmap Destination bitmap reference.
- * If destination bitmap has null handle,
- * processor will create new bitmap using size of
- * destination rectangle.
- * @param aOptions Reserved for future use.
- * @return Return system wide error codes:
- * KerrArgument - source bitmap is empty (handle is null).
- * - destination bitmap displaymode differs
- * from source bitmap displaymode.
- */
- IMPORT_C static TInt ScaleBitmap( const CFbsBitmap& aSrcBitmap, CFbsBitmap& aDstBitmap,
- TUint32 aOptions = 0 );
-
- /**
- * Synchronous bitmap scaler. Use only with small bitmaps!
- * Prefer asynchronous MIHLScaler instead.
- *
- * Scale rectangle from source bitmap to a rectangle
- * in destination bitmap. Scaled area can be also
- * rotated and/or mirrored during process.
- * See full usage description from MIHLScaler header.
- * @since 3.0
- * @param aSrcBitmap Source bitmap reference.
- * @param aSrcRect Rectangle that is processed from source bitmap.
- * @param aDstBitmap Destination bitmap reference.
- * If destination bitmap has null handle,
- * processor will create new bitmap using size of
- * destination rectangle.
- * @param aDstRect Rectangle that is filled in destination bitmap.
- * @param aOptions Reserved for future use.
- * @return Return system wide error codes:
- * KerrArgument - rectangles are outside of bitmap area.
- * - source bitmap is empty (handle is null).
- * - destination bitmap displaymode differs
- * from source bitmap displaymode.
- */
- IMPORT_C static TInt ScaleBitmap( const CFbsBitmap& aSrcBitmap, const TRect& aSrcRect,
- CFbsBitmap& aDstBitmap, const TRect& aDstRect,
- TUint32 aOptions = 0 );
- };
-
-#endif // IHLBITMAPUTIL_H
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/image_handling_library_api/inc/IHLImageFactory.h
--- a/imagehandling_plat/image_handling_library_api/inc/IHLImageFactory.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,176 +0,0 @@
-/*
-* Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Static factory class for creating image instances.
-*
-*/
-
-
-#ifndef IHLIMAGEFACTORY_H
-#define IHLIMAGEFACTORY_H
-
-// INCLUDES
-#include
-
-// FORWARD DECLARATION
-class RFs;
-class RFile;
-class MIHLFileImage;
-
-// CLASS DECLARATION
-/**
-* IHLImageFactory
-*
-* Static factory class for creating file instances.
-* @lib IHL.lib
-* @since 3.0
-*/
-class IHLImageFactory
- {
- public:
-
- /**
- * Open file and create new image instance.
- * Default filemode is EFileShareReadersOnly and if opening fails, EFileShareAny is used.
- * Method leaves with appropriate error code if file could not be opened.
- * If file is multi-image, new image contains handle to the first image.
- *
- * Note! Method may leave with KErrBadHandle if RFs::ShareProtected() method is not called!
- *
- * @since 3.0
- * @param aFs Fileserver reference.
- * @param aFilename Full path of image file.
- * @return New image instance.
- */
- IMPORT_C static MIHLFileImage* OpenFileImageL( RFs& aFs, const TDesC& aFilename );
-
- /**
- * Open file and create new image instance.
- * Default filemode is EFileShareReadersOnly and if opening fails, EFileShareAny is used.
- * Method leaves with appropriate error code if
- * file could not be opened or index is out of bounds.
- *
- * Note! Method may leave with KErrBadHandle if RFs::ShareProtected() method is not called!
- *
- * @since 3.0
- * @param aFs Fileserver reference.
- * @param aFilename Full path of image file.
- * @param aImageIndex Image index. This is used in multi-image
- * file to determine which image is opened.
- * @return New image instance.
- */
- IMPORT_C static MIHLFileImage* OpenFileImageL( RFs& aFs, const TDesC& aFilename,
- TInt aImageIndex );
-
- /**
- * Open file and create new image instance.
- * Default filemode is EFileShareReadersOnly and if opening fails, EFileShareAny is used.
- * Method leaves with appropriate error code if
- * file could not be opened or index is out of bounds.
- *
- * Note! Method may leave with KErrBadHandle if RFs::ShareProtected() method is not called!
- *
- * @since 3.0
- * @param aFs Fileserver reference.
- * @param aFilename Full path of image file.
- * @param aImageIndex Image index. This is used in multi-image
- * file to determine which image is opened.
- * @param aOptions Special opening options. Refer to MIHLFileImage header.
- * @return New image instance.
- */
- IMPORT_C static MIHLFileImage* OpenFileImageL( RFs& aFs, const TDesC& aFilename,
- TInt aImageIndex, const TUint32 aOptions );
-
- /**
- * Create new image instance.
- * Method leaves with appropriate error code if file type is unknown.
- * @since 3.0
- * @param aFile Open file handle.
- * @return New image instance.
- */
- IMPORT_C static MIHLFileImage* OpenFileImageL( RFile& aFile );
-
- /**
- * Create new image instance.
- * Method leaves with appropriate error code if
- * file type is unknown or index is out of bounds.
- * @since 3.0
- * @param aFile Open file handle.
- * @param aImageIndex Image index. This is used in multi-image
- * file to determine which image is opened.
- * @return New image instance.
- */
- IMPORT_C static MIHLFileImage* OpenFileImageL( RFile& aFile, TInt aImageIndex );
-
- /**
- * Create new image instance.
- * Method leaves with appropriate error code if
- * file type is unknown or index is out of bounds.
- * @since 3.0
- * @param aFile Open file handle.
- * @param aImageIndex Image index. This is used in multi-image
- * file to determine which image is opened.
- * @param aOptions Special opening options. Refer to MIHLFileImage header.
- * @return New image instance.
- */
- IMPORT_C static MIHLFileImage* OpenFileImageL( RFile& aFile, TInt aImageIndex,
- const TUint32 aOptions );
-
- /**
- * Create new image instance from buffered image data.
- * Method leaves with appropriate error code if buffer data could not be used.
- * If buffer contains multi-image, created image instance contains handle to
- * the first image.
- * @since 3.0
- * @param aFs Fileserver reference.
- * @param aDataBuf Buffer reference.
- * @return New image instance.
- */
- IMPORT_C static MIHLFileImage* OpenBufferedFileImageL( RFs& aFs, const TDesC8& aDataBuf );
-
- /**
- * Create new image instance from buffered image data.
- * Method leaves with appropriate error code if buffer data could not be used
- * or image index is out of bounds. If buffer contains multi-image, created
- * image instance contains handle to the first image.
- * @since 3.0
- * @param aFs Fileserver reference.
- * @param aDataBuf Buffer reference.
- * @param aImageIndex Image index. This is used in multi-image
- * file to determine which image is opened.
- * @return New image instance.
- */
- IMPORT_C static MIHLFileImage* OpenBufferedFileImageL( RFs& aFs, const TDesC8& aDataBuf,
- TInt aImageIndex );
-
- /**
- * Create new image instance from buffered image data.
- * Method leaves with appropriate error code if buffer data could not be used
- * or image index is out of bounds. If buffer contains multi-image, created
- * image instance contains handle to the first image.
- * @since 3.0
- * @param aFs Fileserver reference.
- * @param aDataBuf Buffer reference.
- * @param aImageIndex Image index. This is used in multi-image
- * file to determine which image is opened.
- * @param aOptions Special opening options. Refer to MIHLFileImage header.
- * @return New image instance.
- */
- IMPORT_C static MIHLFileImage* OpenBufferedFileImageL( RFs& aFs, const TDesC8& aDataBuf,
- TInt aImageIndex, const TUint32 aOptions );
-
- };
-
-#endif // IHLIMAGEFACTORY_H
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/image_handling_library_api/inc/IHLInterfaceIds.h
--- a/imagehandling_plat/image_handling_library_api/inc/IHLInterfaceIds.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
-* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Interface id's used in IHL interfaces.
-*
-*/
-
-
-#ifndef IHLINTERFACEIDS_H
-#define IHLINTERFACEIDS_H
-
-// INCLUDES
-#include
-
-// -----------------------------------------------------------------------------
-// INTERFACE IDs
-// -----------------------------------------------------------------------------
-//
-// Images
-const TInt KIHLInterfaceIdFileImage = 0x0100;
-
-// Processors
-const TInt KIHLInterfaceIdBitmapProcessor = 0x0200;
-
-// Viewers
-const TInt KIHLInterfaceIdImageViewer = 0x0300;
-
-// Filters (reserved)
-// const TInt KIHLInterfaceIdFilter = 0x0400; // CSI: 13 #
-
-#endif // IHLINTERFACEIDS_H
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/image_handling_library_api/inc/IHLProcessorFactory.h
--- a/imagehandling_plat/image_handling_library_api/inc/IHLProcessorFactory.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
-* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Static factory class for creating processors.
-*
-*/
-
-
-#ifndef IHLPROCESSORFACTORY_H
-#define IHLPROCESSORFACTORY_H
-
-// INCLUDES
-#include
-
-// FORWARD DECLARATION
-class MIHLBitmapProcessor;
-
-// CLASS DECLARATION
-/**
-* IHLProcessorFactory
-*
-* Static factory class for creating processors.
-* @lib IHL.lib
-* @since 3.0
-*/
-class IHLProcessorFactory
- {
- public:
-
- /**
- * Create new MIHLBitmapProcessor instance.
- * @since 3.0
- * @param aOptions Special options for bitmap processing. Refer to MIHLBitmapProcessor header.
- * @return New MIHLBitmapProcessor instance.
- */
- IMPORT_C static MIHLBitmapProcessor* CreateBitmapProcessorL( const TUint32 aOptions = 0 );
- };
-
-#endif // IHLPROCESSORFACTORY_H
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/image_handling_library_api/inc/IHLViewerFactory.h
--- a/imagehandling_plat/image_handling_library_api/inc/IHLViewerFactory.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
-* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Static factory class for creating viewers.
-*
-*/
-
-
-#ifndef IHLVIEWERFACTORY_H
-#define IHLVIEWERFACTORY_H
-
-// INCLUDES
-#include
-
-// FORWARD DECLARATION
-class MIHLImageViewer;
-class MIHLViewerObserver;
-class MIHLImage;
-class MIHLBitmap;
-
-// CLASS DECLARATION
-/**
-* IHLViewerFactory
-*
-* Static factory class for creating viewers.
-* @lib IHL.lib
-* @since 3.0
-*/
-class IHLViewerFactory
- {
- public:
-
- /**
- * Create new MIHLImageViewer instance.
- * References to image, bitmap and observer must remain valid
- * through viewer lifespan. Note that viewer start processing
- * immediately after it's created.
- * @since 3.0
- * @param aViewerSize Size of viewer. This is also maximum
- * size of destination bitmap.
- * @param aSource Source image reference.
- * @param aDestination Destination bitmap reference.
- * @param aObserver Viewer observer reference.
- * @param aOptions Viewer options. Refer to MIHLImageViewer header.
- * @return New MIHLImageViewer instance.
- */
- IMPORT_C static MIHLImageViewer* CreateImageViewerL( const TSize& aViewerSize,
- MIHLImage& aSource,
- MIHLBitmap& aDestination,
- MIHLViewerObserver& aObserver,
- const TUint32 aOptions = 0 );
- };
-
-#endif // IHLVIEWERFACTORY_H
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/image_handling_library_api/inc/MIHLBitmap.h
--- a/imagehandling_plat/image_handling_library_api/inc/MIHLBitmap.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,196 +0,0 @@
-/*
-* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Pure virtual interface to bitmap and mask container.
-*
-*/
-
-
-#ifndef MIHLBITMAP_H
-#define MIHLBITMAP_H
-
-// INCLUDES
-#include
-
-// FORWARD DECLARATION
-class MIHLBitmap;
-class CBitmapContext;
-class CFbsBitmap;
-
-
-// FACTORY DECLARATION
-class IHLBitmap
- {
- public:
-
- /**
- * Create new MIHLBitmap instance.
- * @since 3.0
- * @return New default MIHLBitmap instance.
- */
- IMPORT_C static MIHLBitmap* CreateL();
-
- };
-
-// CLASS DECLARATION
-/**
-* MIHLBitmap
-*
-* Pure virtual interface to bitmap and mask container.
-*
-* If interface needs to be pushed into CleanupStack,
-* remember to use CleanupStackDeletePushL() function!
-* DO NOT USE CleanupStack::PushL()!!
-*
-* @lib IHL.lib
-* @since 3.0
-*/
-class MIHLBitmap
- {
- public:
-
- /**
- * Virtual destructor.
- */
- virtual ~MIHLBitmap() {}
-
- public:
-
- /**
- * Create new bitmap.
- * @since 3.0
- * @param aSize Bitmap size.
- * @param aDisplayMode Bitmap displaymode.
- * @return KErrArgument if size is negative or displaymode is not supported.
- * Otherwise system wide error codes.
- */
- virtual TInt Create( const TSize& aSize, TDisplayMode aDisplayMode ) = 0;
-
- /**
- * Create new bitmap and mask.
- * @since 3.0
- * @param aSize Bitmap and mask size.
- * @param aBitmapDisplayMode Bitmap displaymode.
- * @param aMaskDisplayMode Mask displaymode (EGray2 or EGray256)
- * @return KErrArgument if size is negative or displaymode is not supported.
- * Otherwise system wide error codes.
- */
- virtual TInt Create( const TSize& aSize, TDisplayMode aBitmapDisplayMode,
- TDisplayMode aMaskDisplayMode ) = 0;
-
- /**
- * Copy or duplicate bitmap.
- * Copied bitmap has unique server handle and it can be
- * modified without risk of changes in given source bitmap.
- * Duplicated bitmap has same server handle than source bitmap
- * and modifying duplicated bitmap will also modify source bitmap.
- * @since 3.0
- * @param aBitmap Source bitmap that is copied or duplicated.
- * @param aDuplicate ETrue to duplicate, EFalse to copy.
- * @return System wide error codes.
- */
- virtual TInt Copy( const CFbsBitmap& aBitmap, TBool aDuplicate ) = 0;
-
- /**
- * Copy or duplicate bitmap and mask.
- * Copied bitmaps has unique server handles and they can be
- * modified without risk of changes in given source bitmaps.
- * Duplicated bitmaps has same server handles than source bitmaps
- * and modifying duplicated bitmaps will also modify source bitmaps.
- * @since 3.0
- * @param aBitmap Source bitmap that is copied or duplicated.
- * @param aBitmap Source aMask that is copied or duplicated.
- * @param aDuplicate ETrue to duplicate, EFalse to copy.
- * @return System wide error codes.
- */
- virtual TInt Copy( const CFbsBitmap& aBitmap, const CFbsBitmap& aMask, TBool aDuplicate ) = 0;
-
- /**
- * Copy or duplicate MIHLBitmap.
- * Copied bitmaps has unique server handles and they can be
- * modified without risk of changes in given source bitmaps.
- * Duplicated bitmaps has same server handles than source bitmaps
- * and modifying duplicated bitmaps will also modify source bitmaps.
- * @since 3.0
- * @param aBitmap Source MIHLBitmap that is copied or duplicated.
- * @param aDuplicate ETrue to duplicate, EFalse to copy.
- * @return System wide error codes.
- */
- virtual TInt Copy( const MIHLBitmap& aBitmap, TBool aDuplicate ) = 0;
-
- /**
- * Release bitmap and mask server handles.
- * Create() and Copy() methods will call this
- * automatically if any old bitmaps exist.
- * @since 3.0
- */
- virtual void Reset() = 0;
-
- /**
- * Check if bitmap is created or copied.
- * This checks that bitmap handle is valid and exist.
- * @since 3.0
- * @return ETrue if bitmap exist, EFalse if bitmap handle is zero.
- */
- virtual TBool IsCreated() const = 0;
-
- /**
- * Return bitmap reference.
- * Use MIHLBitmap::IsCreated() method
- * to check if bitmap actually exist.
- * @since 3.0
- * @return Reference to bitmap.
- */
- virtual const CFbsBitmap& Bitmap() const = 0;
-
- /**
- * Check if mask bitmap handle is valid and exist.
- * @since 3.0
- * @return ETrue if mask exist, EFalse if mask handle is zero.
- */
- virtual TBool HasMask() const = 0;
-
- /**
- * Return mask reference.
- * Use MIHLBitmap::HasMask() method
- * to check if mask actually exist.
- * @since 3.0
- * @return Reference to mask.
- */
- virtual const CFbsBitmap& Mask() const = 0;
-
- /**
- * Draw bitmap to bitmap context.
- * If bitmaps are not created, method does nothing.
- * @param aContext Bitmap context where bitmap is drawn.
- * @param aPoint Draw position.
- * @since 3.0
- */
- virtual void Draw( CBitmapContext& aContext, const TPoint& aPoint ) const = 0;
-
- /**
- * Draw bitmap to bitmap context.
- * If bitmaps are not created, method does nothing.
- * @param aContext Bitmap context where bitmap is drawn.
- * @param aPoint Draw position.
- * @param aSourceRect Source rectangle that is drawn.
- * @since 3.0
- */
- virtual void Draw( CBitmapContext& aContext, const TPoint& aPoint,
- const TRect& aSourceRect ) const = 0;
-
- };
-
-#endif // MIHLBITMAP_H
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/image_handling_library_api/inc/MIHLBitmapProcessor.h
--- a/imagehandling_plat/image_handling_library_api/inc/MIHLBitmapProcessor.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,115 +0,0 @@
-/*
-* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Pure virtual interface to scaling processor
-* : using MIHLBitmaps.
-*
-*/
-
-
-#ifndef MIHLBITMAPPROCESSOR_H
-#define MIHLBITMAPPROCESSOR_H
-
-// INCLUDES
-#include
-
-// FORWARD DECLARATION
-class MIHLBitmap;
-class MIHFilter;
-
-// CLASS DECLARATION
-/**
-* MIHLBitmapProcessor
-*
-* Pure virtual interface to scaling processor using MIHLBitmaps.
-*
-* If interface needs to be pushed into CleanupStack,
-* remember to use CleanupStackDeletePushL() function!
-* DO NOT USE CleanupStack::PushL()!!
-*
-* @lib IHL.lib
-* @since 3.0
-*/
-class MIHLBitmapProcessor : public MIHLProcessor
- {
- public:
-
- /**
- * Virtual destructor.
- */
- virtual ~MIHLBitmapProcessor() {}
-
- public:
-
- /**
- * Flags to control scaler functionality.
- * These can be combined using an OR operation.
- * @since 3.0
- */
- enum TOptions
- {
- EOptionUseBilinearInterpolation = 0x01,
- };
-
- public:
-
- /**
- * Process rectangle from source bitmap to a rectangle
- * in destination bitmap. Scaled area can be also
- * rotated and/or mirrored during process.
- * See full description from MIHLScaler header.
- * @since 3.0
- * @param aStatus Process request status reference.
- * @param aSrcBitmap Source bitmap reference.
- * @param aSrcRect Rectangle that is processed from source bitmap.
- * @param aDstBitmap Destination bitmap reference.
- * @param aDstRect Rectangle that is filled in destination bitmap.
- * @return Return system wide error codes:
- * KErrArgument - rectangles are outside of bitmap area.
- * - source bitmap is empty (handle is null).
- * - destination bitmap is empty (handle is null).
- * - destination bitmap displaymode differs
- * from source bitmap displaymode.
- * KErrBusy - processor has request pending already.
- */
- virtual TInt Process( TRequestStatus& aStatus,
- const MIHLBitmap& aSrcBitmap,
- const TRect& aSrcRect,
- MIHLBitmap& aDstBitmap,
- const TRect& aDstRect ) = 0;
-
- /**
- * Check if processor has request pending.
- * @since 3.0
- * @return ETrue if request is pending, EFalse if not.
- */
- virtual TBool IsBusy() const = 0;
-
- /**
- * Cancel pending request.
- * If not active, method does nothing.
- * @since 3.0
- */
- virtual void CancelProcess() = 0;
-
- /**
- * Set filter.
- * For future use, not used currently!
- * @since 3.0
- */
- virtual void SetFilter( MIHFilter* aFilter ) = 0;
- };
-
-#endif // MIHLBITMAPPROCESSOR_H
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/image_handling_library_api/inc/MIHLFileImage.h
--- a/imagehandling_plat/image_handling_library_api/inc/MIHLFileImage.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,238 +0,0 @@
-/*
-* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Pure virtual interface for file based image class.
-* : This class acts as a window into single image or animation
-* : in one physical file. Note that file will be locked as long
-* : as instance of this class is present.
-*
-*/
-
-
-#ifndef MIHLFILEIMAGE_H
-#define MIHLFILEIMAGE_H
-
-// INCLUDES
-#include
-#include
-
-// FORWARD DECLARATION
-class MIHLBitmap;
-class MIHLFilter;
-
-// CLASS DECLARATION
-/**
-* MIHLFileImage
-*
-* Pure virtual interface for file based image class.
-* This class acts as a window into single image or animation
-* in one physical file. Note that file will be locked as long
-* as instance of this class is present.
-*
-* If interface needs to be pushed into CleanupStack,
-* remember to use CleanupDeletePushL() function!
-* DO NOT USE CleanupStack::PushL()!!
-*
-* @lib IHL.lib
-* @since 3.0
-*/
-class MIHLFileImage : public MIHLImage
- {
- public:
-
- /**
- * Virtual destructor.
- */
- virtual ~MIHLFileImage() {}
-
- public:
-
- /**
- * Flags to control file image functionality.
- * These can be combined using an OR operation.
- * @since 3.0
- */
- enum TOptions
- {
- EOptionNoDRMConsume = 0x01,
- };
-
- public:
-
- /**
- * Return image type's unique identifier.
- * @since 3.0
- * @return Image type Uid.
- */
- virtual const TUid& ImageType() const = 0;
-
- /**
- * Return image subtype's unique identifier.
- * @since 3.0
- * @return Image subtype Uid.
- */
- virtual const TUid& ImageSubType() const = 0;
-
- /**
- * Return image index of this instance from source file.
- * Note that animation is counted as an single image.
- * @since 3.0
- * @return Index of this instance.
- */
- virtual TInt ImageIndex() const = 0;
-
- /**
- * Return count of images in source file.
- * Note that animation is counted as an single image.
- * @since 3.0
- * @return Count of images in source file.
- */
- virtual TInt ImageCount() const = 0;
-
-
- /**
- * Return image size.
- * @since 3.0
- * @return Image size in pixels.
- */
- virtual TSize Size() const = 0;
-
- /**
- * Return preferred display mode for image.
- * Note that this display mode may differ from images original
- * display mode. Image processing may
- * need more colors than image has originally.
- * @since 3.0
- * @return Preferred image display mode.
- */
- virtual TDisplayMode DisplayMode() const = 0;
-
- /**
- * Return display mode of mask bitmap.
- * If image doesn't support transparency, ENone is returned.
- * @since 3.0
- * @return ENone if image is not transparent.
- * Mask display mode if image has transparency.
- */
- virtual TDisplayMode MaskDisplayMode() const = 0;
-
- /**
- * Return image background color.
- * @since 3.0
- * @return Image background color.
- */
- virtual TRgb BackgroundColor() const = 0;
-
- /**
- * Return array of fixed load sizes which can
- * be used in bitmap loading operation.
- * Array contain only sizes that differs from image original size.
- * If image can be loaded only to original size or it's fully
- * scaleable, array is empty.
- * Sizes starts from smallest and ends at largest.
- * @since 3.0
- * @return Array of supported image load sizes.
- */
- virtual const RArray& CustomLoadSizeArray() const = 0;
-
- /**
- * Check if image can be loaded directly into any given load size.
- * @since 3.0
- * @return Array of supported image load sizes.
- */
- virtual TBool IsFullyScaleable() const = 0;
-
- /**
- * Check if image is animated.
- * @since 3.0
- * @return ETrue if image is animated, EFalse if not.
- */
- virtual TBool IsAnimation() const = 0;
-
- /**
- * Return animation frame count.
- * If image is not animated, it has no animation frames either.
- * @since 3.0
- * @return Animation frame count.
- */
- virtual TInt AnimationFrameCount() const = 0;
-
- /**
- * Return animation frame delay.
- * If image is not animated, it has no animation frames either.
- * @since 3.0
- * @param aAnimationFrameIndex Animation frame index.
- * @return Animation frame delay.
- */
- virtual TTimeIntervalMicroSeconds32 AnimationFrameDelay( TInt aAnimationFrameIndex ) const = 0;
-
- /**
- * Load image into bitmap.
- * If using scale support, given bitmap must be created with wanted size
- * from CustomLoadSizeArray(). Displaymode can be get from Displaymode() method.
- * Mask bitmap is always reseted. It's recreated if image is transparent by using
- * size of given bitmap and displaymode from MaskDisplayMode() method.
- * If image is animated, first animation frame is loaded.
- * @since 3.0
- * @param aStatus Load request status reference.
- * @param aDestination Destination bitmap reference.
- * @param aFrameIndex for loading single frame from image
- * @return Return system wide error codes:
- * KerrArgument if given bitmap is not created or it's size is incorrect.
- * KErrBusy image has load request pending already.
- */
- virtual TInt Load( TRequestStatus& aStatus, MIHLBitmap& aDestination, TInt aFrameIndex = 0 ) = 0;
-
- /**
- * Load animation frame into bitmap.
- * If using scale support, given bitmap must be created with wanted size
- * from CustomLoadSizeArray(). Displaymode can be get from Displaymode() method.
- * Because some animations are build on top of previous frames, passing already loaded previous
- * frame as a destination bitmap will increase load speed of next frames.
- * Method will panic if given animation frame index is out of bounds.
- * @since 3.0
- * @param aStatus Load request status reference.
- * @param aDestination Destination bitmap reference.
- * @param aAnimationFrameIndex Animation frame index.
- * @return Return system wide error codes:
- * KErrArgument if given bitmap is not created or it's size is incorrect.
- * KErrBusy image has load request pending already.
- */
- virtual TInt LoadAnimation( TRequestStatus& aStatus, MIHLBitmap& aDestination,
- TInt aAnimationFrameIndex ) = 0;
-
- /**
- * Check if image has load request pending.
- * @since 3.0
- * @return ETrue if request is pending, EFalse if not.
- */
- virtual TBool IsBusy() const = 0;
-
- /**
- * Cancel pending load request.
- * If not active, method does nothing.
- * @since 3.0
- */
- virtual void CancelLoad() = 0;
-
- /**
- * Set filter.
- * For future use, not used currently!
- * @since 3.0
- */
- virtual void SetFilter( MIHLFilter* aFilter ) = 0;
- };
-
-#endif // MIHLFILEIMAGE_H
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/image_handling_library_api/inc/MIHLImage.h
--- a/imagehandling_plat/image_handling_library_api/inc/MIHLImage.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
-* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Pure virtual base class for all Image type interfaces.
-* : Class contains method to identify underlaying interface and
-* : implementation.
-*
-*/
-
-
-#ifndef MIHLIMAGE_H
-#define MIHLIMAGE_H
-
-// INCLUDES
-#include
-
-// CLASS DECLARATION
-/**
-* MIHLImage
-*
-* This is pure virtual base class for all Image type interfaces.
-* Class contains method to identify underlaying interface and
-* implementation.
-*
-* @lib IHL.lib
-* @since 3.0
-*/
-class MIHLImage
- {
- public:
-
- /**
- * Return identifier for underlaying interface
- * and implementation.
- * @since 3.0
- * @return Identifier for underlaying
- * interface and implementation.
- */
- virtual TIHLInterfaceType Type() const = 0;
-
- protected:
- // Derived class cannot be destructed through this interface
- ~MIHLImage() {}
- };
-
-#endif // MIHLIMAGE_H
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/image_handling_library_api/inc/MIHLImageViewer.h
--- a/imagehandling_plat/image_handling_library_api/inc/MIHLImageViewer.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,298 +0,0 @@
-/*
-* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Pure virtual interface for Image Viewer class.
-* : Class can be used to view, process and play animation
-* : from source image.
-*
-*/
-
-
-#ifndef MIHLIMAGEVIEWER_H
-#define MIHLIMAGEVIEWER_H
-
-// INCLUDES
-#include
-#include
-
-// FORWARD DECLARATION
-class MIHLFilter;
-
-// CLASS DECLARATION
-/**
-* MIHLImageViewer
-*
-* Pure virtual interface for Image Viewer class.
-* Class can be used to view, process and play animation
-* from source image.
-*
-* If interface needs to be pushed into CleanupStack,
-* remember to use CleanupStackDeletePushL() function!
-* DO NOT USE CleanupStack::PushL()!!
-*
-* @lib IHL.lib
-* @since 3.0
-*/
-class MIHLImageViewer : public MIHLViewer
- {
- public:
-
- /**
- * Virtual destructor.
- */
- virtual ~MIHLImageViewer() {}
-
- public:
-
- /**
- * Flags to control viewer functionality.
- * These can be combined using an OR operation.
- * @since 3.0
- */
- enum TOptions
- {
- EOptionIgnoreAspectRatio = 0x01,
- EOptionUseBilinearInterpolation = 0x02
- };
-
- /**
- * Rotation angle of source image.
- * @since 3.0
- */
- enum TRotationAngle
- {
- ERotationAngle0 = 0,
- ERotationAngle90 = 90,
- ERotationAngle180 = 180,
- ERotationAngle270 = 270,
- };
-
- public:
-
- /**
- * Check if source image is animated.
- * @since 3.0
- * @return ETrue if source image is animated. EFalse if not.
- */
- virtual TBool IsAnimation() const = 0;
-
- /**
- * Start animation playback.
- * If source image is not animated, method does nothing.
- * @since 3.0
- */
- virtual void Play() = 0;
-
- /**
- * Stop animation playback.
- * If source image is not animated or animation is
- * not played currently, method does nothing.
- * @since 3.0
- */
- virtual void Stop() = 0;
-
- /**
- * Check if animation playback is currently running.
- * @since 3.0
- * @return ETrue if animation is running. EFalse if not.
- */
- virtual TBool IsPlaying() const = 0;
-
- /**
- * Count of frames in animated image.
- * If not animated, return zero.
- * @since 3.0
- * @return Frames count of animation.
- */
- virtual TInt AnimationFrameCount() const = 0;
-
- /**
- * Current animation frame in display.
- * @since 3.0
- * @return Current animation frame index.
- */
- virtual TInt AnimationFrame() const = 0;
-
- /**
- * Change current animation frame.
- * @since 3.0
- * @param aFrameIndex New animation frame.
- * @return System wide error code.
- */
- virtual TInt SetAnimationFrame( TInt aFrameIndex ) = 0;
-
- /**
- * Change viewer size.
- * This is also the maximum size of destination bitmap.
- * @since 3.0
- * @param aViewerSize New viewer size.
- * @return System wide error code.
- */
- virtual TInt SetViewerSize( const TSize& aViewerSize, TInt srcBitmapScaleFactor = 1 ) = 0;
-
- /**
- * Viewer size.
- * This is also the maximum size of destination bitmap.
- * @since 3.0
- * @return Viewer size.
- */
- virtual TSize ViewerSize() const = 0;
-
- /**
- * Move source clip rectangle.
- * This is the area that is used from source image
- * and processed to destination bitmap.
- * Check valid move area with SourceRect()
- * and SourceSize() methods.
- * @since 3.0
- * @param aDx Movement in X-axis.
- * @param aDy Movement in Y-axis.
- * @return System wide error code.
- */
- virtual TInt MoveSourceRect( TInt aDx, TInt aDy ) = 0;
-
- /**
- * Set source clip rectangle position.
- * This is the area that is used from source image
- * and processed to destination bitmap.
- * Check valid move area with SourceRect()
- * and SourceSize() methods.
- * @since 3.0
- * @param aPosition Topleft posion of rectangle.
- * @return System wide error code.
- */
- virtual TInt SetSourceRectPosition( const TPoint& aPosition ) = 0;
-
- /**
- * This is the area that is used from source image
- * and processed to destination bitmap.
- * @since 3.0
- * @return Source clip rectangle.
- */
- virtual TRect SourceRect() const = 0;
-
- /**
- * Source image size.
- * Note that this will change if image is rotated.
- * @since 3.0
- * @return Source image size.
- */
- virtual TSize SourceSize() const = 0;
-
- /**
- * Set new zoom ratio.
- * Zoom ratio is multiplier for scaling,
- * 0,5 is 50%, 1.0 is 100%, 2,0 is 200% and so on.
- * Value cannot be zero or negative.
- * @since 3.0
- * @param aZoomRatio New zoom ratio.
- * @return System wide error code.
- */
- virtual TInt SetZoomRatio( TReal aZoomRatio ) = 0;
-
- /**
- * Current zoom ratio.
- * @since 3.0
- * @return Current zoom ratio.
- */
- virtual TReal ZoomRatio() const = 0;
-
- /**
- * Zoom to fit ratio.
- * Using this zoom ratio, image will fit
- * exactly to viewer.
- * @since 3.0
- * @return Zoom to fit ratio.
- */
- virtual TReal ZoomToFitRatio() const = 0;
-
- /**
- * Rotate source image 90 degree clockwise.
- * Source rect is also moved to remain in same position
- * where it was according to source image data.
- * @since 3.0
- * @return System wide error code.
- */
- virtual TInt RotateClockwise() = 0;
-
- /**
- * Rotate source image 90 degree counterclockwise.
- * Source rect is also moved to remain in same position
- * where it was according to source image data.
- * @since 3.0
- * @return System wide error code.
- */
- virtual TInt RotateCounterClockwise() = 0;
-
- /**
- * Set rotation angle. Use values from TRotationAngle enumeration.
- * Source rect is also moved to remain in same position
- * where it was according to source image data.
- * @since 3.0
- * @param aRotationAngle New rotation angle.
- * @return System wide error code.
- */
- virtual TInt SetRotationAngle( TInt aRotationAngle ) = 0;
-
- /**
- * Current rotation angle.
- * @since 3.0
- * @return Current rotation angle.
- */
- virtual TInt RotationAngle() const = 0;
-
- /**
- * Set vertical mirroring for source image.
- * Source rect is also moved to remain in same position
- * where it was according to source image data.
- * @since 3.0
- * @param aValue Mirroring flag.
- * @return System wide error code.
- */
- virtual TInt SetVerticalMirroring( TBool aValue ) = 0;
-
- /**
- * Check if source is vertically mirrored.
- * @since 3.0
- * @return ETrue if mirrored, EFalse if not.
- */
- virtual TBool VerticalMirroring() const = 0;
-
- /**
- * Set horizontal mirroring for source image.
- * Source rect is also moved to remain in same position
- * where it was according to source image data.
- * @since 3.0
- * @param aValue Mirroring flag.
- * @return System wide error code.
- */
- virtual TInt SetHorizontalMirroring( TBool aValue ) = 0;
-
- /**
- * Check if source is horizontally mirrored.
- * @since 3.0
- * @return ETrue if mirrored, EFalse if not.
- */
- virtual TBool HorizontalMirroring() const = 0;
-
- /**
- * Set filter.
- * For future use, not used currently!
- * @since 3.0
- */
- virtual void SetFilter( MIHLFilter* aFilter ) = 0;
- };
-
-#endif // MIHLIMAGEVIEWER_H
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/image_handling_library_api/inc/MIHLProcessor.h
--- a/imagehandling_plat/image_handling_library_api/inc/MIHLProcessor.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
-* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Pure virtual base class for all Processor type interfaces.
-* : Class contains method to identify underlaying interface and
-* : implementation.
-*
-*/
-
-
-#ifndef MIHLPROCESSOR_H
-#define MIHLPROCESSOR_H
-
-// INCLUDES
-#include
-
-// CLASS DECLARATION
-/**
-* MIHLProcessor
-*
-* This is pure virtual base class for all Processor type interfaces.
-* Class contains method to identify underlaying interface and
-* implementation.
-*
-* @lib IHL.lib
-* @since 3.0
-*/
-class MIHLProcessor
- {
- public:
-
- /**
- * Return identifier for underlaying interface
- * and implementation.
- * @since 3.0
- * @return Identifier for underlaying
- * interface and implementation.
- */
- virtual TIHLInterfaceType Type() const = 0;
-
- protected:
- // Derived class cannot be destructed through this interface
- ~MIHLProcessor() {}
- };
-
-#endif // MIHLPROCESSOR_H
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/image_handling_library_api/inc/MIHLScaler.h
--- a/imagehandling_plat/image_handling_library_api/inc/MIHLScaler.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,169 +0,0 @@
-/*
-* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Pure virtual interface to bitmap scaler
-* : using Font and Bitmap Server bitmaps.
-*
-*/
-
-
-#ifndef MIHLSCALER_H
-#define MIHLSCALER_H
-
-// INCLUDES
-#include
-
-// FORWARD DECLARATION
-class MIHLScaler;
-class MIHFilter;
-class CFbsBitmap;
-
-// FACTORY DECLARATION
-class IHLScaler
- {
- public:
-
- /**
- * Create new MIHLScaler instance.
- * @since 3.0
- * @param aOptions Special options for bitmap scaling. Use MIHLScaler::TOptions values.
- * @return New scaler instance.
- */
- IMPORT_C static MIHLScaler* CreateL( const TUint32 aOptions = 0 );
- };
-
-// CLASS DECLARATION
-/**
-* MIHLScaler
-*
-* Pure virtual interface to bitmap scaler
-* using Font and Bitmap Server bitmaps.
-*
-* If interface needs to be pushed into CleanupStack,
-* remember to use CleanupStackDeletePushL() function!
-* DO NOT USE CleanupStack::PushL()!!
-*
-* @lib IHL.lib
-* @since 3.0
-*/
-class MIHLScaler
- {
- public:
-
- /**
- * Virtual destructor.
- */
- virtual ~MIHLScaler() {}
-
- public:
-
- /**
- * Flags to control scaler functionality.
- * These can be combined using an OR operation.
- * @since 3.0
- */
- enum TOptions
- {
- EOptionUseBilinearInterpolation = 0x01,
- };
-
- public:
-
- /**
- * Scale rectangle from source bitmap to a rectangle
- * in destination bitmap. Scaled area can be also
- * rotated and/or mirrored during process.
- *
- * Rotating is done by defining SOURCE rectangle
- * topleft and bottomright corners in following way:
- *
- * No rotate: tl----- 90 degree: -----tl
- * | | | |
- * | | | |
- * -----br br-----
- *
- * 180 degree: br----- 270 degree: -----br
- * | | | |
- * | | | |
- * -----tl tl-----
- *
- * Mirroring is done by defining DESTINATION rectangle
- * topleft and bottomright corners in following way:
- *
- * No mirroring: tl-----
- * | |
- * | |
- * -----br
- *
- * X-axis mirroring: -----tl
- * | |
- * | |
- * br-----
- *
- * Y-axis mirroring: -----br
- * | |
- * | |
- * tl-----
- *
- * X and Y-axis br-----
- * mirroring: | |
- * | |
- * -----tl
- *
- * @since 3.0
- * @param aStatus Process request status reference.
- * @param aSrcBitmap Source bitmap reference.
- * @param aSrcRect Rectangle that is processed from source bitmap.
- * @param aDstBitmap Destination bitmap reference.
- * If destination bitmap has null handle,
- * processor will create new bitmap using size of
- * destination rectangle.
- * @param aDstRect Rectangle that is filled in destination bitmap.
- * @return Return system wide error codes:
- * KerrArgument - rectangles are outside of bitmap area.
- * - source bitmap is empty (handle is null).
- * - destination bitmap displaymode differs
- * from source bitmap displaymode.
- * KErrBusy - processor has request pending already.
- */
- virtual TInt Scale( TRequestStatus& aStatus,
- const CFbsBitmap& aSrcBitmap,
- const TRect& aSrcRect,
- CFbsBitmap& aDstBitmap,
- const TRect& aDstRect ) = 0;
-
- /**
- * Check if processor has request pending.
- * @since 3.0
- * @return ETrue if request is pending, EFalse if not.
- */
- virtual TBool IsBusy() const = 0;
-
- /**
- * Cancel pending request.
- * If not active, method does nothing.
- * @since 3.0
- */
- virtual void CancelProcess() = 0;
-
- /**
- * Set filter.
- * For future use, not used currently!
- * @since 3.0
- */
- virtual void SetFilter( MIHFilter* aFilter ) = 0;
- };
-
-#endif // MIHLSCALER_H
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/image_handling_library_api/inc/MIHLViewer.h
--- a/imagehandling_plat/image_handling_library_api/inc/MIHLViewer.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
-* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Pure virtual base class for all Viewer type interfaces.
-* : Class contains method to identify underlaying interface and
-* : implementation.
-*
-*/
-
-
-#ifndef MIHLVIEWER_H
-#define MIHLVIEWER_H
-
-// INCLUDES
-#include
-
-// CLASS DECLARATION
-/**
-* MIHLViewer
-*
-* This is pure virtual base class for all Viewer type interfaces.
-* Class contains method to identify underlaying interface and
-* implementation.
-*
-* @lib IHL.lib
-* @since 3.0
-*/
-class MIHLViewer
- {
- public:
-
- /**
- * Return identifier for underlaying interface
- * and implementation.
- * @since 3.0
- * @return Identifier for underlaying
- * interface and implementation.
- */
- virtual TIHLInterfaceType Type() const = 0;
-
- protected:
- // Derived class cannot be destructed through this interface
- ~MIHLViewer() {}
- };
-
-#endif // MIHLVIEWER_H
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/image_handling_library_api/inc/MIHLViewerObserver.h
--- a/imagehandling_plat/image_handling_library_api/inc/MIHLViewerObserver.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
-* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Pure virtual base class for viewer observer.
-*
-*/
-
-
-#ifndef IHLVIEWEROBSERVER_H
-#define IHLVIEWEROBSERVER_H
-
-// INCLUDES
-#include
-
-// CLASS DECLARATION
-/**
-* MIHLViewerObserver
-*
-* Pure virtual base class for viewer observer.
-* @lib IHL.lib
-* @since 3.0
-*/
-class MIHLViewerObserver
- {
- public:
-
- /**
- * This callback is currently not supported!
- *
- * Notifies client of viewer events.
- * Event codes are defined in viewer header.
- * Leave situation is handled in ViewerError() callback.
- * @since 3.0
- * @param aEvent Type of event.
- * @param aEventCode1 Event specific code 1.
- * @param aEventCode2 Event specific code 2.
- */
- virtual void ViewerEventL( TInt /*aEvent*/, TInt /*aEventCode1*/, TInt /*aEventCode2*/ ) {}
-
- /**
- * Notifies client when viewer bitmap content is changed.
- * Leave situation is handled in ViewerError() callback.
- * @since 3.0
- */
- virtual void ViewerBitmapChangedL() = 0;
-
- /**
- * Notifies client if error occurs in viewer.
- * @since 3.0
- * @param aError System wide error code.
- */
- virtual void ViewerError( TInt aError ) = 0;
-
- };
-
-#endif // IHLIMAGEVIEWEROBSERVER_H
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/image_handling_library_api/inc/TIHLInterfaceType.h
--- a/imagehandling_plat/image_handling_library_api/inc/TIHLInterfaceType.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
-* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: This struct contain interface and
-* : implementation ids for IHL classes.
-*
-*/
-
-
-#ifndef TIHLINTERFACETYPE_H
-#define TIHLINTERFACETYPE_H
-
-// INCLUDES
-#include
-
-// CLASS DECLARATION
-/**
-* TIHLInterfaceType
-*
-* This struct contain interface and
-* implementation ids for IHL classes.
-*
-* Used id values are defined in IHLInterfaceIds.h header.
-*
-* @lib IHL.lib
-* @since 3.0
-*/
-class TIHLInterfaceType
- {
- public: // Constructor and destructor
-
- inline TIHLInterfaceType( TInt aInterfaceId, TInt aImplementationId );
- virtual ~TIHLInterfaceType() {};
-
- public: // Public data
-
- /**
- * Class interface id.
- * Used to identify interface type currently in use.
- */
- TInt iInterfaceId;
-
- /**
- * Class implementation id.
- * Used to identify implementation class behind interface.
- * For internal use.
- */
- TInt iImplementationId;
-
- };
-
-inline TIHLInterfaceType::TIHLInterfaceType( TInt aInterfaceId, TInt aImplementationId )
-:iInterfaceId( aInterfaceId ), iImplementationId( aImplementationId ) {}
-
-#endif // TIHLINTERFACETYPE_H
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/group/bld.inf
--- a/imagehandling_plat/thumbnailmanager_api/group/bld.inf Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: File that exports the files belonging to
-* : Thumbnailmanager API
-*
-*/
-
-#include
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-
-#ifdef RD_THUMBNAILMANAGER
-
-../inc/thumbnaildata.h MW_LAYER_PLATFORM_EXPORT_PATH(thumbnaildata.h)
-../inc/thumbnailmanager.h MW_LAYER_PLATFORM_EXPORT_PATH(thumbnailmanager.h)
-../inc/thumbnailmanagerobserver.h MW_LAYER_PLATFORM_EXPORT_PATH(thumbnailmanagerobserver.h)
-../inc/thumbnailobjectsource.h MW_LAYER_PLATFORM_EXPORT_PATH(thumbnailobjectsource.h)
-../inc/thumbnailmanager_qt.h MW_LAYER_PLATFORM_EXPORT_PATH(thumbnailmanager_qt.h)
-
-#endif // RD_THUMBNAILMANAGER
-
-// End of File
-
-
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/inc/thumbnaildata.h
--- a/imagehandling_plat/thumbnailmanager_api/inc/thumbnaildata.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Thumbnail object
- *
-*/
-
-
-#ifndef THUMBNAILDATA_H
-#define THUMBNAILDATA_H
-
-#include
-
-class CFbsBitmap;
-
-/**
- * Thumbnail object.
- *
- * @since S60 S60 v5.0
- */
-NONSHARABLE_CLASS( MThumbnailData )
- {
-public:
-
- /**
- * Get a pointer to a CFbsBitmap containing the thumbnail image. Ownership
- * of the object is not transferred (i.e. client must not delete the
- * pointer).
- *
- * @since S60 v5.0
- * @return Pointer to a bitmap representing the thumbnail or NULL if
- * thumbnail pointer is not available or it has been detached.
- */
- virtual CFbsBitmap* Bitmap() = 0;
-
- /**
- * Get a pointer to a CFbsBitmap containing the thumbnail image. Ownership
- * of the object is transferred to the caller. Client must delete the
- * bitmap after it is done processing it.
- *
- * @since S60 v5.0
- * @return Pointer to a bitmap representing the thumbnail or NULL if
- * thumbnail pointer is not available or it has been detached.
- * Caller assumes ownership of the bitmap.
- */
- virtual CFbsBitmap* DetachBitmap() = 0;
-
- /**
- * Get client data structure.
- *
- * @since S60 v5.0
- * @return A pointer for client data specified as a parameter for
- * GetThumbnailL() or NULL if not specified.
- */
- virtual TAny* ClientData() = 0;
-};
-
-#endif // THUMBNAILDATA_H
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/inc/thumbnailmanager.h
--- a/imagehandling_plat/thumbnailmanager_api/inc/thumbnailmanager.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,590 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Main interface class to Thumbnail Manager
- *
-*/
-
-
-#ifndef THUMBNAILMANAGER_H
-#define THUMBNAILMANAGER_H
-
-#include
-#include
-#include
-
-#include
-
-class MThumbnailManagerObserver;
-class MThumbnailManagerRequestObserver;
-
-typedef TInt TThumbnailRequestId;
-
-typedef TUint32 TThumbnailId;
-typedef enum
-{
-EUnknownThumbnailSize,
-ECustomThumbnailSize,
-EImageGridThumbnailSize,
-EImageListThumbnailSize,
-EImageFullScreenThumbnailSize,
-EVideoGridThumbnailSize,
-EVideoListThumbnailSize,
-EVideoFullScreenThumbnailSize,
-EAudioGridThumbnailSize,
-EAudioListThumbnailSize,
-EAudioFullScreenThumbnailSize,
-EGridThumbnailSize,
-EListThumbnailSize,
-EFullScreenThumbnailSize,
-EContactGridThumbnailSize,
-EContactListThumbnailSize,
-EContactFullScreenThumbnailSize,
-EThumbnailSizeCount //last item, don't remove
-} TThumbnailSize;
-/**
- * Thumbnail engine.
- *
- * This is the main interface class to thumbnail engine. Thumbnail engine
- * can be used to request thumbnails for different kinds of media objects.
- *
- * The client using thumbnail engine must implement the
- * MThumbnailManagerObserver. The observer interface is used to provide
- * thumbnail data when it is available.
- *
- * Typical use of thumbnail engine consists of 4 parts:
- * - creating an engine instance using NewL
- * - setting thumbnail parameters using SetThumbnailSizeL(), SetFlags(),
- * and so on
- * - creating an object source (CThumbnailObjectSource) and using it to
- * request thumbnails
- * - handling MThumbnailManagerObserver callbacks when the thumbnail request
- * is complete
- *
- * Here is an example of how thumbnail engine could be used by a typical
- * application:
- *
- * @code
- *
- * #include
- * #include
- *
- * class CMyThumbnailControl: public CCoeControl,
- * public MThumbnailManagerObserver
- * {
- * public:
- * CMyThumbnailControl();
- * ~CMyThumbnailControl();
- * ...
- *
- * // Callbacks from MThumbnailManagerObserver for getting thumbnails
- * void ThumbnailPreviewReady(
- * MThumbnailData& aThumbnail,
- * TThumbnailRequestId aId );
- * void ThumbnailReady(
- * TInt aError,
- * MThumbnailData& aThumbnail,
- * TThumbnailRequestId aId );
- *
- * private:
- * void ConstructL();
- * CThumbnailManager* iManager;
- * CFbsBitmap* iBitmap;
- * }
- *
- * _LIT( KTestFilePath, "e:\\TestImage.jpg" );
- * _LIT( KTestFileType, "image/jpeg" );
- *
- * void CMyThumbnailControl::ConstructL()
- * {
- * // Create Thumbnail Manager instance. This object is the observer.
- * iManager = CThumbnailManager::NewL( *this );
- *
- * // Set flags: If the aspect ratio of the media object does not match
- * // 4:3 then we would like it to be cropped. We don’t mind getting
- * // smaller images than requested.
- * iManager->SetFlagsL( CThumbnailManager::ECropToAspectRatio |
- * CThumbnailManager::EAllowAnySize );
- *
- * // Preferred size is 160x120 (or less)
- * iManager->SetSizeL( TSize( 160, 120 ) );
- *
- * // Get a preview thumbnail first, if available.
- * // The preview thumbnail is delivered via a ThumbnailPreviewReady()
- * // callback.
- * iManager->SetQualityPreferenceL(
- * CThumbnailManager::EOptimizeForQualityWithPreview );
- *
- * // Create an object source representing a path to a file on local
- * // file system.
- * CThumbnailObjectSource* source = CThumbnailObjectSource::NewLC(
- * KTestFilePath, // File path
- * KTestFileType ); // Let Thumbnail Manager know it’s a JPEG, so
- * // it doesn’t need to recognize the file format
- *
- * // Issue the request using default priority
- * iManager->GetThumbnailL( *source );
- *
- * // If GetThumbnailL() did not leave, the ThumbnailReady() callback is
- * // now guaranteed to be called, unless the request is cancelled or
- * // CThumbnailManager instance is deleted.
- *
- * // The source can be deleted immediately after issuing the request
- * CleanupStack::PopAndDestroy( source );
- * }
- *
- * CMyThumbnailControl::~CMyThumbnailControl()
- * {
- * // Bitmap should be destroyed before Thumbnail Manager
- * delete iBitmap;
- * delete iManager;
- * }
- *
- * void CMyThumbnailControl::ThumbnailReady(
- * TInt aError,
- * MThumbnailData& aThumbnail,
- * TThumbnailRequestId aId )
- * {
- * // This function must not leave.
- *
- * delete iBitmap; iBitmap = NULL;
- * if ( !aError )
- * {
- * // Claim ownership of the bitmap instance for later use
- * iBitmap = aThumbnail.DetachBitmap();
- *
- * // We can now use iBitmap in our Draw() method
- * DrawDeferred();
- * }
- * else
- * {
- * // An error occurred while getting the thumbnail.
- * // Perhaps we should show a broken image icon to the user.
- * }
- * }
- *
- * @endcode
- *
- * @lib thumbnailmanager.lib
- * @since S60 v5.0
- */
-NONSHARABLE_CLASS( CThumbnailManager ): public CBase
- {
-public:
- /**
- * Flags for thumbnail creation.
- * These can be combined using bitwise or.
- */
- enum TThumbnailFlags
- {
- /**
- * Default flags. This means that:
- * - Thumbnail must be as large as requested (unless the actual
- * object is smaller).
- * - Smaller thumbnails may be up scaled to desired resolution.
- * - Aspect ratio is maintained and thumbnails are not cropped. The
- * resulting thumbnail may smaller in either width or height if
- * the aspect ratio of the object does not match the aspect ratio
- * of the requested size.
- */
- EDefaultFlags = 0,
-
- /**
- * Allow thumbnails which are smaller than requested are. Thumbnail
- * bitmaps are never up scaled if this flag is set.
- */
- EAllowAnySize = 1,
-
- /**
- * New thumbnail images are not created if this flag is set. Only
- * existing thumbnails may be returned. If a requested thumbnail does
- * not exist, KErrNotFound error is returned in ThumbnailReady()
- * callback.
- */
- EDoNotCreate = 2,
-
- /**
- * Thumbnail images are cropped to match requested aspect ratio. If
- * this flag is set, the size of the resulting thumbnail always
- * matches the requested size.
- */
- ECropToAspectRatio = 4
- };
-
- /** Quality versus speed preference setting */
- enum TThumbnailQualityPreference
- {
- /**
- * Prefer thumbnails in the highest quality possible disregarding
- * any negative impact on performance.
- */
- EOptimizeForQuality,
-
- /**
- * Get thumbnails as fast as possible, even if
- * it means lower quality.
- */
- EOptimizeForPerformance,
-
- /**
- * Get lower quality preview thumbnail as fast as possible first and
- * then a higher quality thumbnail later. The preview thumbnail is
- * provided in the ThumbnailPreviewReady() callback and the high
- * quality thumbnail in ThumbnailReady(). ThumbnailPreviewReady()
- * is not get called at all if a suitable existing thumbnail is not
- * found or if a high quality version is already available.
- */
- EOptimizeForQualityWithPreview
- };
-
- /**
- * Two-phased constructor.
- *
- * @since S60 v5.0
- * @param aObserver Observer to receive notifications about completed
- * operations.
- * @return New CThumbnailManager instance.
- */
- IMPORT_C static CThumbnailManager* NewL( MThumbnailManagerObserver&
- aObserver );
-
- /**
- * Two-phased constructor.
- *
- * @since S60 v5.0
- * @param aObserver Observer to receive notifications about completed
- * operations.
- * @return New CThumbnailManager instance (on cleanup stack).
- */
- IMPORT_C static CThumbnailManager* NewLC( MThumbnailManagerObserver&
- aObserver );
-
- /**
- * Destructor
- *
- * @since S60 v5.0
- */
- virtual ~CThumbnailManager();
-
- /**
- * Get the current display mode for thumbnail bitmaps.
- *
- * @since S60 v5.0
- * @return Current display mode for the thumbnail bitmaps.
- */
- virtual TDisplayMode DisplayMode()const = 0;
-
- /**
- * Set the current display mode for thumbnail bitmaps.
- *
- * @since S60 v5.0
- * @param aDisplayMode New display mode value for the thumbnail bitmaps.
- */
- virtual void SetDisplayModeL( TDisplayMode aDisplayMode ) = 0;
-
- /**
- * Get the current quality versus performance preference.
- *
- * @since S60 v5.0
- * @return Current quality versus performance preference.
- */
- virtual TThumbnailQualityPreference QualityPreference()const = 0;
-
- /**
- * Set quality versus performance preference.
- *
- * @since S60 v5.0
- * @param aQualityPreference New quality versus performance preference
- * value.
- */
- virtual void SetQualityPreferenceL( TThumbnailQualityPreference
- aQualityPreference ) = 0;
-
- /**
- * Get the current desired size for thumbnail bitmaps.
- *
- * @since S60 v5.0
- * @return Current desired size for thumbnail bitmaps (in pixels).
- */
- virtual const TSize& ThumbnailSize()const = 0;
-
- /**
- * Set desired size for thumbnail bitmaps.
- *
- * @since S60 v5.0
- * @param aThumbnailSize New quality for the desired thumbnail size.
- */
- virtual void SetThumbnailSizeL( const TSize& aThumbnailSize ) = 0;
-
-
- /**
- * Get current flags for thumbnail generation.
- *
- * @since S60 v5.0
- * @return Current flags.
- */
- virtual TThumbnailFlags Flags()const = 0;
-
- /**
- * Set flags for thumbnail generation. Several flags may be enabled
- * by combining the values using bitwise or.
- *
- * @since S60 v5.0
- * @param aFlags New flags.
- */
- virtual void SetFlagsL( TThumbnailFlags aFlags ) = 0;
-
- /**
- * Get a thumbnail for an object file. If a thumbnail already exists, it
- * is loaded and if a thumbnail does not exist, it is created
- * transparently. ThumbnailReady() callback will be called when the
- * operation is complete. In addition, ThumbnailPreviewReady()
- * callback may be called if EOptimizeForQualityWithPreview mode was
- * defined.
- *
- * Current values for display mode, thumbnail size, flags and performance
- * preference are used.
- *
- * @since S60 v5.0
- * @param aObjectSource Source object or file
- * @param aClientData Pointer to arbitrary client data.
- * This pointer is not used by the API for
- * anything other than returning it in the
- * ThumbnailReady callback.
- * @param aPriority Priority for this operation
- * @return Thumbnail request ID. This can be used to
- * cancel the request or change priority.
- * The ID is specific to this CThumbnailManager
- * instance and may not be shared with other
- * instances.
- */
- virtual TThumbnailRequestId GetThumbnailL( CThumbnailObjectSource&
- aObjectSource, TAny* aClientData = NULL, TInt aPriority = CActive
- ::EPriorityStandard ) = 0;
-
- /**
- * Delete all thumbnails for a given object. This is an asynchronous
- * operation, which always returns immediately.
- *
- * @since S60 v5.0
- * @param aObjectSource Source object or file
- */
- virtual void DeleteThumbnails( CThumbnailObjectSource& aObjectSource ) = 0;
-
- /**
- * Create thumbnail for a given object. This is an asynchronous
- * operation, which always returns immediately. No callbacks are
- * emitted.
- *
- * @since S60 v5.0
- * @param aObjectSource Source object or file
- * @param aPriority Priority for this operation
- * @return Thumbnail request ID. This can be used to
- * cancel the request or change priority.
- * The ID is specific to this CThumbnailManager
- * instance and may not be shared with other
- * instances.
- */
- virtual TThumbnailRequestId CreateThumbnails( CThumbnailObjectSource&
- aObjectSource, TInt aPriority = CActive::EPriorityIdle ) = 0;
-
- /**
- * Cancel a thumbnail operation.
- *
- * @since S60 v5.0
- * @param aId Request ID for the operation to be cancelled.
- * @return Symbian OS error code or KErrNone if cancelling was
- * successful.
- */
- virtual TInt CancelRequest( TThumbnailRequestId aId ) = 0;
-
- /**
- * Change the priority of a queued thumbnail operation.
- *
- * @since S60 v5.0
- * @param aId Request ID for the request which to assign a new
- * priority.
- * @param aNewPriority New priority value
- * @return Symbian OS error code or KErrNone if change was
- * successful.
- */
- virtual TInt ChangePriority( TThumbnailRequestId aId, TInt aNewPriority ) = 0;
-
- /**
- * Get a list of supported file formats for object files.
- *
- * The return value is a reference to a list that contains each
- * supported MIME type. There may also be wildcards, such as "image/*".
- *
- * The returned reference is valid until CThumbnailManager is
- * destroyed or GetSupportedMimeTypesL() is called again.
- *
- * @since S60 v5.0
- * @return A list of supported MIME types. May contain wildcards.
- * Ownership not transferred.
- */
- virtual const CDesCArray& GetSupportedMimeTypesL() = 0;
-
- /**
- * Delete thumbnails by TThumbnailId. This is an asynchronous
- * operation, which always returns immediately.
- *
- * @since S60 v5.0
- * @param aItemId TThumbnailId
- */
- virtual void DeleteThumbnails( const TThumbnailId aItemId ) = 0;
-
-/**
- * Set desired size for thumbnail bitmaps.
- *
- * @since S60 v5.0
- * @param aThumbnailSize Desired thumbnail size.
- */
- virtual void SetThumbnailSizeL( const TThumbnailSize aThumbnailSize ) = 0;
-
- /**
- * Get a persistent thumbnail for an object file. If a thumbnail already
- * exists, it is loaded and if a thumbnail does not exist, it is created
- * transparently. ThumbnailReady() callback will be called when the
- * operation is complete. In addition, ThumbnailPreviewReady()
- * callback may be called if EOptimizeForQualityWithPreview mode was
- * defined.
- *
- * Current values for display mode, thumbnail size, flags and performance
- * preference are used.
- *
- * @since S60 v5.0
- * @param aThumbnailId Thumbnail ID
- * @param aThumbnailSizeType Thumbnail size enumeration
- * @param aClientData Pointer to arbitrary client data.
- * This pointer is not used by the API for
- * anything other than returning it in the
- * ThumbnailReady callback.
- * @param aPriority Priority for this operation
- * @return Thumbnail request ID. This can be used to
- * cancel the request or change priority.
- * The ID is specific to this CThumbnailManager
- * instance and may not be shared with other
- * instances.
- */
- virtual TThumbnailRequestId GetThumbnailL( const TThumbnailId aThumbnailId,
- TAny* aClientData = NULL,
- TInt aPriority = CActive::EPriorityStandard ) = 0;
-
-
- /**
- * Set a thumbnail for an object file generated from buffer delivered in source
- * object. ThumbnailReady() callback will be called when the
- * operation is complete. In addition, ThumbnailPreviewReady()
- * callback may be called if EOptimizeForQualityWithPreview mode was
- * defined.
- *
- * Current values for display mode, thumbnail size, flags and performance
- * preference are used.
- *
- * @since S60 v5.0
- * @param aThumbnailId Thumbnail ID
- * @param aThumbnailSizeType Thumbnail size enumeration
- * @param aClientData Pointer to arbitrary client data.
- * This pointer is not used by the API for
- * anything other than returning it in the
- * ThumbnailReady callback.
- * @param aPriority Priority for this operation
- * @return Thumbnail request ID. This can be used to
- * cancel the request or change priority.
- * The ID is specific to this CThumbnailManager
- * instance and may not be shared with other
- * instances.
- */
- virtual TThumbnailRequestId SetThumbnailL( CThumbnailObjectSource& aObjectSource,
- TAny* = NULL,
- TInt aPriority = CActive::EPriorityIdle ) = 0;
-
-
- /**
- * Import an image to be used as thumbnail for an object. If a
- * thumbnail already exists, it is loaded and if a thumbnail does not
- * exist, it is created transparently. ThumbnailReady() callback will be
- * called when the operation is complete. In addition, ThumbnailPreviewReady()
- * callback may be called if EOptimizeForQualityWithPreview mode was
- * defined.
- *
- * Current values for display mode, thumbnail size, flags and performance
- * preference are used.
- *
- * @since S60 v5.0
- * @param aObjectSource Source object or file
- * @param aTargetUri Target URI to which the imported thumbnail is linked.
- * @param aClientData Pointer to arbitrary client data.
- * This pointer is not used by the API for
- * anything other than returning it in the
- * ThumbnailReady callback.
- * @param aPriority Priority for this operation
- * @return Thumbnail request ID. This can be used to
- * cancel the request or change priority.
- * The ID is specific to this CThumbnailManager
- * instance and may not be shared with other
- * instances.
- */
- virtual TThumbnailRequestId ImportThumbnailL( CThumbnailObjectSource& aObjectSource,
- const TDesC& aTargetUri, TAny* aClientData = NULL,
- TInt aPriority = CActive::EPriorityIdle ) = 0;
-
- /**
- * Update Thumbnails by TThumbnailId. This is an asynchronous
- * operation, which always returns immediately.
- *
- * @since S60 v5.0
- * @param aItemId TThumbnailId
- * @param aPath (New) path for the Thumbnail
- * @param aOrientation Thumbnail orientation
- * @param aModified Last modified
- */
- virtual void UpdateThumbnailsL( const TThumbnailId aItemId, const TDesC& aPath,
- const TInt aOrientation, const TInt64 aModified, const TInt aPriority ) = 0;
-
- /**
- * Rename Thumbnails. This is an asynchronous
- * operation, which always returns immediately.
- *
- * @since S60 v5.0
- * @param aCurrentPath Current path of the Thumbnail
- * @param aNewPath New path for the Thumbnail
- * @param aPriority Priority for this operation
- * @return Thumbnail request ID. This can be used to
- * cancel the request or change priority.
- * The ID is specific to this CThumbnailManager
- * instance and may not be shared with other
- * instances.
- */
- virtual TThumbnailRequestId RenameThumbnailsL( const TDesC& aCurrentPath,
- const TDesC& aNewPath, TInt aPriority = CActive::EPriorityIdle ) = 0;
-
- /**
- * Set optional request observer for getting information about completed
- * requests that don't include a thumbnail.
- *
- * @since Symbian^3
- * @param aObserver Observer to receive notifications.
- */
- virtual void SetRequestObserver( MThumbnailManagerRequestObserver& aObserver ) = 0;
-
- /**
- * Remove optional request observer.
- *
- * @since Symbian^3
- */
- virtual void RemoveRequestObserver() = 0;
-};
-
-#endif // THUMBNAILMANAGER_H
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/inc/thumbnailmanager_qt.h
--- a/imagehandling_plat/thumbnailmanager_api/inc/thumbnailmanager_qt.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,349 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Qt interface class to Thumbnail Manager
-*
-*/
-
-#ifndef THUMBNAILMANAGER_QT_H
-#define THUMBNAILMANAGER_QT_H
-
-#include
-#include
-#include
-
-#include
-
-class QString;
-class QSize;
-
-class ThumbnailManagerPrivate;
-class TestThumbnailManager;
-
-#ifdef TNMQT_DLL
-# define TNM_EXPORT Q_DECL_EXPORT
-#else
-# define TNM_EXPORT Q_DECL_IMPORT
-#endif
-
-
-/** default priority value */
-const int tnmWrapperPriorityIdle = -100;
-
-class ThumbnailManager : public QObject
- {
- Q_OBJECT
-
-public:
-
- /** Thumbnail size. */
- enum ThumbnailSize
- {
- /**
- * Small thumbnail
- */
- ThumbnailSmall = 0,
- /**
- * Medium thumbnail
- */
- ThumbnailMedium,
- /**
- * Large thumbnail
- */
- ThumbnailLarge
- };
-
- /** Mode of thumbnail creation. */
- enum ThumbnailMode
- {
- /**
- * Default mode. This means that:
- * - Thumbnail must be as large as requested (unless the actual object is smaller).
- * - Smaller thumbnails may be up scaled to desired resolution.
- * - Aspect ratio is maintained and thumbnails are not cropped. The
- * resulting thumbnail may smaller in either width or height if
- * the aspect ratio of the object does not match the aspect ratio
- * of the requested size.
- */
- Default = 0,
-
- /**
- * Allow thumbnails which are smaller than requested are. Thumbnail
- * bitmaps are never up scaled if this flag is set.
- */
- AllowAnySize = 1,
-
- /**
- * New thumbnail images are not created if this flag is set. Only
- * existing thumbnails may be returned. If a requested thumbnail does
- * not exist null pixmap will be returned.
- */
- DoNotCreate = 2,
-
- /**
- * Thumbnail images are cropped to match requested aspect ratio. If
- * this mode is set, the size of the resulting thumbnail always
- * matches the requested size.
- */
- CropToAspectRatio = 4
- };
-
- /** Quality versus speed preference setting */
- enum QualityPreference
- {
- /**
- * Prefer thumbnails in the highest quality possible disregarding
- * any negative impact on performance.
- */
- OptimizeForQuality,
-
- /**
- * Get thumbnails as fast as possible, even if
- * it means lower quality.
- */
- OptimizeForPerformance
- };
-
-
- /**
- * Constructor
- *
- * @param parentPtr parent
- */
- TNM_EXPORT ThumbnailManager( QObject* parentPtr = NULL );
-
- /**
- * Destructor
- */
- TNM_EXPORT ~ThumbnailManager();
-
- /**
- * Get quality versus performance preference.
- *
- * @return quality versus performance preference
- */
- TNM_EXPORT QualityPreference qualityPreference() const;
-
- /**
- * Set quality versus performance preference.
- *
- * @param qualityPreference New quality versus performance preference
- * value.
- * @return true on success
- */
- TNM_EXPORT bool setQualityPreference( QualityPreference qualityPreference );
-
- /**
- * Get the current desired size for thumbnail bitmaps.
- *
- * @return Current desired size for thumbnail bitmaps (in pixels).
- */
- TNM_EXPORT QSize thumbnailSize() const;
-
- /**
- * Set desired size for thumbnail bitmaps.
- *
- * @param thumbnailSize New desired thumbnail size.
- * @return true on success
- */
- TNM_EXPORT bool setThumbnailSize( const QSize& thumbnailSize );
-
- /**
- * Set desired size for thumbnail bitmaps.
- *
- * @param thumbnailSize New desired thumbnail size.
- * @return true on success
- */
- TNM_EXPORT bool setThumbnailSize( ThumbnailSize thumbnailSize );
-
- /**
- * Get current mode for thumbnail generation.
- *
- * @return Current mode.
- */
- TNM_EXPORT ThumbnailMode mode() const;
-
- /**
- * Set mode for thumbnail generation.
- *
- * @param mode New flags.
- * @return true on success
- */
- TNM_EXPORT bool setMode( ThumbnailMode mode );
-
- /**
- * Get a thumbnail for an object file. If a thumbnail already exists, it
- * is loaded and if a thumbnail does not exist, it is created
- * transparently. If thumbnail loadinf fails thumbnailReady signal is emited
- * with null pixmap and error code.
- *
- * @param fileName Source object or file
- * @param clientData Pointer to arbitrary client data.
- * This pointer is not used by the API for
- * anything other than returning it in the
- * ThumbnailReady signal.
- * @param priority Priority for this operation
- * @return Thumbnail request ID or -1 if request failed. This can be used to
- * cancel the request or change priority.
- * The ID is specific to this tnm
- * instance and may not be shared with other
- * instances.
- */
- TNM_EXPORT int getThumbnail( const QString& fileName, void * clientData = NULL,
- int priority = tnmWrapperPriorityIdle );
-
- /**
- * Get a persistent thumbnail for an object file. If a thumbnail already
- * exists, it is loaded and if a thumbnail does not exist, it is created
- * transparently. If thumbnail loading fails thumbnailReady signal is emited
- * with null pixmap and error code.
- *
- * @param thumbnailId Thumbnail ID
- * @param clientData Pointer to arbitrary client data.
- * This pointer is not used by the API for
- * anything other than returning it in the
- * ThumbnailReady signal.
- * @param priority Priority for this operation
- * @return Thumbnail request ID or -1 if request failed. This can be used to
- * cancel the request or change priority.
- * The ID is specific to this tnm
- * instance and may not be shared with other
- * instances.
- */
- TNM_EXPORT int getThumbnail( unsigned long int thumbnailId, void * clientData = NULL,
- int priority = tnmWrapperPriorityIdle );
-
- /**
- * Set a thumbnail for an object file generated from pixmap delivered.
- * thumbnailReady() signal will be emited when the operation is complete.
- *
- * @param source Pixmap from which the thumbnail will be created
- * @param fileName file name
- * @param clientData Pointer to arbitrary client data.
- * This pointer is not used by the API for
- * anything other than returning it in the
- * ThumbnailReady callback.
- * @param priority Priority for this operation
- * @return Thumbnail request ID or -1 if request failed. This can be used to
- * cancel the request or change priority.
- *
- */
- TNM_EXPORT int setThumbnail( const QPixmap& source, const QString& fileName,
- void * clientData = NULL, int priority = tnmWrapperPriorityIdle );
-
- /**
- * Set a thumbnail for an object file generated from pixmap delivered.
- * thumbnailReady() signal will be emited when the operation is complete.
- *
- * @param source QImage from which the thumbnail will be created
- * @param fileName file name
- * @param clientData Pointer to arbitrary client data.
- * This pointer is not used by the API for
- * anything other than returning it in the
- * ThumbnailReady callback.
- * @param priority Priority for this operation
- * @return Thumbnail request ID or -1 if request failed. This can be used to
- * cancel the request or change priority.
- *
- */
- TNM_EXPORT int setThumbnail( const QImage& source, const QString& fileName,
- void * clientData = NULL, int priority = tnmWrapperPriorityIdle );
-
- /**
- * Set a thumbnail for an object file generated from source file.
- * thumbnailReady() signal will be emited when the operation is complete.
- *
- * @param sourceFileName Source file name from which the thumbnail will be created
- * @param targetFileName Target file name
- * @param clientData Pointer to arbitrary client data.
- * This pointer is not used by the API for
- * anything other than returning it in the
- * ThumbnailReady callback.
- * @param priority Priority for this operation
- * @return Thumbnail request ID or -1 if request failed. This can be used to
- * cancel the request or change priority.
- *
- */
- TNM_EXPORT int setThumbnail( const QString& sourceFileName, const QString& targetFileName,
- const QString& mimeType = QString(""), void * clientData = NULL,
- int priority = tnmWrapperPriorityIdle );
-
- /**
- * Delete all thumbnails for a given object. This is an asynchronous
- * operation, which always returns immediately.
- *
- * @param fileName Source file
- */
- TNM_EXPORT void deleteThumbnails( const QString& fileName );
-
- /**
- * Delete all thumbnails for a given object. This is an asynchronous
- * operation, which always returns immediately.
- *
- * @param thumbnailId thumbnail id
- */
- TNM_EXPORT void deleteThumbnails( unsigned long int thumbnailId );
-
- /**
- * Cancel a thumbnail operation.
- *
- * @param id Request ID for the operation to be cancelled.
- * @return true if cancelling was successful.
- */
- TNM_EXPORT bool cancelRequest( int id );
-
- /**
- * Change the priority of a queued thumbnail operation.
- *
- * @param id Request ID for the request which to assign a new
- * priority.
- * @param newPriority New priority value
- * @return true if change was successful.
- */
- TNM_EXPORT bool changePriority( int id, int newPriority );
-
-signals:
- /**
- * Final thumbnail bitmap generation or loading is complete.
- *
- * @param pixmap An object representing the resulting thumbnail.
- * @param clientData Client data
- * @param id Request ID for the operation
- * @param errorCode error code
- */
- TNM_EXPORT void thumbnailReady( QPixmap , void * , int , int );
-
- /**
- * Final thumbnail bitmap generation or loading is complete.
- *
- * @param image An object representing the resulting thumbnail.
- * @param clientData Client data
- * @param id Request ID for the operation
- * @param errorCode error code
- */
- TNM_EXPORT void thumbnailReady( QImage , void * , int , int );
-
-protected:
-
- void connectNotify(const char *signal);
-
- void disconnectNotify(const char *signal);
-
-private:
- ThumbnailManagerPrivate* d;
-
- friend class ThumbnailManagerPrivate;
- friend class TestThumbnailManager;
-};
-
-#endif // THUMBNAILMANAGER_QT
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/inc/thumbnailmanagerobserver.h
--- a/imagehandling_plat/thumbnailmanager_api/inc/thumbnailmanagerobserver.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,137 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Thumbnail Manager observer.
- *
-*/
-
-
-#ifndef THUMBNAILMANAGEROBSERVER_H
-#define THUMBNAILMANAGEROBSERVER_H
-
-#include "thumbnailobjectsource.h"
-
-class MThumbnailData;
-
-/**
- * Thumbnail observer.
- *
- * Callback interface for getting information about completed thumbnail
- * operations. This should be implemented by the client using the API.
- *
- * Example of how the client may implement the ThumbnailReady()
- * method:
- * @code
- * void CMyThumbnailControl::ThumbnailReady(
- * TInt aError,
- * MThumbnailData& aThumbnail,
- * TThumbnailRequestId aId )
- * {
- * // This function must not leave.
- * delete iBitmap;
- * iBitmap = NULL;
- *
- * if ( !aError )
- * {
- * // Claim ownership of the bitmap instance for later use
- * iBitmap = aThumbnail.DetachBitmap();
- * // We can now use iBitmap in our Draw() method
- * DrawDeferred();
- * }
- * else
- * {
- * // An error occurred while getting the thumbnail.
- * // Perhaps we should show a broken image icon to the user.
- * }
- * }
- * @endcode
- * @since S60 v5.0
- */
-class MThumbnailManagerObserver
- {
-public:
-
- /**
- * Preview thumbnail generation or loading is complete.
- *
- * This callback is not called unless EOptimizeForQualityWithPreview flag
- * was specified.
- *
- * This callback is not called if any of the following is true:
- * - an error occurred while processing the preview thumbnail
- * - a suitable existing thumbnail was not found
- * - a high quality thumbnail is already available
- *
- * The MThumbnailData instance is only valid for the duration of
- * this call. It may not be stored for later use. If the client should
- * want to use the bitmap data later, it can claim ownership of the
- * CFbsBitmap object by calling DetachBitmap().
- *
- * @since S60 v5.0
- * @param aThumbnail An object representing the resulting thumbnail.
- * @param aId Request ID for the operation
- */
- virtual void ThumbnailPreviewReady( MThumbnailData& aThumbnail,
- TThumbnailRequestId aId ) = 0;
-
- /**
- * Final thumbnail bitmap generation or loading is complete.
- *
- * The MThumbnailData instance is only valid for the duration of
- * this call. It may not be stored for later use. If the client should
- * want to use the bitmap data later, it can claim ownership of the
- * CFbsBitmap object by calling DetachBitmap().
- *
- * @since S60 v5.0
- * @param aError Error code.
- * @param aThumbnail An object representing the resulting thumbnail.
- * @param aId Request ID for the operation.
- */
- virtual void ThumbnailReady( TInt aError, MThumbnailData& aThumbnail,
- TThumbnailRequestId aId ) = 0;
-};
-
-/** Thumbnail request types */
-enum TThumbnailRequestType
- {
- ERequestDeleteThumbnails = 0
- };
-
-/**
- * Optional callback interface for getting information about other completed
- * requests that don't include a thumbnail.
- *
- * Request types:
- * - ERequestDeleteThumbnails
- *
- * Can be added using SetRequestObserver(MThumbnailManagerRequestObserver& aObserver)
- * and removed using RemoveRequestObserver().
- *
- * @since Symbian^3
- */
-class MThumbnailManagerRequestObserver
- {
-public:
- /**
- * A request is complete.
- *
- * @since Symbian^3
- * @param aError Error code.
- * @param aRequestType Type of the completed request.
- * @param aId Request ID for the operation.
- */
- virtual void ThumbnailRequestReady( TInt aError, TThumbnailRequestType aRequestType,
- TThumbnailRequestId aId ) = 0;
-};
-
-#endif // THUMBNAILMANAGEROBSERVER_H
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/inc/thumbnailobjectsource.h
--- a/imagehandling_plat/thumbnailmanager_api/inc/thumbnailobjectsource.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,364 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Class for encapsulating the data source for objects.
- *
-*/
-
-
-#ifndef THUMBNAILOBJECTSOURCE_H
-#define THUMBNAILOBJECTSOURCE_H
-
-#include
-#include
-
-typedef TUint32 TThumbnailId;
-
-class CFbsBitmap;
-
-/**
- * Object source for thumbnails.
- *
- * Class for encapsulating the data source for objects.
- *
- * @since S60 v5.0
- */
-NONSHARABLE_CLASS( CThumbnailObjectSource ): public CBase
- {
-public:
- /**
- * Construct a new CThumbnailObjectSource referring to an URI.
- * @param aUri Object URI or a full path to a file in the file system.
- * @param aMimeType MIME type. Optional, but should be specified if known.
- * @since S60 v5.0
- * @return New CThumbnailObjectSource instance.
- */
- IMPORT_C static CThumbnailObjectSource* NewL( const TDesC& aUri, const
- TDesC& aMimeType = KNullDesC );
-
- /**
- * Construct a new CThumbnailObjectSource referring to an URI.
- * @param aUri Object URI or a full path to a file in the file system.
- * @param aMimeType MIME type. Optional, but should be specified if known.
- * @since S60 v5.0
- * @return New CThumbnailObjectSource instance.
- */
- IMPORT_C static CThumbnailObjectSource* NewLC( const TDesC& aUri, const
- TDesC& aMimeType = KNullDesC );
-
- /**
- * Construct a new CThumbnailObjectSource referring to a file handle.
- * The file handle must refer to an open file and it must remain
- * valid until this object source is deleted.
- *
- * @param aFile File handle.
- * @param aMimeType MIME type. Optional, but should be specified if known.
- * @since S60 v5.0
- * @return New CThumbnailObjectSource instance.
- */
- IMPORT_C static CThumbnailObjectSource* NewL( const RFile64& aFile, const
- TDesC& aMimeType = KNullDesC );
-
- /**
- * Construct a new CThumbnailObjectSource referring to a file handle.
- * The file handle must refer to an open file and it must remain
- * valid until this object source is deleted.
- *
- * @param aFile File handle.
- * @param aMimeType MIME type. Optional, but should be specified if known.
- * @since S60 v5.0
- * @return New CThumbnailObjectSource instance.
- */
- IMPORT_C static CThumbnailObjectSource* NewLC( const RFile64& aFile, const
- TDesC& aMimeType = KNullDesC );
-
- /**
- * Destructor
- *
- * @since S60 v5.0
- */
- virtual ~CThumbnailObjectSource();
-
-public:
-
- /**
- * Returns file handle.
- *
- * @since S60 v5.0
- * @return reference to file handle
- */
- IMPORT_C RFile64& FileHandle();
-
- /**
- * Returns source uri.
- *
- * @since S60 v5.0
- * @return uri
- */
- IMPORT_C const TDesC& Uri();
-
-private:
-
- /**
- * C++ default constructor
- *
- * @since S60 v5.0
- */
- CThumbnailObjectSource();
-
- /**
- * Symbian 2nd phase constructor can leave.
- *
- * @since S60 v5.0
- * @param aUri Object URI or a full path to a file in the file system.
- * @param aMimeType MIME type. Optional, but should be specified if known.
- */
- void ConstructL( const TDesC& aUri, const TDesC& aMimeType );
-
- /**
- * Symbian 2nd phase constructor can leave.
- *
- * @since S60 v5.0
- * @param aFile File handle.
- * @param aMimeType MIME type. Optional, but should be specified if known.
- */
- void ConstructL( const RFile64& aFile, const TDesC& aMimeType );
-
- /**
- * Symbian 2nd phase constructor can leave.
- *
- * @since S60 v5.0
- * @param aURI URI.
- * @param aMimeType MimeType.
- * @param aThumbnailId ThumbnailId
- */
- void ConstructL( const TDesC& aUri, const TDesC& aMimeType, TThumbnailId aThumbnailId );
-
- /**
- * Symbian 2nd phase constructor can leave.
- *
- * @since S60 v5.0
- * @param aBitmap Bitmap.
- * @param aURI URI.
- */
- void ConstructL( CFbsBitmap* aBitmap, const TDesC& aUri );
-
- /**
- * Symbian 2nd phase constructor can leave.
- *
- * @since S60 v5.0
- * @param aBuffer Buffer.
- * @param aMimeType MIME type. Optional, but should be specified if known.
- * @param aURI URI.
- */
- void ConstructL( TDesC8* aBuffer, const TDesC& aMimeType, const TDesC& aUri );
-
- /**
- * Symbian 2nd phase constructor can leave.
- *
- * @since Symbian^3
- * @param aUri Object URI or a full path to a file in the file system.
- * @param aTargetUri For linking the thumbnail to a different URI.
- * @param aMimeType MIME type. Optional, but should be specified if known.
- */
- void ConstructL( const TDesC& aUri, const TDesC& aTargetUri, const TDesC& aMimeType );
-
-private:
- // data
-
- /**
- * File
- */
- RFile64 iFile;
-
- /**
- * Uri
- */
- HBufC* iUri; // own
-
- /**
- * Mime type
- */
- HBufC8* iMimeType; // own
-
- /**
- * Buffer
- */
- TDesC8* iBuffer; // own
-
- /**
- * Bitmap
- */
- CFbsBitmap* iBitmap; // own
-
- /**
- * ThumbnailId
- */
- TThumbnailId iThumbnailId; //own
-
- /**
- * Uri
- */
- HBufC* iTargetUri; // own
-
-public:
-
- /**
- * Construct a new CThumbnailObjectSource referring to a buffer
- * containing an image.
- *
- * @param aBuffer Buffer.
- * @param aUri Object URI or a full path to a file in the file system.
- * @since S60 v5.0
- * @return New CThumbnailObjectSource instance.
- */
- IMPORT_C static CThumbnailObjectSource* NewL( CFbsBitmap* aBitmap, const TDesC& aUri );
-
- /**
- * Construct a new CThumbnailObjectSource referring to a buffer
- * containing an image.
- *
- * @param aFile File handle.
- * @param aUri Object URI or a full path to a file in the file system.
- * @since S60 v5.0
- * @return New CThumbnailObjectSource instance.
- */
- IMPORT_C static CThumbnailObjectSource* NewLC( CFbsBitmap* aBitmap, const TDesC& aUri );
-
- /**
- * Construct a new CThumbnailObjectSource referring to a buffer
- * containing an image.
- *
- * @param aBuffer Buffer.
- * @param aUri Object URI or a full path to a file in the file system.
- * @since S60 v5.0
- * @return New CThumbnailObjectSource instance.
- */
- IMPORT_C static CThumbnailObjectSource* NewL( TDesC8* aBuffer, TDesC& aMimeType,
- const TDesC& aUri );
-
- /**
- * Construct a new CThumbnailObjectSource referring to a buffer
- * containing an image.
- *
- * @param aBuffer Buffer.
- * @param aMimeType MIME type. Optional, but should be specified if known.
- * @param aUri Object URI or a full path to a file in the file system.
- * @since S60 v5.0
- * @return New CThumbnailObjectSource instance.
- */
- IMPORT_C static CThumbnailObjectSource* NewLC( TDesC8* aBuffer, TDesC& aMimeType,
- const TDesC& aUri);
-
- /**
- * Construct a new CThumbnailObjectSource referring to an URI.
- * @param aUri Object URI or a full path to a file in the file system.
- * @param aMimeType MIME type. Optional, but should be specified if known.
- * @since S60 v5.0
- * @return New CThumbnailObjectSource instance.
- */
- IMPORT_C static CThumbnailObjectSource* NewL( const TDesC& aUri,
- TThumbnailId aThumbnailId = 0, const TDesC& aMimeType = KNullDesC );
-
- /**
- * Construct a new CThumbnailObjectSource referring to an URI.
- * @param aUri Object URI or a full path to a file in the file system.
- * @param aMimeType MIME type. Optional, but should be specified if known.
- * @since S60 v5.0
- * @return New CThumbnailObjectSource instance.
- */
- IMPORT_C static CThumbnailObjectSource* NewLC( const TDesC& aUri,
- TThumbnailId aThumbnailId = 0, const TDesC& aMimeType = KNullDesC );
-
- /**
- * Returns source buffer.
- *
- * @since S60 v5.0
- * @return buffer
- */
- IMPORT_C TDesC8* Buffer();
-
- /**
- * Gets ownership of buffer from source object.
- * After that Buffer() returns NULL.
- *
- * @since S60 v5.0
- * @return buffer
- */
- IMPORT_C TDesC8* GetBufferOwnership();
-
- /**
- * Gets MIME type.
- *
- * @since S60 v5.0
- * @return MIME type
- */
- IMPORT_C const TDesC8& MimeType();
-
- /**
- * Gets ThumbnailId.
- *
- * @since S60 v5.0
- * @return ThumbnailId
- */
- IMPORT_C TThumbnailId Id();
-
- /**
- * Returns source bitmap.
- *
- * @since S60 v5.0
- * @return bitmap
- */
- IMPORT_C CFbsBitmap* Bitmap();
-
- /**
- * Gets ownership of bitmap from source object.
- * After that Bitmap() returns NULL.
- *
- * @since S60 v5.0
- * @return bitmap
- */
- IMPORT_C CFbsBitmap* GetBitmapOwnership();
-
- /**
- * Construct a new CThumbnailObjectSource referring to an URI.
- * @param aUri Object URI or a full path to a file in the file system.
- * @param aTargetUri For linking the thumbnail to a different URI.
- * @param aMimeType MIME type. Optional, but should be specified if known.
- * @since Symbian^3
- * @return New CThumbnailObjectSource instance.
- */
- IMPORT_C static CThumbnailObjectSource* NewL( const TDesC& aUri,
- const TDesC& aTargetUri, const TDesC& aMimeType );
-
- /**
- * Construct a new CThumbnailObjectSource referring to an URI.
- * @param aUri Object URI or a full path to a file in the file system.
- * @param aTargetUri For linking the thumbnail to a different URI.
- * @param aMimeType MIME type.
- * @since Symbian^3
- * @return New CThumbnailObjectSource instance.
- */
- IMPORT_C static CThumbnailObjectSource* NewLC( const TDesC& aUri,
- const TDesC& aTargetUri, const TDesC& aMimeType );
-
- /**
- * Returns target uri.
- *
- * @since Symbian^3
- * @return uri
- */
- IMPORT_C const TDesC& TargetUri();
-};
-
-#endif // THUMBNAILOBJECTSOURCE_H
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/thumbnailmanager_api.metaxml
--- a/imagehandling_plat/thumbnailmanager_api/thumbnailmanager_api.metaxml Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-
-
-thumbnailmanager_api
-Thumbnail engine can be used to request thumbnails for different kinds of media objects.
-c++
-imagehandlingutilities
-
-
-
-
-no
-no
-
-
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/Bmarm/ThumbnailManagerTestu.def
--- a/imagehandling_plat/thumbnailmanager_api/tsrc/Bmarm/ThumbnailManagerTestu.def Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
- LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &)
-
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/Bwins/ThumbnailManagerTestu.def
--- a/imagehandling_plat/thumbnailmanager_api/tsrc/Bwins/ThumbnailManagerTestu.def Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
- ?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &)
-
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/conf/ThumbnailManagerTest.cfg
--- a/imagehandling_plat/thumbnailmanager_api/tsrc/conf/ThumbnailManagerTest.cfg Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,2268 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Thumbnail Manager API tests
-*
-*/
-
-
-[StifSettings]
-TestThreadStackSize= 32768
-TestThreadMinHeap= 4096
-TestThreadMaxHeap= 67108860
-[EndStifSettings]
-
-
-// ---------------------------------------------------------------------------
-// Thumbnail Manager API test cases
-// ---------------------------------------------------------------------------
-
-// These should be run in sequential mode if several cases are run at the same
-// time! Running multiple cases in parallel will not work, because the test
-// cases assume they can delete the database file between tests.
-
-
-// ---------------------------------------------------------------------------
-// Define constants
-// ---------------------------------------------------------------------------
-[Define]
-
-KErrNotFound -1
-KErrGeneral -2
-KErrNotSupported -5
-KErrArgument -6
-
-KMaxTInt 2147483647
-
-// Delay between test cases (milliseconds)
-KTestDelay 1000
-
-KOneSecondDelay 1000
-KFiveSecondDelay 5000
-KTenSecondDelay 10000
-
-// A delay to make sure the client-server request to generate a thumbnail
-// reaches the server, but doesn't have enough time to complete yet
-// (milliseconds)
-KClientServerDelay 150
-KClientServerDelay2 25
-KClientServerDelay3 10
-
-// From TDisplayMode: value for 24-bit display mode
-EColor16M 8
-EColor64K 7
-KDefaultDisplayMode 7
-
-// From CThumbnailManager::TThumbeFlags
-EDefaultFlags 0
-EAllowAnySize 1
-EDoNotCreate 2
-ECropToAspectRatio 4
-
-// From CThumbnailManager::TThumbeQualityPreference
-EOptimizeForQuality 0
-EOptimizeForPerformance 1
-EOptimizeForQualityWithPreview 2
-
-EUnknownThumbnailSize 0
-ECustomThumbnailSize 1
-EImageGridThumbnailSize 2
-EImageListThumbnailSize 3
-EImageFullScreenThumbnailSize 4
-EVideoGridThumbnailSize 5
-EVideoListThumbnailSize 6
-EVideoFullScreenThumbnailSize 7
-EAudioGridThumbnailSize 8
-EAudioListThumbnailSize 9
-EAudioFullScreenThumbnailSize 10
-EGridThumbnailSize = 11
-EListThumbnailSize = 12
-EFullScreenThumbnailSize = 13
-EContactGridThumbnailSize = 14
-EContactListThumbnailSize = 15
-EContactFullScreenThumbnailSize = 16
-
-// Custom sizes
-KCustomSizeX 111
-KCustomSizeY 222
-KCustomSize2X 222
-KCustomSize2Y 111
-KCustomSize3X 10
-KCustomSize3Y 100
-KCustomSize4X 100
-KCustomSize4Y 10
-KCustomSize5X 1000
-KCustomSize5Y 1000
-KCustomSize6X 1000
-KCustomSize6Y 2000
-KCustomSize7X 2000
-KCustomSize7Y 1000
-KCustomSize8X 1
-KCustomSize8Y 1
-KCustomSize9X 555
-KCustomSize9Y 556
-KCustomSize10X 556
-KCustomSize10Y 555
-
-[Enddefine]
-
-
-// ---------------------------------------------------------------------------
-// Create and delete CThumbnailManager
-// ---------------------------------------------------------------------------
-[Test]
-title Create and delete CThumbnailManager
-create ThumbnailManagerTest tn
-tn CreateInstanceL
-pause KOneSecondDelay
-tn DeleteInstance
-delete tn
-pause KTestDelay
-[Endtest]
-
-// ---------------------------------------------------------------------------
-// Set and check parameters
-// ---------------------------------------------------------------------------
-[Test]
-title Set and check parameters
-create ThumbnailManagerTest tn
-tn CreateInstanceL
-
-tn SetThumbnailSizeL 0 0
-tn CheckThumbnailSizeL 0 0
-tn SetThumbnailSizeL 1 1
-tn CheckThumbnailSizeL 1 1
-tn SetThumbnailSizeL KMaxTInt KMaxTInt
-tn CheckThumbnailSizeL KMaxTInt KMaxTInt
-tn SetThumbnailEnumSizeL EUnknownThumbnailSize
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn SetThumbnailEnumSizeL EVideoFullScreenThumbnailSize
-tn SetThumbnailEnumSizeL KMaxTInt
-
-tn SetFlagsL EDefaultFlags
-tn CheckFlags EDefaultFlags
-tn SetFlagsL EAllowAnySize
-tn CheckFlags EAllowAnySize
-tn SetFlagsL KMaxTInt
-tn CheckFlags KMaxTInt
-
-tn SetQualityPreferenceL EOptimizeForQuality
-tn CheckQualityPreference EOptimizeForQuality
-tn SetQualityPreferenceL EOptimizeForPerformance
-tn CheckQualityPreference EOptimizeForPerformance
-tn SetQualityPreferenceL KMaxTInt
-tn CheckQualityPreference KMaxTInt
-
-tn SetDisplayModeL EColor16M
-tn CheckDisplayModeL EColor16M
-tn SetDisplayModeL EColor64K
-tn CheckDisplayModeL EColor64K
-tn SetDisplayModeL 0
-tn CheckDisplayModeL 0
-tn SetDisplayModeL KMaxTInt
-tn CheckDisplayModeL KMaxTInt
-
-tn DeleteInstance
-delete tn
-pause KTestDelay
-[Endtest]
-
-// ---------------------------------------------------------------------------
-// Create object sources
-// ---------------------------------------------------------------------------
-[Test]
-title Create object sources
-create ThumbnailManagerTest tn
-tn CreateInstanceL
-
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\RGB_VGA.jpg
-tn DeleteSourceInstance
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\Tiny_1x1.jpg
-tn DeleteSourceInstance
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\video.3gp
-tn DeleteSourceInstance
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\empty_file.bmp
-tn DeleteSourceInstance
-
-tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\RGB_VGA.jpg
-tn DeleteSourceInstance
-tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\Tiny_1x1.jpg
-tn DeleteSourceInstance
-tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\video.3gp
-tn DeleteSourceInstance
-tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\empty_file.bmp
-tn DeleteSourceInstance
-
-tn CreateSourceInstanceBufferL \data\ThumbnailManagerTest\RGB_VGA.jpg image/jpeg
-tn DeleteSourceInstance
-tn CreateSourceInstanceBufferL \data\ThumbnailManagerTest\Tiny_1x1.jpg image/jpeg
-tn DeleteSourceInstance
-tn CreateSourceInstanceBufferL \data\ThumbnailManagerTest\empty_file.bmp image/bmp
-tn DeleteSourceInstance
-
-tn DeleteInstance
-delete tn
-pause KTestDelay
-[Endtest]
-
-
-// ---------------------------------------------------------------------------
-// Create JPEG thumbnail
-// ---------------------------------------------------------------------------
-[Test]
-title Create JPEG thumbnail
-create ThumbnailManagerTest tn
-tn CreateInstanceL
-tn SetDisplayModeL EColor16M
-
-// using path
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\RGB_VGA.jpg
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageFullScreenThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-// using handle
-tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\RGB_VGA.jpg
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageFullScreenThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn DeleteInstance
-delete tn
-pause KTestDelay
-[Endtest]
-
-// ---------------------------------------------------------------------------
-// Create GIF thumbnail
-// ---------------------------------------------------------------------------
-[Test]
-title Create GIF thumbnail
-create ThumbnailManagerTest tn
-tn CreateInstanceL
-tn SetDisplayModeL EColor16M
-
-// using path
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\WIDE_800x400.gif
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageFullScreenThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-// using handle
-tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\WIDE_800x400.gif
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageFullScreenThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn DeleteInstance
-delete tn
-pause KTestDelay
-[Endtest]
-
-// ---------------------------------------------------------------------------
-// Create SVG thumbnail
-// ---------------------------------------------------------------------------
-[Test]
-title Create SVG thumbnail
-create ThumbnailManagerTest tn
-tn CreateInstanceL
-tn SetDisplayModeL EColor16M
-
-// using path
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\SVG_640x480.svg
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageFullScreenThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-// using handle
-tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\SVG_640x480.svg
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageFullScreenThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn DeleteInstance
-delete tn
-pause KTestDelay
-[Endtest]
-
-// ---------------------------------------------------------------------------
-// Create BMP thumbnail
-// ---------------------------------------------------------------------------
-[Test]
-title Create BMP thumbnail
-create ThumbnailManagerTest tn
-tn CreateInstanceL
-tn SetDisplayModeL EColor16M
-
-// using path
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\RGB_400x300.bmp
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageFullScreenThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-// using handle
-tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\RGB_400x300.bmp
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageFullScreenThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn DeleteInstance
-delete tn
-pause KTestDelay
-[Endtest]
-
-// ---------------------------------------------------------------------------
-// Create 3GP thumbnail
-// ---------------------------------------------------------------------------
-[Test]
-title Create 3GP thumbnail
-create ThumbnailManagerTest tn
-tn CreateInstanceL
-tn SetDisplayModeL EColor16M
-
-// using path
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\video.3gp
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EVideoGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EVideoGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EVideoFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EVideoFullScreenThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-// using handle
-tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\video.3gp
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EVideoGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EVideoGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EVideoFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EVideoFullScreenThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn DeleteInstance
-delete tn
-pause KTestDelay
-[Endtest]
-
-// ---------------------------------------------------------------------------
-// Create MPEG4 thumbnail
-// ---------------------------------------------------------------------------
-[Test]
-title Create MPEG4 thumbnail
-create ThumbnailManagerTest tn
-tn CreateInstanceL
-tn SetDisplayModeL EColor16M
-
-// using path
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\Videoclip.mp4
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EVideoGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EVideoGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EVideoFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EVideoFullScreenThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-// using handle
-tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\Videoclip.mp4
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EVideoGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EVideoGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EVideoFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EVideoFullScreenThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn DeleteInstance
-delete tn
-pause KTestDelay
-[Endtest]
-
-// ---------------------------------------------------------------------------
-// Create MP3 thumbnail
-// ---------------------------------------------------------------------------
-[Test]
-title Create MP3 thumbnail
-create ThumbnailManagerTest tn
-tn CreateInstanceL
-tn SetDisplayModeL EColor16M
-
-// using path
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\mp3.mp3
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EAudioGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EAudioGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EAudioFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EAudioFullScreenThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-// using handle
-tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\mp3.mp3
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EAudioGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EAudioGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EAudioFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EAudioFullScreenThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn DeleteInstance
-delete tn
-pause KTestDelay
-[Endtest]
-
-// ---------------------------------------------------------------------------
-// Create MP3 thumbnail with PNG album art
-// ---------------------------------------------------------------------------
-[Test]
-title Create MP3 thumbnail with PNG album art
-create ThumbnailManagerTest tn
-tn CreateInstanceL
-tn SetDisplayModeL EColor16M
-
-// using path
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\mp3_png.mp3
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageFullScreenThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn DeleteInstance
-delete tn
-pause KTestDelay
-[Endtest]
-
-// ---------------------------------------------------------------------------
-// Create thumbnail preview from JPG with EXIF
-// ---------------------------------------------------------------------------
-[Test]
-title Create thumbnail preview from JPG with EXIF
-create ThumbnailManagerTest tn
-tn CreateInstanceL
-tn SetDisplayModeL EColor16M
-
-// jpg with exif
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\RGB_VGA.jpg
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn SetQualityPreferenceL EOptimizeForQualityWithPreview
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-// png with exif
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\exif.png
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn SetQualityPreferenceL EOptimizeForQualityWithPreview
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-// no exif
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\no_exif.jpg
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn SetQualityPreferenceL EOptimizeForQualityWithPreview
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn DeleteInstance
-delete tn
-pause KTestDelay
-[Endtest]
-
-// ---------------------------------------------------------------------------
-// Create thumbnail from WMA PNG & empty album arts
-// ---------------------------------------------------------------------------
-[Test]
-title Create thumbnail from WMA PNG & empty album arts
-create ThumbnailManagerTest tn
-tn CreateInstanceL
-tn SetDisplayModeL EColor16M
-
-// try to create thumbnail from PNG
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\wma_png.wma
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EAudioFullScreenThumbnailSize
-tn GetThumbnailL
-allownextresult KErrNotFound
-waittestclass tn
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-// try to create thumbnail without album art
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\wma_empty.wma
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EAudioFullScreenThumbnailSize
-tn GetThumbnailL
-allownextresult KErrNotFound
-waittestclass tn
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn DeleteInstance
-delete tn
-pause KTestDelay
-[Endtest]
-
-
-// ---------------------------------------------------------------------------
-// Create thumbs from buffer
-// ---------------------------------------------------------------------------
-[Test]
-title Create thumbs from buffer
-create ThumbnailManagerTest tn
-tn CreateInstanceL
-tn SetDisplayModeL EColor16M
-
-tn CreateSourceInstanceBufferL \data\ThumbnailManagerTest\RGB_VGA.jpg image/jpeg
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageFullScreenThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn CreateSourceInstanceBufferL \data\ThumbnailManagerTest\RGB_400x300.bmp image/bmp
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageFullScreenThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn CreateSourceInstanceBufferL \data\ThumbnailManagerTest\8bit_PNG.png image/png
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageFullScreenThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn CreateSourceInstanceBufferL \data\ThumbnailManagerTest\SVG_640x480.svg image/svg+xml
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageFullScreenThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn DeleteInstance
-delete tn
-pause KTestDelay
-[Endtest]
-
-// ---------------------------------------------------------------------------
-// Create thumbs from CFbsBitmap
-// ---------------------------------------------------------------------------
-[Test]
-title Create thumbs from CFbsBitmap
-create ThumbnailManagerTest tn
-tn CreateInstanceL
-tn SetDisplayModeL EColor16M
-
-tn SetFlagsL EDefaultFlags
-tn CreateSourceInstanceBitmapL \data\ThumbnailManagerTest\TestMBM.mbm \data\ThumbnailManagerTest\camera.jpg
-tn DeleteThumbnails
-tn CreateThumbnails
-waittestclass tn
-
-pause KTenSecondDelay
-
-tn DeleteSourceInstance
-
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\camera.jpg
-tn SetFlagsL EDoNotCreate
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn SetThumbnailEnumSizeL EImageFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageFullScreenThumbnailSize EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn DeleteInstance
-delete tn
-pause KTestDelay
-[Endtest]
-
-
-// ---------------------------------------------------------------------------
-// Create image/audio/video thumbs
-// ---------------------------------------------------------------------------
-[Test]
-title Create image/audio/video thumbs
-create ThumbnailManagerTest tn
-tn CreateInstanceL
-tn SetDisplayModeL EColor16M
-
-// try to create thumbnail from image
-tn CreateThumbnailsByUrlL \data\ThumbnailManagerTest\RGB_VGA.jpg
-waittestclass tn
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-// try to create thumbnail from music
-tn CreateThumbnailsByUrlL \data\ThumbnailManagerTest\mp3_png.mp3
-waittestclass tn
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-// try to create thumbnail from video
-tn CreateThumbnailsByUrlL \data\ThumbnailManagerTest\Videoclip.mp4
-waittestclass tn
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn DeleteInstance
-delete tn
-pause KTestDelay
-[Endtest]
-
-
-// ---------------------------------------------------------------------------
-// Create thumbnails for each persistent size
-// ---------------------------------------------------------------------------
-[Test]
-title Create thumbnails for each persistent size
-create ThumbnailManagerTest tn
-tn CreateInstanceL
-tn SetDisplayModeL EColor16M
-
-tn SetFlagsL EDefaultFlags
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\RGB_VGA.jpg
-tn DeleteThumbnails
-tn CreateThumbnails
-waittestclass tn
-
-pause KTenSecondDelay
-
-tn SetFlagsL EDoNotCreate
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn SetThumbnailEnumSizeL EImageListThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageListThumbnailSize EColor16M
-tn SetThumbnailEnumSizeL EImageFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageFullScreenThumbnailSize EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn SetFlagsL EDefaultFlags
-tn CreateSourceInstanceBufferL \data\ThumbnailManagerTest\RGB_VGA.jpg image/jpeg
-tn DeleteThumbnails
-tn CreateThumbnails
-waittestclass tn
-
-pause KTenSecondDelay
-
-tn SetFlagsL EDoNotCreate
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn SetThumbnailEnumSizeL EImageListThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageListThumbnailSize EColor16M
-tn SetThumbnailEnumSizeL EImageFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageFullScreenThumbnailSize EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn SetFlagsL EDefaultFlags
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\RGB_400x300.bmp
-tn DeleteThumbnails
-tn CreateThumbnails
-waittestclass tn
-
-pause KTenSecondDelay
-
-tn SetFlagsL EDoNotCreate
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn SetThumbnailEnumSizeL EImageListThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageListThumbnailSize EColor16M
-tn SetThumbnailEnumSizeL EImageFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageFullScreenThumbnailSize EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn SetFlagsL EDefaultFlags
-tn CreateSourceInstanceBufferL \data\ThumbnailManagerTest\RGB_400x300.bmp image/bmp
-tn DeleteThumbnails
-tn CreateThumbnails
-waittestclass tn
-
-pause KTenSecondDelay
-
-tn SetFlagsL EDoNotCreate
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn SetThumbnailEnumSizeL EImageListThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageListThumbnailSize EColor16M
-tn SetThumbnailEnumSizeL EImageFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageFullScreenThumbnailSize EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn SetFlagsL EDefaultFlags
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\video.3gp
-tn DeleteThumbnails
-tn CreateThumbnails
-waittestclass tn
-
-pause KTenSecondDelay
-
-tn SetFlagsL EDoNotCreate
-tn SetThumbnailEnumSizeL EVideoGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EVideoGridThumbnailSize EColor16M
-tn SetThumbnailEnumSizeL EVideoListThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EVideoListThumbnailSize EColor16M
-tn SetThumbnailEnumSizeL EVideoFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EVideoFullScreenThumbnailSize EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn DeleteInstance
-delete tn
-pause KTestDelay
-[Endtest]
-
-// ---------------------------------------------------------------------------
-// Custom size thumbs
-// ---------------------------------------------------------------------------
-[Test]
-title Custom size thumbs
-create ThumbnailManagerTest tn
-tn CreateInstanceL
-tn SetDisplayModeL EColor16M
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\RGB_VGA.jpg
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize2X KCustomSize2Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize2X KCustomSize2Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize3X KCustomSize3Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize3X KCustomSize3Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize4X KCustomSize4Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize4X KCustomSize4Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize5X KCustomSize5Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize5X KCustomSize5Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize6X KCustomSize6Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize6X KCustomSize6Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize7X KCustomSize7Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize7X KCustomSize7Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize8X KCustomSize8Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize8X KCustomSize8Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize9X KCustomSize9Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize9X KCustomSize9Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize10X KCustomSize10Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize10X KCustomSize10Y EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\TALL_400x800.bmp
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize2X KCustomSize2Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize2X KCustomSize2Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize3X KCustomSize3Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize3X KCustomSize3Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize4X KCustomSize4Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize4X KCustomSize4Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize5X KCustomSize5Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize5X KCustomSize5Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize6X KCustomSize6Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize6X KCustomSize6Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize7X KCustomSize7Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize7X KCustomSize7Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize8X KCustomSize8Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize8X KCustomSize8Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize9X KCustomSize9Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize9X KCustomSize9Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize10X KCustomSize10Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize10X KCustomSize10Y EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\WIDE_800x400.gif
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize2X KCustomSize2Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize2X KCustomSize2Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize3X KCustomSize3Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize3X KCustomSize3Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize4X KCustomSize4Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize4X KCustomSize4Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize5X KCustomSize5Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize5X KCustomSize5Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize6X KCustomSize6Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize6X KCustomSize6Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize7X KCustomSize7Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize7X KCustomSize7Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize8X KCustomSize8Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize8X KCustomSize8Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize9X KCustomSize9Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize9X KCustomSize9Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize10X KCustomSize10Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize10X KCustomSize10Y EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn DeleteInstance
-delete tn
-pause KTestDelay
-[Endtest]
-
-// ---------------------------------------------------------------------------
-// Custom size thumbs with cropping
-// ---------------------------------------------------------------------------
-[Test]
-title Custom size thumbs with cropping
-create ThumbnailManagerTest tn
-tn CreateInstanceL
-tn SetDisplayModeL EColor16M
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-
-tn SetFlagsL ECropToAspectRatio
-
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\RGB_VGA.jpg
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize2X KCustomSize2Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize2X KCustomSize2Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize3X KCustomSize3Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize3X KCustomSize3Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize4X KCustomSize4Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize4X KCustomSize4Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize5X KCustomSize5Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize5X KCustomSize5Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize6X KCustomSize6Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize6X KCustomSize6Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize7X KCustomSize7Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize7X KCustomSize7Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize8X KCustomSize8Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize8X KCustomSize8Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize9X KCustomSize9Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize9X KCustomSize9Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize10X KCustomSize10Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize10X KCustomSize10Y EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\TALL_400x800.bmp
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize2X KCustomSize2Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize2X KCustomSize2Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize3X KCustomSize3Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize3X KCustomSize3Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize4X KCustomSize4Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize4X KCustomSize4Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize5X KCustomSize5Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize5X KCustomSize5Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize6X KCustomSize6Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize6X KCustomSize6Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize7X KCustomSize7Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize7X KCustomSize7Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize8X KCustomSize8Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize8X KCustomSize8Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize9X KCustomSize9Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize9X KCustomSize9Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize10X KCustomSize10Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize10X KCustomSize10Y EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\WIDE_800x400.gif
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize2X KCustomSize2Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize2X KCustomSize2Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize3X KCustomSize3Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize3X KCustomSize3Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize4X KCustomSize4Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize4X KCustomSize4Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize5X KCustomSize5Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize5X KCustomSize5Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize6X KCustomSize6Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize6X KCustomSize6Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize7X KCustomSize7Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize7X KCustomSize7Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize8X KCustomSize8Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize8X KCustomSize8Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize9X KCustomSize9Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize9X KCustomSize9Y EColor16M
-tn DeleteThumbnails
-tn SetThumbnailSizeL KCustomSize10X KCustomSize10Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize10X KCustomSize10Y EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn DeleteInstance
-delete tn
-pause KTestDelay
-[Endtest]
-
-// ---------------------------------------------------------------------------
-// Different display modes
-// ---------------------------------------------------------------------------
-[Test]
-title Different display modes
-create ThumbnailManagerTest tn
-tn CreateInstanceL
-
-// 24-bit
-tn SetDisplayModeL EColor16M
-
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\RGB_VGA.jpg
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageFullScreenThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSize5X KCustomSize5Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize5X KCustomSize5Y EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn CreateSourceInstanceBufferL \data\ThumbnailManagerTest\RGB_VGA.jpg image/jpeg
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageFullScreenThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSize5X KCustomSize5Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize5X KCustomSize5Y EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\RGB_400x300.bmp
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageFullScreenThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSize5X KCustomSize5Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize5X KCustomSize5Y EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn CreateSourceInstanceBufferL \data\ThumbnailManagerTest\RGB_400x300.bmp image/bmp
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageFullScreenThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSize5X KCustomSize5Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize5X KCustomSize5Y EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\video.3gp
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EVideoGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EVideoGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EVideoFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EVideoFullScreenThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSize5X KCustomSize5Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize5X KCustomSize5Y EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\Videoclip.mp4
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EVideoGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EVideoGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EVideoFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EVideoFullScreenThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSize5X KCustomSize5Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize5X KCustomSize5Y EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-// 16-bit
-tn SetDisplayModeL EColor64K
-
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\RGB_VGA.jpg
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor64K
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageFullScreenThumbnailSize EColor64K
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor64K
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSize5X KCustomSize5Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize5X KCustomSize5Y EColor64K
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn CreateSourceInstanceBufferL \data\ThumbnailManagerTest\RGB_VGA.jpg image/jpeg
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor64K
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageFullScreenThumbnailSize EColor64K
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor64K
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSize5X KCustomSize5Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize5X KCustomSize5Y EColor64K
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\RGB_400x300.bmp
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor64K
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageFullScreenThumbnailSize EColor64K
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor64K
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSize5X KCustomSize5Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize5X KCustomSize5Y EColor64K
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn CreateSourceInstanceBufferL \data\ThumbnailManagerTest\RGB_400x300.bmp image/bmp
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor64K
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageFullScreenThumbnailSize EColor64K
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor64K
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSize5X KCustomSize5Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize5X KCustomSize5Y EColor64K
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\video.3gp
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EVideoGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EVideoGridThumbnailSize EColor64K
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EVideoFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EVideoFullScreenThumbnailSize EColor64K
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor64K
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSize5X KCustomSize5Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize5X KCustomSize5Y EColor64K
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\Videoclip.mp4
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EVideoGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EVideoGridThumbnailSize EColor64K
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EVideoFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EVideoFullScreenThumbnailSize EColor64K
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor64K
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSize5X KCustomSize5Y
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSize5X KCustomSize5Y EColor64K
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn DeleteInstance
-delete tn
-pause KTestDelay
-[Endtest]
-
-
-// ---------------------------------------------------------------------------
-// Thumbnail from missing or unsupported file
-// ---------------------------------------------------------------------------
-[Test]
-title Thumbnail from missing or unsupported file
-create ThumbnailManagerTest tn
-tn CreateInstanceL
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\does_not_exist.jpg
-tn GetThumbnailL
-allownextresult KErrNotFound
-waittestclass tn
-tn DeleteSourceInstance
-
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\Unsupported.txt
-tn GetThumbnailL
-allownextresult KErrNotSupported
-waittestclass tn
-tn DeleteSourceInstance
-
-tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\Unsupported.txt
-tn GetThumbnailL
-allownextresult KErrNotSupported
-waittestclass tn
-tn DeleteSourceInstance
-
-tn CreateSourceInstanceBufferL \data\ThumbnailManagerTest\Unsupported.txt plain/text
-tn GetThumbnailL
-allownextresult KErrNotSupported
-waittestclass tn
-tn DeleteSourceInstance
-
-tn DeleteInstance
-delete tn
-pause KTestDelay
-[Endtest]
-
-// ---------------------------------------------------------------------------
-// Thumbnail from corrupt file
-// ---------------------------------------------------------------------------
-[Test]
-title Thumbnail from corrupt file
-create ThumbnailManagerTest tn
-tn CreateInstanceL
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\not_jpg.jpg
-tn GetThumbnailL
-allownextresult KErrNotFound
-waittestclass tn
-tn DeleteSourceInstance
-
-tn CreateSourceInstanceBufferL \data\ThumbnailManagerTest\not_jpg.jpg image/jpeg
-tn GetThumbnailL
-allownextresult KErrNotFound
-waittestclass tn
-tn DeleteSourceInstance
-
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\not_3gp.3gp
-tn GetThumbnailL
-allownextresult KErrNotSupported
-waittestclass tn
-tn DeleteSourceInstance
-
-tn DeleteInstance
-delete tn
-pause KTestDelay
-[Endtest]
-
-
-// ---------------------------------------------------------------------------
-// Set thumbnail from buffer
-// ---------------------------------------------------------------------------
-[Test]
-title Set thumbnail from buffer
-create ThumbnailManagerTest tn
-tn CreateInstanceL
-tn SetDisplayModeL EColor16M
-
-tn SetFlagsL EDefaultFlags
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn CreateSourceInstanceBufferL \data\ThumbnailManagerTest\RGB_VGA.jpg image/jpeg
-tn DeleteThumbnails
-tn SetThumbnailL
-
-waittestclass tn
-
-tn SetFlagsL EDoNotCreate
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn SetFlagsL EDefaultFlags
-tn CreateSourceInstanceBufferL \data\ThumbnailManagerTest\RGB_400x300.bmp image/bmp
-tn DeleteThumbnails
-tn SetThumbnailL
-
-waittestclass tn
-
-tn SetFlagsL EDoNotCreate
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn SetFlagsL EDefaultFlags
-tn CreateSourceInstanceBufferL \data\ThumbnailManagerTest\WIDE_800x400.gif image/gif
-tn DeleteThumbnails
-tn SetThumbnailL
-
-waittestclass tn
-
-tn SetFlagsL EDoNotCreate
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn DeleteInstance
-delete tn
-pause KTestDelay
-[Endtest]
-
-// ---------------------------------------------------------------------------
-// Set thumbnail from path
-// ---------------------------------------------------------------------------
-[Test]
-title Set thumbnail from path
-create ThumbnailManagerTest tn
-tn CreateInstanceL
-tn SetDisplayModeL EColor16M
-
-// normal uri
-tn SetFlagsL EDefaultFlags
-tn CreateSourceInstancePathTargetL \data\ThumbnailManagerTest\RGB_VGA.jpg \data\ThumbnailManagerTest\target.jpg image/jpeg 0 0
-tn SetThumbnailL
-
-waittestclass tn
-
-tn DeleteSourceInstance
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\target.jpg
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn SetFlagsL EDoNotCreate
-tn GetThumbnailL
-
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-// virtual uri
-tn SetFlagsL EDefaultFlags
-tn CreateSourceInstancePathTargetL \data\ThumbnailManagerTest\RGB_VGA.jpg \data\ThumbnailManagerTest\target.vcf contact/x-vcard 0 1
-tn SetThumbnailL
-
-waittestclass tn
-
-tn DeleteSourceInstance
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\target.vcf
-tn SetThumbnailEnumSizeL EContactGridThumbnailSize
-tn SetFlagsL EDoNotCreate
-tn GetThumbnailL
-
-waittestclass tn
-tn CheckThumbnailCenrepL EContactGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn DeleteInstance
-delete tn
-pause KTestDelay
-[Endtest]
-
-
-// ---------------------------------------------------------------------------
-// Delete thumbnails
-// ---------------------------------------------------------------------------
-[Test]
-title Delete thumbnails
-create ThumbnailManagerTest tn
-tn CreateInstanceL
-tn SetDisplayModeL EColor16M
-
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-
-// one thumbnail
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\RGB_VGA.jpg
-tn DeleteThumbnails
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-
-tn DeleteThumbnails
-pause KTenSecondDelay
-
-tn SetFlagsL EDoNotCreate
-tn GetThumbnailL
-allownextresult KErrNotFound
-waittestclass tn
-
-// all persistent thumbnails created
-tn SetFlagsL EDefaultFlags
-tn CreateThumbnails
-waittestclass tn
-pause KTenSecondDelay
-
-tn DeleteThumbnails
-pause KTenSecondDelay
-
-tn SetFlagsL EDoNotCreate
-tn GetThumbnailL
-allownextresult KErrNotFound
-waittestclass tn
-
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn DeleteInstance
-delete tn
-pause KTestDelay
-[Endtest]
-
-
-// ---------------------------------------------------------------------------
-// Run multiple tests
-// ---------------------------------------------------------------------------
-[Test]
-title Run misc multiple tests
-create ThumbnailManagerTest tn
-tn CreateInstanceL
-tn SetDisplayModeL EColor16M
-
-// using path
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\RGB_VGA.jpg
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EImageFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageFullScreenThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-// mp3 using handle
-tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\mp3.mp3
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EAudioGridThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EAudioGridThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL EAudioFullScreenThumbnailSize
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EAudioFullScreenThumbnailSize EColor16M
-tn DeleteThumbnails
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailL KCustomSizeX KCustomSizeY EColor16M
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-// corrupted file
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-tn SetThumbnailSizeL KCustomSizeX KCustomSizeY
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\not_jpg.jpg
-tn GetThumbnailL
-allownextresult KErrNotFound
-waittestclass tn
-tn DeleteSourceInstance
-tn CreateSourceInstanceBufferL \data\ThumbnailManagerTest\not_jpg.jpg image/jpeg
-tn GetThumbnailL
-allownextresult KErrNotFound
-waittestclass tn
-tn DeleteSourceInstance
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\not_3gp.3gp
-tn GetThumbnailL
-allownextresult KErrNotSupported
-waittestclass tn
-tn DeleteSourceInstance
-
-// delete one thumbnail
-tn SetThumbnailEnumSizeL EImageGridThumbnailSize
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\RGB_VGA.jpg
-tn DeleteThumbnails
-tn GetThumbnailL
-waittestclass tn
-tn CheckThumbnailCenrepL EImageGridThumbnailSize EColor16M
-tn DeleteThumbnails
-pause KTenSecondDelay
-tn SetFlagsL EDoNotCreate
-tn GetThumbnailL
-allownextresult KErrNotFound
-waittestclass tn
-
-// delete all persistent thumbnails created
-tn SetFlagsL EDefaultFlags
-tn CreateThumbnails
-waittestclass tn
-pause KTenSecondDelay
-tn DeleteThumbnails
-pause KTenSecondDelay
-tn SetFlagsL EDoNotCreate
-tn GetThumbnailL
-allownextresult KErrNotFound
-waittestclass tn
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn DeleteInstance
-delete tn
-pause KTestDelay
-[Endtest]
-
-
-// ---------------------------------------------------------------------------
-// Delete engine when requests are pending
-// ---------------------------------------------------------------------------
-[Test]
-title Delete engine when requests are pending
-create ThumbnailManagerTest tn
-tn CreateInstanceL
-
-tn SetThumbnailEnumSizeL EImageFullScreenThumbnailSize
-
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\Videoclip.mp4
-tn DeleteThumbnails
-tn DeleteSourceInstance
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\TALL_400x800.bmp
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\Videoclip.mp4
-tn GetThumbnailL
-tn DeleteSourceInstance
-
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\TALL_400x800.bmp
-tn GetThumbnailL
-tn DeleteSourceInstance
-
-tn DeleteInstance
-delete tn
-pause KTestDelay
-[Endtest]
-
-// ---------------------------------------------------------------------------
-// Cancel request
-// ---------------------------------------------------------------------------
-[Test]
-title Cancel request
-create ThumbnailManagerTest tn
-tn CreateInstanceL
-tn SetDisplayModeL EColor16M
-
-tn SetThumbnailEnumSizeL EImageFullScreenThumbnailSize
-
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\Videoclip.mp4
-tn DeleteThumbnails
-tn DeleteSourceInstance
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\TALL_400x800.bmp
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\Videoclip.mp4
-tn GetThumbnailL
-tn DeleteSourceInstance
-
-tn CreateSourceInstancePathL \data\ThumbnailManagerTest\TALL_400x800.bmp
-tn GetThumbnailL
-tn DeleteSourceInstance
-
-pause KClientServerDelay2
-
-// The server should have the two thumbnail requests queued by now.
-// This should cancel the second one while letting the first one finish.
-tn CancelPrevious
-
-waittestclass tn
-tn CheckThumbnailCenrepL EImageFullScreenThumbnailSize EColor16M
-
-tn DeleteInstance
-delete tn
-pause KTestDelay
-[Endtest]
-
-// ---------------------------------------------------------------------------
-// Priority handling
-// ---------------------------------------------------------------------------
-[Test]
-title Priority handling
-create ThumbnailManagerTest tn
-tn CreateInstanceL
-tn SetDisplayModeL EColor16M
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-
-tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\WIDE_800x400.gif
-tn DeleteThumbnails
-tn DeleteSourceInstance
-tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\TALL_400x800.bmp
-tn DeleteThumbnails
-tn DeleteSourceInstance
-tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\SVG_640x480.svg
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-// First request with 100 priority
-tn SetThumbnailSizeL 80 40
-tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\WIDE_800x400.gif
-tn GetThumbnailL 0 100
-tn DeleteSourceInstance
-
-// Second request with negative priority
-tn SetThumbnailSizeL 1 1
-tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\TALL_400x800.bmp
-tn GetThumbnailL 0 -100
-tn DeleteSourceInstance
-
-// Third request with positive priority
-tn SetThumbnailSizeL 40 30
-tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\SVG_640x480.svg
-tn GetThumbnailL 0 0
-tn DeleteSourceInstance
-
-// First request should complete first, since the server started processing
-// it before the other requests were done
-waittestclass tn
-tn CheckThumbnailL 80 40 EColor16M
-
-// The third request should finish next
-waittestclass tn
-tn CheckThumbnailL 40 30 EColor16M
-
-// The second request should finish last, since it had the lowest priority
-waittestclass tn
-tn CheckThumbnailL 1 1 EColor16M
-
-tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\WIDE_800x400.gif
-tn DeleteThumbnails
-tn DeleteSourceInstance
-tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\TALL_400x800.bmp
-tn DeleteThumbnails
-tn DeleteSourceInstance
-tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\SVG_640x480.svg
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn DeleteInstance
-delete tn
-pause KTestDelay
-[Endtest]
-
-// ---------------------------------------------------------------------------
-// Change priority
-// ---------------------------------------------------------------------------
-[Test]
-title Change priority
-create ThumbnailManagerTest tn
-tn CreateInstanceL
-tn SetDisplayModeL EColor16M
-tn SetThumbnailEnumSizeL ECustomThumbnailSize
-
-tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\WIDE_800x400.gif
-tn DeleteThumbnails
-tn DeleteSourceInstance
-tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\TALL_400x800.bmp
-tn DeleteThumbnails
-tn DeleteSourceInstance
-tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\SVG_640x480.svg
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-// First request with 0 priority
-tn SetThumbnailSizeL 80 40
-tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\WIDE_800x400.gif
-tn GetThumbnailL 0 0
-tn DeleteSourceInstance
-
-// Second request with negative priority
-tn SetThumbnailSizeL 1 1
-tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\TALL_400x800.bmp
-tn GetThumbnailL 0 -50
-tn DeleteSourceInstance
-
-// Third request with positive priority
-tn SetThumbnailSizeL 40 30
-tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\SVG_640x480.svg
-tn GetThumbnailL 0 50
-tn DeleteSourceInstance
-
-// Change the priority of the third request to a low value
-tn ChangePreviousPriority -100
-
-// First request should complete first, since the server started processing
-// it before the other requests were done
-waittestclass tn
-tn CheckThumbnailL 80 40 EColor16M
-
-// The second request should finish next
-waittestclass tn
-tn CheckThumbnailL 1 1 EColor16M
-
-// The third request should finish last, since the priority was changed to the
-// lowest value.
-waittestclass tn
-tn CheckThumbnailL 40 30 EColor16M
-
-tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\WIDE_800x400.gif
-tn DeleteThumbnails
-tn DeleteSourceInstance
-tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\TALL_400x800.bmp
-tn DeleteThumbnails
-tn DeleteSourceInstance
-tn CreateSourceInstanceHandleL \data\ThumbnailManagerTest\SVG_640x480.svg
-tn DeleteThumbnails
-tn DeleteSourceInstance
-
-tn DeleteInstance
-delete tn
-pause KTestDelay
-[Endtest]
-
-// ---------------------------------------------------------------------------
-// Get supported mime types
-// ---------------------------------------------------------------------------
-[Test]
-title Get supported mime types
-create ThumbnailManagerTest tn
-tn CreateInstanceL
-tn GetSupportedMimeTypesL
-tn DeleteInstance
-delete tn
-pause KTestDelay
-[Endtest]
-
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/8bit_PNG.png
Binary file imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/8bit_PNG.png has changed
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/RGB_400x300.bmp
Binary file imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/RGB_400x300.bmp has changed
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/RGB_VGA.jpg
Binary file imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/RGB_VGA.jpg has changed
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/SVG_640x480.svg
--- a/imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/SVG_640x480.svg Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-
-
-
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/TALL_400x800.bmp
Binary file imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/TALL_400x800.bmp has changed
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/TestMBM.mbm
Binary file imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/TestMBM.mbm has changed
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/Tiny_1x1.jpg
Binary file imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/Tiny_1x1.jpg has changed
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/Unsupported.txt
--- a/imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/Unsupported.txt Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-Text file for testing purposes
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/Videoclip.mp4
Binary file imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/Videoclip.mp4 has changed
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/WIDE_800x400.gif
Binary file imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/WIDE_800x400.gif has changed
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/camera.jpg
Binary file imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/camera.jpg has changed
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/empty_file.bmp
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/exif.jpg
Binary file imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/exif.jpg has changed
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/exif.png
Binary file imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/exif.png has changed
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/mp3.mp3
Binary file imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/mp3.mp3 has changed
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/mp3_png.mp3
Binary file imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/mp3_png.mp3 has changed
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/no_exif.jpg
Binary file imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/no_exif.jpg has changed
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/not_3gp.3gp
Binary file imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/not_3gp.3gp has changed
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/not_jpg.jpg
Binary file imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/not_jpg.jpg has changed
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/video.3gp
Binary file imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/video.3gp has changed
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/wma.wma
Binary file imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/wma.wma has changed
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/wma_empty.wma
Binary file imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/wma_empty.wma has changed
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/wma_png.wma
Binary file imagehandling_plat/thumbnailmanager_api/tsrc/data/mmc/ThumbnailManagerTest/wma_png.wma has changed
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/eabi/ThumbnailManagerTestu.def
--- a/imagehandling_plat/thumbnailmanager_api/tsrc/eabi/ThumbnailManagerTestu.def Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-EXPORTS
- _Z9LibEntryLR13CTestModuleIf @ 1 NONAME
- _ZTI16CThumbnailCenRep @ 2 NONAME ; ##
- _ZTV16CThumbnailCenRep @ 3 NONAME ; ##
-
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/group/ThumbnailManagerTest.mmp
--- a/imagehandling_plat/thumbnailmanager_api/tsrc/group/ThumbnailManagerTest.mmp Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Thumbnail Manager API tests
-*
-*/
-
-#include
-#include
-
-TARGET ThumbnailManagerTest.dll
-TARGETTYPE dll
-UID 0x1000008D 0x101FB3E3
-
-CAPABILITY ALL -TCB
-VENDORID VID_DEFAULT
-EPOCSTACKSIZE 0x8192
-
-DEFFILE ThumbnailManagerTest.def
-
-SOURCEPATH ../src
-SOURCE ThumbnailManagerTest.cpp
-SOURCE ThumbnailManagerTestBlocks.cpp
-SOURCE thumbnailcenrep.cpp
-
-// Default system include paths for middleware layer modules.
-MW_LAYER_SYSTEMINCLUDE
-
-USERINCLUDE ../inc
-
-LIBRARY euser.lib
-LIBRARY PlatformEnv.lib
-LIBRARY stiftestinterface.lib
-LIBRARY stiftestengine.lib
-LIBRARY efsrv.lib
-LIBRARY sqldb.lib
-LIBRARY fbscli.lib
-LIBRARY imageconversion.lib
-LIBRARY centralrepository.lib
-LIBRARY thumbnailmanager.lib
-
-PAGED
-BYTEPAIRCOMPRESSTARGET
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/group/ThumbnailManagerTest.pkg
--- a/imagehandling_plat/thumbnailmanager_api/tsrc/group/ThumbnailManagerTest.pkg Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-;
-; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-; All rights reserved.
-; This component and the accompanying materials are made available
-; under the terms of "Eclipse Public License v1.0"
-; which accompanies this distribution, and is available
-; at the URL "http://www.eclipse.org/legal/epl-v10.html".
-;
-; Initial Contributors:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description: Thumbnail Manager API tests
-;
-
-; Languages
-&EN
-
-; Header
-#{"ThumbnailManagerTest"},(0x101FB3E3),1,0,0,TYPE=SA
-
-; Localised Vendor name
-%{"Nokia"}
-
-; Unique Vendor name
-:"Nokia"
-
-; Install files
-"\epoc32\release\armv5\udeb\ThumbnailManagerTest.dll" - "c:\sys\bin\ThumbnailManagerTest.dll"
-"..\conf\ThumbnailManagerTest.cfg" - "c:\TestFramework\ThumbnailManagerTest.cfg"
-"..\init\ThumbnailManagerTest.ini" - "c:\TestFramework\ThumbnailManagerTest.ini"
-"..\data\mmc\ThumbnailManagerTest\8bit_PNG.png" - "e:\testing\data\ThumbnailManagerTest\8bit_PNG.png"
-"..\data\mmc\ThumbnailManagerTest\empty_file.bmp" - "e:\testing\data\ThumbnailManagerTest\empty_file.bmp"
-"..\data\mmc\ThumbnailManagerTest\not_3gp.3gp" - "e:\testing\data\ThumbnailManagerTest\not_3gp.3gp"
-"..\data\mmc\ThumbnailManagerTest\not_jpg.jpg" - "e:\testing\data\ThumbnailManagerTest\not_jpg.jpg"
-"..\data\mmc\ThumbnailManagerTest\RGB_400x300.bmp" - "e:\testing\data\ThumbnailManagerTest\RGB_400x300.bmp"
-"..\data\mmc\ThumbnailManagerTest\RGB_VGA.jpg" - "e:\testing\data\ThumbnailManagerTest\RGB_VGA.jpg"
-"..\data\mmc\ThumbnailManagerTest\SVG_640x480.svg" - "e:\testing\data\ThumbnailManagerTest\SVG_640x480.svg"
-"..\data\mmc\ThumbnailManagerTest\TALL_400x800.bmp" - "e:\testing\data\ThumbnailManagerTest\TALL_400x800.bmp"
-"..\data\mmc\ThumbnailManagerTest\Tiny_1x1.jpg" - "e:\testing\data\ThumbnailManagerTest\Tiny_1x1.jpg"
-"..\data\mmc\ThumbnailManagerTest\Unsupported.txt" - "e:\testing\data\ThumbnailManagerTest\Unsupported.txt"
-"..\data\mmc\ThumbnailManagerTest\video.3gp" - "e:\testing\data\ThumbnailManagerTest\video.3gp"
-"..\data\mmc\ThumbnailManagerTest\Videoclip.mp4" - "e:\testing\data\ThumbnailManagerTest\Videoclip.mp4"
-"..\data\mmc\ThumbnailManagerTest\WIDE_800x400.gif" - "e:\testing\data\ThumbnailManagerTest\WIDE_800x400.gif"
-"..\data\mmc\ThumbnailManagerTest\TestMBM.mbm" - "e:\testing\data\ThumbnailManagerTest\TestMBM.mbm"
-"..\data\mmc\ThumbnailManagerTest\mp3.mp3" - "e:\testing\data\ThumbnailManagerTest\mp3.mp3"
-"..\data\mmc\ThumbnailManagerTest\camera.jpg" - "e:\testing\data\ThumbnailManagerTest\camera.jpg"
-"..\data\mmc\ThumbnailManagerTest\mp3_png.mp3" - "e:\testing\data\ThumbnailManagerTest\mp3_png.mp3"
-"..\data\mmc\ThumbnailManagerTest\no_exif.jpg" - "e:\testing\data\ThumbnailManagerTest\no_exif.jpg"
-"..\data\mmc\ThumbnailManagerTest\wma.wma" - "e:\testing\data\ThumbnailManagerTest\wma.wma"
-"..\data\mmc\ThumbnailManagerTest\wma_empty.wma" - "e:\testing\data\ThumbnailManagerTest\wma_empty.wma"
-"..\data\mmc\ThumbnailManagerTest\wma_png.wma" - "e:\testing\data\ThumbnailManagerTest\wma_png.wma"
-"..\data\mmc\ThumbnailManagerTest\exif.jpg" - "e:\testing\data\ThumbnailManagerTest\exif.jpg"
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/group/bld.inf
--- a/imagehandling_plat/thumbnailmanager_api/tsrc/group/bld.inf Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Thumbnail Manager API tests
-*
-*/
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-
-PRJ_MMPFILES
-
-PRJ_TESTMMPFILES
-ThumbnailManagerTest.mmp
-
-PRJ_TESTEXPORTS
-../conf/ThumbnailManagerTest.cfg /epoc32/winscw/c/TestFramework/ThumbnailManagerTest.cfg
-../init/ThumbnailManagerTest.ini /epoc32/winscw/c/TestFramework/ThumbnailManagerTest.ini
-../data/mmc/ThumbnailManagerTest/8bit_PNG.png /epoc32/winscw/c/data/ThumbnailManagerTest/8bit_PNG.png
-../data/mmc/ThumbnailManagerTest/empty_file.bmp /epoc32/winscw/c/data/ThumbnailManagerTest/empty_file.bmp
-../data/mmc/ThumbnailManagerTest/not_3gp.3gp /epoc32/winscw/c/data/ThumbnailManagerTest/not_3gp.3gp
-../data/mmc/ThumbnailManagerTest/not_jpg.jpg /epoc32/winscw/c/data/ThumbnailManagerTest/not_jpg.jpg
-../data/mmc/ThumbnailManagerTest/RGB_400x300.bmp /epoc32/winscw/c/data/ThumbnailManagerTest/RGB_400x300.bmp
-../data/mmc/ThumbnailManagerTest/RGB_VGA.jpg /epoc32/winscw/c/data/ThumbnailManagerTest/RGB_VGA.jpg
-../data/mmc/ThumbnailManagerTest/SVG_640x480.svg /epoc32/winscw/c/data/ThumbnailManagerTest/SVG_640x480.svg
-../data/mmc/ThumbnailManagerTest/TALL_400x800.bmp /epoc32/winscw/c/data/ThumbnailManagerTest/TALL_400x800.bmp
-../data/mmc/ThumbnailManagerTest/Tiny_1x1.jpg /epoc32/winscw/c/data/ThumbnailManagerTest/Tiny_1x1.jpg
-../data/mmc/ThumbnailManagerTest/Unsupported.txt /epoc32/winscw/c/data/ThumbnailManagerTest/Unsupported.txt
-../data/mmc/ThumbnailManagerTest/video.3gp /epoc32/winscw/c/data/ThumbnailManagerTest/video.3gp
-../data/mmc/ThumbnailManagerTest/Videoclip.mp4 /epoc32/winscw/c/data/ThumbnailManagerTest/Videoclip.mp4
-../data/mmc/ThumbnailManagerTest/WIDE_800x400.gif /epoc32/winscw/c/data/ThumbnailManagerTest/WIDE_800x400.gif
-../data/mmc/ThumbnailManagerTest/TestMBM.mbm /epoc32/winscw/c/data/ThumbnailManagerTest/TestMBM.mbm
-../data/mmc/ThumbnailManagerTest/mp3.mp3 /epoc32/winscw/c/data/ThumbnailManagerTest/mp3.mp3
-../data/mmc/ThumbnailManagerTest/camera.jpg /epoc32/winscw/c/data/ThumbnailManagerTest/camera.jpg
-../data/mmc/ThumbnailManagerTest/mp3_png.mp3 /epoc32/winscw/c/data/ThumbnailManagerTest/mp3_png.mp3
-../data/mmc/ThumbnailManagerTest/no_exif.jpg /epoc32/winscw/c/data/ThumbnailManagerTest/no_exif.jpg
-../data/mmc/ThumbnailManagerTest/wma.wma /epoc32/winscw/c/data/ThumbnailManagerTest/wma.wma
-../data/mmc/ThumbnailManagerTest/wma_empty.wma /epoc32/winscw/c/data/ThumbnailManagerTest/wma_empty.wma
-../data/mmc/ThumbnailManagerTest/wma_png.wma /epoc32/winscw/c/data/ThumbnailManagerTest/wma_png.wma
-../data/mmc/ThumbnailManagerTest/exif.jpg /epoc32/winscw/c/data/ThumbnailManagerTest/exif.jpg
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/inc/ThumbnailManagerTest.h
--- a/imagehandling_plat/thumbnailmanager_api/tsrc/inc/ThumbnailManagerTest.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,214 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Thumbnail Manager API tests
-*
-*/
-
-#ifndef THUMBNAILMANAGERTEST_H
-#define THUMBNAILMANAGERTEST_H
-
-// INCLUDES
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-
-#include "thumbnailcenrep.h"
-
-const TInt KPathPrefixLength( 2 );
-
-// MACROS
-#if ( defined (__WINS__) || defined (__WINSCW__) )
-_LIT( KTMTestDataPath, "" );
-#else
-_LIT( KTMTestDataPath, "\\testing" );
-#endif
-
-// Logging path
-_LIT( KThumbnailManagerTestLogPath, "\\logs\\testframework\\ThumbnailManagerTest\\" );
-// Log file
-_LIT( KThumbnailManagerTestLogFile, "ThumbnailManagerTest.txt" );
-_LIT( KThumbnailManagerTestLogFileWithTitle, "ThumbnailManagerTest_[%S].txt" );
-
-// FORWARD DECLARATIONS
-class CThumbnailManagerTest;
-
-// CLASS DECLARATION
-
-/**
-* CThumbnailManagerTest test class for STIF Test Framework TestScripter.
-* ?other_description_lines
-*
-* @lib ?library
-* @since ?Series60_version
-*/
-NONSHARABLE_CLASS(CThumbnailManagerTest): public CScriptBase,
- public MThumbnailManagerObserver
- {
- public: // Constructors and destructor
-
- /**
- * Two-phased constructor.
- */
- static CThumbnailManagerTest* NewL( CTestModuleIf& aTestModuleIf );
-
- /**
- * Destructor.
- */
- virtual ~CThumbnailManagerTest();
-
- public: // Functions from base classes
-
- /**
- * From CScriptBase Runs a script line.
- * @since ?Series60_version
- * @param aItem Script line containing method name and parameters
- * @return Symbian OS error code
- */
- virtual TInt RunMethodL( CStifItemParser& aItem );
-
- protected: // Functions from base classes
-
- /**
- * From MThumbnailManagerObserver
- */
- void ThumbnailPreviewReady( MThumbnailData& aThumbnail, TThumbnailRequestId aId );
-
- void ThumbnailReady( TInt aError, MThumbnailData& aThumbnail, TThumbnailRequestId aId );
-
- private:
-
- /**
- * C++ default constructor.
- */
- CThumbnailManagerTest( CTestModuleIf& aTestModuleIf );
-
- /**
- * By default Symbian 2nd phase constructor is private.
- */
- void ConstructL();
-
- /**
- * Frees all resources allocated from test methods.
- * @since ?Series60_version
- */
- void Delete();
-
- /**
- * Test methods are listed below.
- */
-
- virtual TInt CreateInstanceL( CStifItemParser& aItem );
- virtual TInt DeleteInstance( CStifItemParser& aItem );
-
- virtual TInt CreateSourceInstancePathL( CStifItemParser& aItem );
- virtual TInt CreateSourceInstancePathTargetL( CStifItemParser& aItem );
- virtual TInt CreateSourceInstanceHandleL( CStifItemParser& aItem );
- virtual TInt CreateSourceInstanceBufferL( CStifItemParser& aItem );
- virtual TInt CreateSourceInstanceBitmapL( CStifItemParser& aItem );
- virtual TInt DeleteSourceInstance( CStifItemParser& aItem );
-
- virtual TInt GetThumbnailL( CStifItemParser& aItem );
- virtual TInt GetThumbnailByIdL( CStifItemParser& aItem );
-
- virtual TInt SetThumbnailL( CStifItemParser& aItem );
- virtual TInt ImportThumbnailL( CStifItemParser& aItem );
-
- virtual TInt CheckPreviewThumbnailL( CStifItemParser& aItem );
- virtual TInt CheckThumbnailL( CStifItemParser& aItem );
- virtual TInt CheckThumbnailCenrepL( CStifItemParser& aItem );
-
- virtual TInt CancelPrevious( CStifItemParser& aItem );
- virtual TInt ChangePreviousPriority( CStifItemParser& aItem );
-
- virtual TInt SetThumbnailSizeL( CStifItemParser& aItem );
- virtual TInt CheckThumbnailSizeL( CStifItemParser& aItem );
- virtual TInt SetThumbnailEnumSizeL( CStifItemParser& aItem );
- virtual TInt SetFlagsL( CStifItemParser& aItem );
- virtual TInt CheckFlags( CStifItemParser& aItem );
- virtual TInt SetQualityPreferenceL( CStifItemParser& aItem );
- virtual TInt CheckQualityPreference( CStifItemParser& aItem );
- virtual TInt SetDisplayModeL( CStifItemParser& aItem );
- virtual TInt CheckDisplayModeL( CStifItemParser& aItem );
-
- virtual TInt DeleteThumbnails( CStifItemParser& aItem );
- virtual TInt CreateThumbnailsByUrlL( CStifItemParser& aItem );
-
- virtual TInt CreateThumbnails( CStifItemParser& aItem );
- virtual TInt UpdatePathL( CStifItemParser& aItem );
-
- virtual TInt GetSupportedMimeTypesL( CStifItemParser& aItem );
-
- /**
- * Method used to log version of test class
- */
- void SendTestClassVersion();
-
- private: // Data
-
- // Own. Thumbnail engine
- CThumbnailManager* iEngine;
-
- // Own. Thumbnail object source
- CThumbnailObjectSource* iObjectSource;
-
- // Own. File server session
- RFs iFs;
-
- // Own.
- RFile64 iFile;
-
- // Own. Bitmap from previous ThumbnailPreviewReady() callback
- CFbsBitmap* iPreviewThumbnail;
-
- // Own. Bitmap from previous ThumbnailReady() callback
- CFbsBitmap* iThumbnail;
-
- // Value for aId for previous ThumbnailPreviewReady() callback
- TThumbnailRequestId iPreviewThumbnailCbId;
-
- // Value for aId for previous ThumbnailReady() callback
- TThumbnailRequestId iThumbnailCbId;
-
- // Request ID of the previous request
- TThumbnailRequestId iPreviousRequestId;
-
- // Test data path
- TFileName iDataPath;
-
- // Temp buffer
- HBufC8* iBuffer;
-
- // Temp bitmap
- CFbsBitmap* iBitmap;
-
- // Own. Central repository data handler
- CThumbnailCenRep* iCenrep;
-
- // persistent sizes
- RArray < TThumbnailPersistentSize > iPersistentSizes;
-
- TThumbnailSize iCurrentThumbnailSize;
-
- TBool iDoNotCreate;
- TBool iCreateThumbnails;
- };
-
-#endif // THUMBNAILMANAGERTEST_H
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/inc/thumbnailcenrep.h
--- a/imagehandling_plat/thumbnailmanager_api/tsrc/inc/thumbnailcenrep.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,214 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Class for handling central repositoty data
- *
-*/
-
-
-#ifndef THUMBNAILCENREP_H
-#define THUMBNAILCENREP_H
-
-#include
-
-#include // TThumbnailSize
-
-class CRepository;
-class TThumbnailPersistentSize;
-class TThumbnailAutoCreate;
-
-/**
- * Class for handling central repositoty data.
- *
- * @since S60 v5.0
- */
-class CThumbnailCenRep: public CBase
- {
-
-public:
-
- /**
- * Destructor
- *
- * @since S60 v5.0
- */
- virtual ~CThumbnailCenRep();
-
- /**
- * Two-phased constructor
- *
- * @since S60 v5.0
- * @return New CThumbnailCenRep instance.
- */
- static CThumbnailCenRep* NewL();
-
- /**
- * GetPersistentSizes
- *
- * @since S60 v5.0
- * @return Reference to array of central repository settings
- */
- RArray < TThumbnailPersistentSize > & GetPersistentSizes();
-
- /**
- * GetAutoCreateParams
- *
- * @since S60 v5.0
- * @return Reference to auto creation settings
- */
- TThumbnailAutoCreate & GetAutoCreateParams();
-
- /**
- * Get concrete persistent size associated to relative size
- *
- * @since S60 v5.0
- * @param aThumbnailSize Relative size
- * @return Persistent size object
- */
- TThumbnailPersistentSize & PersistentSizeL( TThumbnailSize
- aThumbnailSize );
-
-private:
-
- /**
- * C++ default constructor
- *
- * @since S60 v5.0
- * @return New CThumbnailCenRep instance.
- */
- CThumbnailCenRep();
-
- /**
- * ConstructL
- *
- * @since S60 v5.0
- */
- void ConstructL();
-
-private:
- // data
-
- /**
- * Central Repository
- * Own.
- */
- CRepository* iRepository;
-
- /**
- * Persistent sizes.
- */
- RArray < TThumbnailPersistentSize > iPersistentSizes;
-
- /**
- * Auto creation parameters.
- */
- TThumbnailAutoCreate * iAutoCreate;
-
-};
-
-/**
- * Class for representing persistent thumbnail sizes and related
- * parameters.
- *
- * @since S60 v5.0
- */
-class TThumbnailPersistentSize
- {
- /**
- * Format used for storing bitmaps.
- * @since S60 v5.0
- */
- enum TThumbnailImageFormat
- {
- /**
- * Use JPEG compression for stored bitmaps.
- */
- EJpeg,
-
- /**
- * Use native Symbian bitmap format for stored bitmaps.
- */
- EBmp
- };
-
-public:
- enum { EUnknownSourceType, EImage, EVideo, EAudio, EContact };
- enum { EUnknownSizeType, EGrid, EList, EFullscreen };
-
-public:
-
- /**
- * C++ constructor.
- *
- * @since S60 v5.0
- * @param aSize Thumbnail size (in pixels) which will be stored.
- * @param aCrop If true, stored thumbnails are cropped to aspect ratio.
- * @param aMode Display mode used for stored bitmaps
- * @param aFormat Format used when storing thumbnails
- */
- TThumbnailPersistentSize( const TSize& aSize, TBool aCrop, TDisplayMode
- aMode, TInt aFormat );
-
- TThumbnailPersistentSize( TThumbnailSize aType, const TSize& aSize, TBool aCrop, TDisplayMode
- aMode, TInt aFormat, TBool aAutoCreate );
-
-public:
-
- // data
- TThumbnailSize iType;
- TInt iSourceType;
- TInt iSizeType;
-
- TSize iSize;
- TBool iCrop;
- TDisplayMode iMode;
- TInt iFormat;
-
- TBool iAutoCreate;
-};
-
-/**
- * Class for representing thumbnail auto creation parameters.
- *
- * @since S60 v5.0
- */
-class TThumbnailAutoCreate
- {
-
-public:
-
- /**
- * C++ constructor.
- *
- * @since S60 v5.0
- */
- TThumbnailAutoCreate();
-
-public:
-
- // data
- TBool iImageGrid;
- TBool iImageList;
- TBool iImageFullscreen;
- TBool iVideoGrid;
- TBool iVideoList;
- TBool iVideoFullscreen;
- TBool iAudioGrid;
- TBool iAudioList;
- TBool iAudioFullscreen;
- TBool iContactGrid;
- TBool iContactList;
- TBool iContactFullscreen;
-};
-
-#endif // THUMBNAILCENREP_H
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/init/ThumbnailManagerTest.ini
--- a/imagehandling_plat/thumbnailmanager_api/tsrc/init/ThumbnailManagerTest.ini Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,219 +0,0 @@
-#
-# This is STIF initialization file
-# Comment lines start with '#'-character.
-# See STIF TestFramework users guide.doc for instructions
-
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-# Set following test engine settings:
-# - Set Test Reporting mode. TestReportMode's possible values are:
-# + 'Summary': Summary of the tested test cases.
-# + 'Environment': Hardware and software info.
-# + 'TestCases': Test case report.
-# + 'FullReport': Set of all above ones.
-# + Example 'TestReportMode= Summary TestCases'
-#
-# - CreateTestReport setting controls report creation mode
-# + YES, Test report will created.
-# + NO, No Test report.
-#
-# - File path indicates the base path of the test report.
-# - File name indicates the name of the test report.
-#
-# - File format indicates the type of the test report.
-# + TXT, Test report file will be txt type, for example 'TestReport.txt'.
-# + HTML, Test report will be html type, for example 'TestReport.html'.
-# + XML, Test report will be xml type, for example 'TestReport.xml'.
-# Note, that xml format is available only when output is set to FILE.
-#
-# - File output indicates output source of the test report.
-# + FILE, Test report logging to file.
-# + RDEBUG, Test report logging to using rdebug.
-#
-# - File Creation Mode indicates test report overwriting if file exist.
-# + OVERWRITE, Overwrites if the Test report file exist.
-# + APPEND, Continue logging after the old Test report information if
-# report exist.
-# - Sets a device reset module's dll name(Reboot).
-# + If Nokia specific reset module is not available or it is not correct one
-# StifHWResetStub module may use as a template for user specific reset
-# module.
-# - Sets STIF test measurement disable options. e.g. pluging1 and pluging2 disablation
-# DisableMeasurement= stifmeasurementplugin01 stifmeasurementplugin02
-#
-
-[Engine_Defaults]
-
-TestReportMode= FullReport # Possible values are: 'Empty', 'Summary', 'Environment',
- # 'TestCases' or 'FullReport'
-
-CreateTestReport= YES # Possible values: YES or NO
-
-TestReportFilePath= C:\LOGS\TestFramework\
-TestReportFileName= TestReport
-
-TestReportFormat= TXT # Possible values: TXT, HTML or XML
-TestReportOutput= FILE # Possible values: FILE or RDEBUG
-TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND
-
-DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
-
-DisableMeasurement= stifmeasurementdisablenone # Possible values are:
- # 'stifmeasurementdisablenone', 'stifmeasurementdisableall'
- # 'stifmeasurementplugin01', 'stifmeasurementplugin02',
- # 'stifmeasurementplugin03', 'stifmeasurementplugin04',
- # 'stifmeasurementplugin05' or 'stifbappeaprofiler'
-
-Timeout= 180000 # Default timeout value for each test case. In milliseconds
-#UITestingSupport= YES # Possible values: YES or NO
-#SeparateProcesses= YES # Possible values: YES or NO (default: NO)
-[End_Defaults]
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-
-
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-# Module configurations start
-# Modules are added between module tags
-# tags. Module name is specified after ModuleName= tag, like
-# ModuleName= XXXXXXXXX
-# Modules might have initialisation file, specified as
-# IniFile= c:\testframework\YYYYYY
-# Modules might have several configuration files, like
-# TestCaseFile= c:\testframework\NormalCases.txt
-# TestCaseFile= c:\testframework\SmokeCases.txt
-# TestCaseFile= c:\testframework\ManualCases.txt
-
-# (TestCaseFile is synonym for old term ConfigFile)
-
-# Following case specifies demo module settings. Demo module
-# does not read any settings from file, so tags
-# IniFile and TestCaseFile are not used.
-# In the simplest case it is enough to specify only the
-# name of the test module when adding new test module
-
-
-[New_Module]
-ModuleName= TestScripter
-TestCaseFile= c:\testframework\ThumbnailManagerTest.cfg
-[End_Module]
-
-
-# Load testmoduleXXX, optionally with initialization file and/or test case files
-#[New_Module]
-#ModuleName= testmodulexxx
-
-#TestModuleXXX used initialization file
-#IniFile= c:\testframework\init.txt
-
-#TestModuleXXX used configuration file(s)
-#TestCaseFile= c:\testframework\testcases1.cfg
-#TestCaseFile= c:\testframework\testcases2.cfg
-#TestCaseFile= c:\testframework\manualtestcases.cfg
-
-#[End_Module]
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-
-
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-# Set STIF logging overwrite parameters for Logger.
-# Hardware and emulator environment logging path and styles can
-# be configured from here to overwrite the Logger's implemented values.
-#
-# Settings description:
-# - Indicates option for creation log directory/directories. If log directory/directories
-# is/are not created by user they will make by software.
-# + YES, Create log directory/directories if not allready exist.
-# + NO, Log directory/directories not created. Only created one is used.
-#
-# - Overwrite emulator path setting.
-# + Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined
-# Logger's path 'D:\\LOGS\\Module\\' with those definition the path
-# will be 'C:\LOGS\TestFramework\LOGS\Module\'
-#
-# - Overwrite emulator's logging format.
-# + TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
-# + HTML, Log file(s) will be html type(s), for example 'Module.html'.
-#
-# - Overwrited emulator logging output source.
-# + FILE, Logging to file(s).
-# + RDEBUG, Logging to using rdebug(s).
-#
-# - Overwrite hardware path setting (Same description as above in emulator path).
-# - Overwrite hardware's logging format(Same description as above in emulator format).
-# - Overwrite hardware's logging output source(Same description as above in emulator output).
-#
-# - File Creation Mode indicates file overwriting if file exist.
-# + OVERWRITE, Overwrites if file(s) exist.
-# + APPEND, Continue logging after the old logging information if file(s) exist.
-#
-# - Will thread id include to the log filename.
-# + YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
-# + NO, No thread id to log file(s), Example filename 'Module.txt'.
-#
-# - Will time stamps include the to log file.
-# + YES, Time stamp added to each line in log file(s). Time stamp is
-# for example'12.Nov.2003 115958 LOGGING INFO'
-# + NO, No time stamp(s).
-#
-# - Will line breaks include to the log file.
-# + YES, Each logging event includes line break and next log event is in own line.
-# + NO, No line break(s).
-#
-# - Will event ranking include to the log file.
-# + YES, Event ranking number added to each line in log file(s). Ranking number
-# depends on environment's tics, for example(includes time stamp also)
-# '012 12.Nov.2003 115958 LOGGING INFO'
-# + NO, No event ranking.
-#
-# - Will write log file in unicode format.
-# + YES, Log file will be written in unicode format
-# + NO, Log will be written as normal, not unicode, file.
-#
-
-[Logger_Defaults]
-
-#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#'
-#NOTE: TestEngine and TestServer logging settings cannot change here
-
-CreateLogDirectories= YES # Possible values: YES or NO
-
-#EmulatorBasePath= C:\LOGS\TestFramework\
-#EmulatorFormat= HTML # Possible values: TXT or HTML
-#EmulatorOutput= FILE # Possible values: FILE or RDEBUG
-
-HardwareBasePath= C:\
-#HardwareFormat= HTML # Possible values: TXT or HTML
-#HardwareOutput= FILE # Possible values: FILE or RDEBUG
-
-#FileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND
-
-#ThreadIdToLogFile= YES # Possible values: YES or NO
-#WithTimeStamp= YES # Possible values: YES or NO
-#WithLineBreak= YES # Possible values: YES or NO
-#WithEventRanking= YES # Possible values: YES or NO
-
-#FileUnicode= YES # Possible values: YES or NO
-#AddTestCaseTitle= YES # Possible values: YES or NO
-[End_Logger_Defaults]
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-
-
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-# Set filters to be used by ConsoleUI.
-# If you want to use filter with ConsoleUI, simply remove comments
-# from section below and provide valid filter entries.
-# Each filter line has to start with "filter= " keyword.
-# Filter can contain special wildcard characters:
-# * which stands for none or any literal;
-# ? which stands for single character.
-# Filters are not case-sensitive.
-
-#[Filters]
-#filter= *math*
-#filter= *radio*
-#[End_Filters]
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-# End of file
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/src/ThumbnailManagerTest.cpp
--- a/imagehandling_plat/thumbnailmanager_api/tsrc/src/ThumbnailManagerTest.cpp Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Thumbnail Manager API tests
-*
-*/
-
-// INCLUDE FILES
-#include
-#include
-
-#include
-
-#include "ThumbnailManagerTest.h"
-
-// ============================= LOCAL FUNCTIONS ===============================
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// CThumbnailManagerTest::CThumbnailManagerTest
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-//
-CThumbnailManagerTest::CThumbnailManagerTest( CTestModuleIf& aTestModuleIf ):
- CScriptBase( aTestModuleIf )
- {
- }
-
-// -----------------------------------------------------------------------------
-// CThumbnailManagerTest::ConstructL
-// Symbian 2nd phase constructor can leave.
-// -----------------------------------------------------------------------------
-//
-void CThumbnailManagerTest::ConstructL()
- {
- iLog = CStifLogger::NewL( KThumbnailManagerTestLogPath,
- KThumbnailManagerTestLogFile,
- CStifLogger::ETxt,
- CStifLogger::EFile,
- EFalse );
-
- User::LeaveIfError( iFs.Connect());
- User::LeaveIfError( iFs.ShareProtected());
-
- // set test data path according to env
-#if ( defined (__WINS__) || defined (__WINSCW__) )
- iDataPath.Copy( PathInfo::PhoneMemoryRootPath().Left( KPathPrefixLength ));
-#else
- iDataPath.Copy( PathInfo::MemoryCardRootPath ().Left( KPathPrefixLength ));
-#endif
- iDataPath.Append( KTMTestDataPath );
- iDataPath.ZeroTerminate();
- }
-
-// -----------------------------------------------------------------------------
-// CThumbnailManagerTest::NewL
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-CThumbnailManagerTest* CThumbnailManagerTest::NewL( CTestModuleIf& aTestModuleIf )
- {
- CThumbnailManagerTest* self = new (ELeave) CThumbnailManagerTest( aTestModuleIf );
-
- CleanupStack::PushL( self );
- self->ConstructL();
- CleanupStack::Pop();
-
- return self;
- }
-
-// Destructor
-CThumbnailManagerTest::~CThumbnailManagerTest()
- {
- // Delete resources allocated from test methods
- Delete();
-
- // Delete logger
- delete iLog;
-
- iFs.Close();
- }
-
-// ========================== OTHER EXPORTED FUNCTIONS =========================
-
-// -----------------------------------------------------------------------------
-// LibEntryL is a polymorphic Dll entry point.
-// Returns: CScriptBase: New CScriptBase derived object
-// -----------------------------------------------------------------------------
-//
-EXPORT_C CScriptBase* LibEntryL( CTestModuleIf& aTestModuleIf ) // Backpointer to STIF
- {
- return ( CScriptBase* ) CThumbnailManagerTest::NewL( aTestModuleIf );
- }
-
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/src/ThumbnailManagerTestBlocks.cpp
--- a/imagehandling_plat/thumbnailmanager_api/tsrc/src/ThumbnailManagerTestBlocks.cpp Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,889 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Thumbnail Manager API tests
-*
-*/
-
-// [INCLUDE FILES] - do not remove
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-
-#include "ThumbnailManagerTest.h"
-
-
-// ============================= LOCAL FUNCTIONS ===============================
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// CThumbnailManagerTest::Delete
-// Delete here all resources allocated and opened from test methods.
-// Called from destructor.
-// -----------------------------------------------------------------------------
-//
-void CThumbnailManagerTest::Delete()
- {
- delete iPreviewThumbnail;
- iPreviewThumbnail = NULL;
- delete iThumbnail;
- iThumbnail = NULL;
- delete iEngine;
- iEngine = NULL;
- delete iObjectSource;
- iObjectSource = NULL;
- delete iCenrep;
- iCenrep = NULL;
- }
-
-// -----------------------------------------------------------------------------
-// CThumbnailManagerTest::RunMethodL
-// Run specified method. Contains also table of test mothods and their names.
-// -----------------------------------------------------------------------------
-//
-TInt CThumbnailManagerTest::RunMethodL( CStifItemParser& aItem )
- {
- static TStifFunctionInfo const KFunctions[] =
- {
- ENTRY( "CreateInstanceL", CThumbnailManagerTest::CreateInstanceL ),
- ENTRY( "DeleteInstance", CThumbnailManagerTest::DeleteInstance ),
- ENTRY( "SetThumbnailSizeL", CThumbnailManagerTest::SetThumbnailSizeL ),
- ENTRY( "CheckThumbnailSizeL", CThumbnailManagerTest::CheckThumbnailSizeL ),
- ENTRY( "SetThumbnailEnumSizeL", CThumbnailManagerTest::SetThumbnailEnumSizeL ),
- ENTRY( "CreateSourceInstancePathL", CThumbnailManagerTest::CreateSourceInstancePathL ),
- ENTRY( "CreateSourceInstancePathTargetL", CThumbnailManagerTest::CreateSourceInstancePathTargetL ),
- ENTRY( "CreateSourceInstanceHandleL", CThumbnailManagerTest::CreateSourceInstanceHandleL ),
- ENTRY( "CreateSourceInstanceBufferL", CThumbnailManagerTest::CreateSourceInstanceBufferL ),
- ENTRY( "CreateSourceInstanceBitmapL", CThumbnailManagerTest::CreateSourceInstanceBitmapL ),
- ENTRY( "DeleteSourceInstance", CThumbnailManagerTest::DeleteSourceInstance ),
- ENTRY( "GetThumbnailL", CThumbnailManagerTest::GetThumbnailL ),
- ENTRY( "GetThumbnailByIdL", CThumbnailManagerTest::GetThumbnailByIdL ),
- ENTRY( "SetThumbnailL", CThumbnailManagerTest::SetThumbnailL ),
- ENTRY( "ImportThumbnailL", CThumbnailManagerTest::ImportThumbnailL ),
- ENTRY( "CheckPreviewThumbnailL", CThumbnailManagerTest::CheckPreviewThumbnailL ),
- ENTRY( "CheckThumbnailL", CThumbnailManagerTest::CheckThumbnailL ),
- ENTRY( "CheckThumbnailCenrepL", CThumbnailManagerTest::CheckThumbnailCenrepL ),
- ENTRY( "CancelPrevious", CThumbnailManagerTest::CancelPrevious ),
- ENTRY( "ChangePreviousPriority", CThumbnailManagerTest::ChangePreviousPriority ),
- ENTRY( "SetFlagsL", CThumbnailManagerTest::SetFlagsL ),
- ENTRY( "CheckFlags", CThumbnailManagerTest::CheckFlags ),
- ENTRY( "SetQualityPreferenceL", CThumbnailManagerTest::SetQualityPreferenceL ),
- ENTRY( "CheckQualityPreference", CThumbnailManagerTest::CheckQualityPreference ),
- ENTRY( "SetDisplayModeL", CThumbnailManagerTest::SetDisplayModeL ),
- ENTRY( "CheckDisplayModeL", CThumbnailManagerTest::CheckDisplayModeL ),
- ENTRY( "DeleteThumbnails", CThumbnailManagerTest::DeleteThumbnails ),
- ENTRY( "CreateThumbnailsByUrlL", CThumbnailManagerTest::CreateThumbnailsByUrlL ),
- ENTRY( "CreateThumbnails", CThumbnailManagerTest::CreateThumbnails ),
- ENTRY( "UpdatePathL", CThumbnailManagerTest::UpdatePathL ),
- ENTRY( "GetSupportedMimeTypesL", CThumbnailManagerTest::GetSupportedMimeTypesL )
- };
-
- const TInt count = sizeof( KFunctions ) / sizeof( TStifFunctionInfo );
-
- return RunInternalL( KFunctions, count, aItem );
- }
-
-TInt CThumbnailManagerTest::CreateInstanceL( CStifItemParser& /*aItem*/ )
- {
- _LIT( KPanicTxt, "CreateInstanceL" );
- __ASSERT_ALWAYS( !iEngine, User::Panic( KPanicTxt, 0 ));
-
- iEngine = CThumbnailManager::NewL( *this );
-
- iCenrep = CThumbnailCenRep::NewL();
- iPersistentSizes = iCenrep->GetPersistentSizes();
-
- iCurrentThumbnailSize = EUnknownThumbnailSize;
- iDoNotCreate = EFalse;
- iCreateThumbnails = EFalse;
-
- return KErrNone;
- }
-
-TInt CThumbnailManagerTest::DeleteInstance( CStifItemParser& /*aItem*/ )
- {
- // Bitmaps must be deleted before CThumbnailManager, since
- // CThumbnailManager will close the FBS session
- delete iPreviewThumbnail;
- iPreviewThumbnail = NULL;
- delete iThumbnail;
- iThumbnail = NULL;
- delete iEngine;
- iEngine = NULL;
- delete iObjectSource;
- iObjectSource = NULL;
- delete iCenrep;
- iCenrep = NULL;
-
- return KErrNone;
- }
-
-TInt CThumbnailManagerTest::SetThumbnailSizeL( CStifItemParser& aItem )
- {
- _LIT( KPanicTxt, "SetThumbnailSizeL" );
- __ASSERT_ALWAYS( iEngine, User::Panic( KPanicTxt, 0 ));
-
- TInt width = 0;
- TInt height = 0;
- User::LeaveIfError( aItem.GetNextInt( width ));
- User::LeaveIfError( aItem.GetNextInt( height ));
- iEngine->SetThumbnailSizeL( TSize( width, height ));
- return KErrNone;
- }
-
-TInt CThumbnailManagerTest::CheckThumbnailSizeL( CStifItemParser& aItem )
- {
- _LIT( KPanicTxt, "CheckThumbnailSize" );
- __ASSERT_ALWAYS( iEngine, User::Panic( KPanicTxt, 0 ));
-
- TInt width = 0;
- TInt height = 0;
- User::LeaveIfError( aItem.GetNextInt( width ));
- User::LeaveIfError( aItem.GetNextInt( height ));
- TInt ret = KErrArgument;
- TSize size = iEngine->ThumbnailSize();
-
- if ( size == TSize( width, height ))
- {
- ret = KErrNone;
- }
-
- return ret;
- }
-
-TInt CThumbnailManagerTest::SetThumbnailEnumSizeL( CStifItemParser& aItem )
- {
- _LIT( KPanicTxt, "SetThumbnailEnumSizeL" );
- __ASSERT_ALWAYS( iEngine, User::Panic( KPanicTxt, 0 ));
-
- TInt enumSize = 0;
- User::LeaveIfError( aItem.GetNextInt( enumSize ));
-
- iEngine->SetThumbnailSizeL( (TThumbnailSize)enumSize );
- iCurrentThumbnailSize = (TThumbnailSize)enumSize;
-
- return KErrNone;
- }
-
-TInt CThumbnailManagerTest::SetFlagsL( CStifItemParser& aItem )
- {
- _LIT( KPanicTxt, "SetFlagsL" );
- __ASSERT_ALWAYS( iEngine, User::Panic( KPanicTxt, 0 ));
-
- TInt flags = 0;
- User::LeaveIfError( aItem.GetNextInt( flags ));
-
- iEngine->SetFlagsL(( CThumbnailManager::TThumbnailFlags )flags );
-
- if (flags == CThumbnailManager::EDoNotCreate)
- {
- iDoNotCreate = ETrue;
- }
- else
- {
- iDoNotCreate = EFalse;
- }
-
- return KErrNone;
- }
-
-TInt CThumbnailManagerTest::CheckFlags( CStifItemParser& aItem )
- {
- _LIT( KPanicTxt, "CheckFlags" );
- __ASSERT_ALWAYS( iEngine, User::Panic( KPanicTxt, 0 ));
-
- TInt flags = 0;
- aItem.GetNextInt( flags );
-
- if ( iEngine->Flags() != flags )
- {
- return KErrArgument;
- }
-
- return KErrNone;
- }
-
-TInt CThumbnailManagerTest::SetQualityPreferenceL( CStifItemParser& aItem
- )
- {
- _LIT( KPanicTxt, "SetQualityPreferenceL" );
- __ASSERT_ALWAYS( iEngine, User::Panic( KPanicTxt, 0 ));
-
- TInt qp = 0;
- User::LeaveIfError( aItem.GetNextInt( qp ));
-
- iEngine->SetQualityPreferenceL( (CThumbnailManager::TThumbnailQualityPreference)qp );
- return KErrNone;
- }
-
-TInt CThumbnailManagerTest::CheckQualityPreference( CStifItemParser&
- aItem )
- {
- _LIT( KPanicTxt, "CheckQualityPreference" );
- __ASSERT_ALWAYS( iEngine, User::Panic( KPanicTxt, 0 ));
-
- TInt qp = 0;
- aItem.GetNextInt( qp );
-
- if ( iEngine->QualityPreference() != qp )
- {
- return KErrArgument;
- }
-
- return KErrNone;
- }
-
-TInt CThumbnailManagerTest::SetDisplayModeL( CStifItemParser& aItem )
- {
- _LIT( KPanicTxt, "SetDisplayModeL" );
- __ASSERT_ALWAYS( iEngine, User::Panic( KPanicTxt, 0 ));
-
- TInt displaymode = 0;
- User::LeaveIfError( aItem.GetNextInt( displaymode ));
-
- iEngine->SetDisplayModeL( (TDisplayMode)displaymode );
- return KErrNone;
- }
-
-TInt CThumbnailManagerTest::CheckDisplayModeL( CStifItemParser& aItem )
- {
- _LIT( KPanicTxt, "CheckDisplayModeL" );
- __ASSERT_ALWAYS( iEngine, User::Panic( KPanicTxt, 0 ));
-
- TInt displaymode = 0;
- User::LeaveIfError( aItem.GetNextInt( displaymode ));
-
- if ( iEngine->DisplayMode() != displaymode )
- {
- return KErrArgument;
- }
-
- return KErrNone;
- }
-
-TInt CThumbnailManagerTest::CreateSourceInstancePathL( CStifItemParser& aItem )
- {
- _LIT( KPanicTxt, "CreateSrcPath" );
- __ASSERT_ALWAYS( !iObjectSource, User::Panic( KPanicTxt, 0 ));
-
- TPtrC path;
- User::LeaveIfError( aItem.GetNextString( path ));
-
- TInt id = 0;
- aItem.GetNextInt( id );
-
- TFileName filePath( iDataPath );
- filePath.Append( path );
- filePath.ZeroTerminate();
-
- iLog->Log( _L( "CreateSourceInstancePathL - path = %S" ), &filePath );
-
- delete iObjectSource;
- iObjectSource = NULL;
-
- iObjectSource = CThumbnailObjectSource::NewL( filePath, id );
- return KErrNone;
- }
-
-TInt CThumbnailManagerTest::CreateSourceInstancePathTargetL( CStifItemParser& aItem )
- {
- _LIT( KPanicTxt, "CreateSrcPathTarget" );
- __ASSERT_ALWAYS( !iObjectSource, User::Panic( KPanicTxt, 0 ));
-
- TPtrC path;
- User::LeaveIfError( aItem.GetNextString( path ));
-
- TPtrC target;
- User::LeaveIfError( aItem.GetNextString( target ));
-
- TPtrC mimeType;
- User::LeaveIfError( aItem.GetNextString( mimeType ));
-
- TInt virtual1 = 0;
- aItem.GetNextInt( virtual1 );
-
- TInt virtual2 = 0;
- aItem.GetNextInt( virtual2 );
-
- TFileName filePath( iDataPath );
- filePath.Append( path );
- filePath.ZeroTerminate();
-
- if (virtual1)
- {
- filePath.Delete(2,1);
- }
-
- TFileName targetPath( iDataPath );
- targetPath.Append( target );
- targetPath.ZeroTerminate();
-
- if (virtual2)
- {
- targetPath.Delete(2,1);
- }
-
- iLog->Log( _L( "CreateSourceInstancePathTargetL - path = %S, target = %S" ), &filePath );
-
- delete iObjectSource;
- iObjectSource = NULL;
-
- iObjectSource = CThumbnailObjectSource::NewL( filePath, targetPath, mimeType );
- return KErrNone;
- }
-
-TInt CThumbnailManagerTest::CreateSourceInstanceHandleL( CStifItemParser& aItem )
- {
- _LIT( KPanicTxt, "CreateSrcHandle" );
- __ASSERT_ALWAYS( !iObjectSource, User::Panic( KPanicTxt, 0 ));
-
- TPtrC path;
- User::LeaveIfError( aItem.GetNextString( path ));
-
- TFileName filePath( iDataPath );
- filePath.Append( path );
- filePath.ZeroTerminate();
-
- User::LeaveIfError( iFile.Open( iFs, filePath, EFileShareReadersOrWriters ));
- iLog->Log( _L( "CreateSourceInstanceHandleL - path = %S" ), &filePath );
-
- delete iObjectSource;
- iObjectSource = NULL;
- iObjectSource = CThumbnailObjectSource::NewL( iFile );
- return KErrNone;
- }
-
-TInt CThumbnailManagerTest::CreateSourceInstanceBufferL( CStifItemParser& aItem )
- {
- _LIT( KPanicTxt, "CreateSrcBuffer" );
- __ASSERT_ALWAYS( !iObjectSource, User::Panic( KPanicTxt, 0 ));
-
- TPtrC path;
- User::LeaveIfError( aItem.GetNextString( path ));
-
- TPtrC mimeType;
- User::LeaveIfError( aItem.GetNextString( mimeType ));
-
- TFileName filePath( iDataPath );
- filePath.Append( path );
- filePath.ZeroTerminate();
-
- User::LeaveIfError( iFile.Open( iFs, filePath, EFileShareReadersOrWriters ));
- iLog->Log( _L( "CreateSourceInstanceBufferL - path = %S" ), &filePath );
-
- TInt64 size;
- User::LeaveIfError( iFile.Size( size ) );
- iBuffer = HBufC8::NewL( size );
- TPtr8 ptr = iBuffer->Des();
- iFile.Read( ptr );
- iFile.Close();
-
- delete iObjectSource;
- iObjectSource = NULL;
- iObjectSource = CThumbnailObjectSource::NewL( iBuffer, mimeType, filePath );
-
- iBuffer = NULL;
- return KErrNone;
- }
-
-TInt CThumbnailManagerTest::CreateSourceInstanceBitmapL( CStifItemParser& aItem )
- {
- _LIT( KPanicTxt, "CreateSrcBuffer" );
- __ASSERT_ALWAYS( !iObjectSource, User::Panic( KPanicTxt, 0 ));
-
- TPtrC path;
- User::LeaveIfError( aItem.GetNextString( path ));
-
- TFileName filePath( iDataPath );
- filePath.Append( path );
- filePath.ZeroTerminate();
-
- TPtrC target;
- User::LeaveIfError( aItem.GetNextString( target ));
-
- TFileName targetPath( iDataPath );
- targetPath.Append( target );
- targetPath.ZeroTerminate();
-
- iLog->Log( _L( "CreateSourceInstanceBitmapL - bitmap = %S" ), &filePath );
- iLog->Log( _L( "CreateSourceInstanceBitmapL - target = %S" ), &targetPath );
-
- iBitmap = new (ELeave) CFbsBitmap();
- User::LeaveIfError(iBitmap->Load(filePath, 0));
-
- delete iObjectSource;
- iObjectSource = NULL;
- iObjectSource = CThumbnailObjectSource::NewL( iBitmap, targetPath );
-
- return KErrNone;
- }
-
-TInt CThumbnailManagerTest::DeleteSourceInstance( CStifItemParser& /*aItem*/ )
- {
- delete iObjectSource;
- iObjectSource = NULL;
- return KErrNone;
- }
-
-TInt CThumbnailManagerTest::GetThumbnailL( CStifItemParser& aItem )
- {
- _LIT( KPanicTxt, "GetThumbnailL" );
- __ASSERT_ALWAYS( iObjectSource, User::Panic( KPanicTxt, 0 ));
- __ASSERT_ALWAYS( iEngine, User::Panic( KPanicTxt, 1 ));
-
- TInt clientData = NULL;
- TInt priority = 0;
-
- TInt err = aItem.GetNextInt( clientData );
- if ( !err )
- {
- aItem.GetNextInt( priority );
- }
-
- iPreviousRequestId = iEngine->GetThumbnailL( *iObjectSource, ( TAny* )
- clientData, priority );
- iLog->Log( _L( "GetThumbnailL - request id %d" ), iPreviousRequestId );
-
- if (!iDoNotCreate)
- {
- iCreateThumbnails = EFalse;
- }
-
- return KErrNone;
- }
-
-TInt CThumbnailManagerTest::GetThumbnailByIdL( CStifItemParser& aItem )
- {
- _LIT( KPanicTxt, "GetThumbnailByIdL" );
- __ASSERT_ALWAYS( iObjectSource, User::Panic( KPanicTxt, 0 ));
- __ASSERT_ALWAYS( iEngine, User::Panic( KPanicTxt, 1 ));
-
- TInt id = 0;
- TInt clientData = NULL;
- TInt priority = 0;
-
- User::LeaveIfError( aItem.GetNextInt( id ));
- TInt err = aItem.GetNextInt( clientData );
- if ( !err )
- {
- aItem.GetNextInt( priority );
- }
-
- iPreviousRequestId = iEngine->GetThumbnailL( id, (TAny*)clientData, priority );
- iLog->Log( _L( "GetThumbnailByIdL - request id %d" ), iPreviousRequestId );
-
- if (!iDoNotCreate)
- {
- iCreateThumbnails = EFalse;
- }
-
- return KErrNone;
- }
-
-TInt CThumbnailManagerTest::SetThumbnailL( CStifItemParser& aItem )
- {
- _LIT( KPanicTxt, "SetThumbnailL" );
- __ASSERT_ALWAYS( iObjectSource, User::Panic( KPanicTxt, 0 ));
- __ASSERT_ALWAYS( iEngine, User::Panic( KPanicTxt, 1 ));
-
- TInt clientData = NULL;
- TInt priority = 0;
-
- TInt err = aItem.GetNextInt( clientData );
- if ( !err )
- {
- aItem.GetNextInt( priority );
- }
-
- iPreviousRequestId = iEngine->SetThumbnailL( *iObjectSource, ( TAny* )
- clientData, priority );
- iLog->Log( _L( "SetThumbnailL - request id %d" ), iPreviousRequestId );
-
- if (!iDoNotCreate)
- {
- iCreateThumbnails = EFalse;
- }
-
- return KErrNone;
- }
-
-TInt CThumbnailManagerTest::ImportThumbnailL( CStifItemParser& aItem )
- {
- _LIT( KPanicTxt, "ImportThumbnailL" );
- __ASSERT_ALWAYS( iObjectSource, User::Panic( KPanicTxt, 0 ));
- __ASSERT_ALWAYS( iEngine, User::Panic( KPanicTxt, 1 ));
-
- TInt clientData = NULL;
- TInt priority = 0;
- TPtrC path;
-
- User::LeaveIfError( aItem.GetNextString( path ));
-
- TFileName filePath( iDataPath );
- filePath.Append( path );
- filePath.ZeroTerminate();
-
- TInt err = aItem.GetNextInt( clientData );
- if ( !err )
- {
- aItem.GetNextInt( priority );
- }
-
- iPreviousRequestId = iEngine->ImportThumbnailL( *iObjectSource, filePath,
- (TAny*)clientData, priority );
- iLog->Log( _L( "ImportThumbnailL - request id %d" ), iPreviousRequestId );
-
- if (!iDoNotCreate)
- {
- iCreateThumbnails = EFalse;
- }
-
- return KErrNone;
- }
-
-void CThumbnailManagerTest::ThumbnailPreviewReady( MThumbnailData&
- aThumbnail, TThumbnailRequestId aId )
- {
- iLog->Log( _L( "ThumbnailPreviewReady aId=%d" ), aId );
- delete iPreviewThumbnail;
- iPreviewThumbnail = aThumbnail.DetachBitmap();
- iPreviewThumbnailCbId = aId;
- Signal( KErrNone );
- }
-
-void CThumbnailManagerTest::ThumbnailReady( TInt aError, MThumbnailData&
- aThumbnail, TThumbnailRequestId aId )
- {
- iLog->Log( _L( "ThumbnailReady aError=%d aId=%d" ), aError, aId );
- delete iThumbnail;
- iThumbnail = aThumbnail.DetachBitmap();
- iThumbnailCbId = aId;
-
- // ignore KErrNotFound, if auto create disabled (CreateThumbnails used)
- if (aError == KErrNotFound && iCreateThumbnails)
- {
- for ( TInt i = 0 ; i < iPersistentSizes.Count(); i++ )
- {
- if ( iPersistentSizes[i].iType == iCurrentThumbnailSize &&
- !iPersistentSizes[i].iAutoCreate )
- {
- aError = KErrNone;
- break;
- }
- }
- }
-
- Signal( aError );
- }
-
-TInt CThumbnailManagerTest::CheckPreviewThumbnailL( CStifItemParser& aItem )
- {
- if ( iPreviewThumbnail )
- {
- TInt width = 0;
- TInt height = 0;
- TInt displaymode = 0;
- User::LeaveIfError( aItem.GetNextInt( width ));
- User::LeaveIfError( aItem.GetNextInt( height ));
- User::LeaveIfError( aItem.GetNextInt( displaymode ));
- TSize size = iPreviewThumbnail->SizeInPixels();
- iLog->Log( _L(
- "CheckPreviewThumbnailL - bitmap size %dx%d (expecting %dx%d)" ),
- size.iWidth, size.iHeight, width, height );
- iLog->Log( _L( "CheckPreviewThumbnailL - bitmap mode %d (expecting %d)"
- ), iPreviewThumbnail->DisplayMode(), displaymode );
- if ( size != TSize( width, height ))
- {
- iLog->Log( _L( "CheckPreviewThumbnailL - size mismatch" ));
- User::Leave( KErrArgument );
- }
- else if ( displaymode != iPreviewThumbnail->DisplayMode())
- {
- iLog->Log( _L( "CheckPreviewThumbnailL - displaymode mismatch" ));
- User::Leave( KErrArgument );
- }
- else
- {
- iLog->Log( _L( "CheckPreviewThumbnailL - ok" ));
- }
- }
- else
- {
- // Bitmap missing
- iLog->Log( _L( "CheckPreviewThumbnailL - preview bitmap NULL" ));
- User::Leave( KErrUnknown );
- }
- return KErrNone;
- }
-
-TInt CThumbnailManagerTest::CheckThumbnailL( CStifItemParser& aItem )
- {
- if ( iThumbnail )
- {
- TInt width = 0;
- TInt height = 0;
- TInt displaymode = 0;
- User::LeaveIfError( aItem.GetNextInt( width ));
- User::LeaveIfError( aItem.GetNextInt( height ));
- User::LeaveIfError( aItem.GetNextInt( displaymode ));
- TSize size = iThumbnail->SizeInPixels();
- iLog->Log( _L( "CheckThumbnailL - bitmap size %dx%d (expecting %dx%d)" )
- , size.iWidth, size.iHeight, width, height );
- iLog->Log( _L( "CheckThumbnailL - bitmap mode %d (expecting %d)" ),
- iThumbnail->DisplayMode(), displaymode );
-
- // one needs to match, aspect ratio scaling makes this difficult...
- if ( size.iWidth != width && size.iHeight != height )
- {
- iLog->Log( _L( "CheckThumbnailL - size mismatch" ));
- User::Leave( KErrArgument );
- }
- else if ( displaymode != iThumbnail->DisplayMode())
- {
- iLog->Log( _L( "CheckThumbnailL - displaymode mismatch" ));
- }
- else
- {
- iLog->Log( _L( "CheckThumbnailL - ok" ));
- }
- }
- else
- {
- // Bitmap missing
- iLog->Log( _L( "CheckThumbnailL - bitmap NULL" ));
- User::Leave( KErrNotFound );
- }
- return KErrNone;
- }
-
-TInt CThumbnailManagerTest::CheckThumbnailCenrepL( CStifItemParser& aItem )
- {
- TInt err = KErrNone;
- TBool full = EFalse;
-
- TInt sizeType;
- TInt displaymode = 0;
- User::LeaveIfError( aItem.GetNextInt( sizeType ));
- User::LeaveIfError( aItem.GetNextInt( displaymode ));
-
- TThumbnailSize size = (TThumbnailSize)sizeType;
- if (size == EImageFullScreenThumbnailSize ||
- size == EVideoFullScreenThumbnailSize ||
- size == EAudioFullScreenThumbnailSize)
- {
- full = ETrue;
- }
-
- if ( iThumbnail )
- {
- TInt width = 0;
- TInt height = 0;
-
- for ( TInt i = 0 ; i < iPersistentSizes.Count(); i++ )
- {
- if ( iPersistentSizes[i].iType == size )
- {
- width = iPersistentSizes[i].iSize.iWidth;
- height = iPersistentSizes[i].iSize.iHeight;
- break;
- }
- }
-
- TSize thumbSize = iThumbnail->SizeInPixels();
-
- iLog->Log( _L( "CheckThumbnailCenrepL - bitmap size %dx%d (expecting %dx%d)" )
- , thumbSize.iWidth, thumbSize.iHeight, width, height );
- iLog->Log( _L( "CheckThumbnailCenrepL - bitmap mode %d (expecting %d)" ),
- iThumbnail->DisplayMode(), displaymode );
-
- // one needs to match, and both need to be smaller than cenrep value
- if ( (thumbSize.iWidth == width || thumbSize.iHeight == height) &&
- thumbSize.iWidth <= width && thumbSize.iHeight <= height)
- {
- iLog->Log( _L( "CheckThumbnailCenrepL - ok" ));
- }
- else if (full && (thumbSize.iWidth <= width && thumbSize.iHeight <= height))
- {
- iLog->Log( _L( "CheckThumbnailCenrepL - fullscreen ok, not upscaled" ));
- }
- else
- {
- iLog->Log( _L( "CheckThumbnailCenrepL - size mismatch" ));
- err = KErrArgument;
- }
-
- // check display mode
- if ( displaymode != iThumbnail->DisplayMode())
- {
- iLog->Log( _L( "CheckThumbnailCenrepL - displaymode mismatch" ));
- err = KErrArgument;
- }
- }
- else
- {
- for ( TInt i = 0 ; i < iPersistentSizes.Count(); i++ )
- {
- if ( iPersistentSizes[i].iType == size && iPersistentSizes[i].iAutoCreate)
- {
- // Bitmap missing
- iLog->Log( _L( "CheckThumbnailCenrepL - bitmap NULL" ));
- err = KErrNotFound;
- break;
- }
- }
- }
-
- return err;
- }
-
-TInt CThumbnailManagerTest::CancelPrevious( CStifItemParser& /*aItem*/ )
- {
- _LIT( KPanicTxt, "CancelPrevious" );
- __ASSERT_ALWAYS( iEngine, User::Panic( KPanicTxt, 0 ));
-
- TInt err = iEngine->CancelRequest( iPreviousRequestId );
- iLog->Log( _L( "CancelPrevious() returned %d" ), err );
- return err;
- }
-
-TInt CThumbnailManagerTest::ChangePreviousPriority( CStifItemParser&
- aItem )
- {
- _LIT( KPanicTxt, "ChangePreviousPriority" );
- __ASSERT_ALWAYS( iEngine, User::Panic( KPanicTxt, 0 ));
-
- TInt priority = 0;
- aItem.GetNextInt( priority );
-
- TInt err = iEngine->ChangePriority( iPreviousRequestId, priority );
- iLog->Log( _L( "ChangePriority() returned %d" ), err );
- return err;
- }
-
-
-TInt CThumbnailManagerTest::DeleteThumbnails( CStifItemParser& /*aItem*/ )
- {
- iEngine->DeleteThumbnails( *iObjectSource );
- return KErrNone;
- }
-
-TInt CThumbnailManagerTest::CreateThumbnailsByUrlL( CStifItemParser& aItem )
- {
- _LIT( KPanicTxt, "CreateSrcPath" );
- __ASSERT_ALWAYS( !iObjectSource, User::Panic( KPanicTxt, 0 ));
-
- TPtrC path;
- User::LeaveIfError( aItem.GetNextString( path ));
-
- TInt id = 0;
- aItem.GetNextInt( id );
-
- TFileName filePath( iDataPath );
- filePath.Append( path );
- filePath.ZeroTerminate();
-
- iLog->Log( _L( "CreateSourceInstancePathL - path = %S" ), &filePath );
-
- delete iObjectSource;
- iObjectSource = NULL;
-
- iObjectSource = CThumbnailObjectSource::NewL( filePath, id );
-
- id = iEngine->CreateThumbnails( *iObjectSource );
- if (id < 0)
- {
- iLog->Log( _L( "CreateThumbnails - error %d" ), id );
- return id;
- }
- else
- {
- iPreviousRequestId = id;
- iLog->Log( _L( "CreateThumbnails - request id %d" ), iPreviousRequestId );
- }
-
- iCreateThumbnails = ETrue;
-
- return KErrNone;
- }
-
-
-TInt CThumbnailManagerTest::CreateThumbnails( CStifItemParser& aItem )
- {
- _LIT( KPanicTxt, "CreateThumbnails" );
- __ASSERT_ALWAYS( iObjectSource, User::Panic( KPanicTxt, 0 ));
- __ASSERT_ALWAYS( iEngine, User::Panic( KPanicTxt, 1 ));
-
- TInt priority = 0;
-
- aItem.GetNextInt( priority );
-
- TInt id;
- id = iEngine->CreateThumbnails( *iObjectSource, priority );
- if (id < 0)
- {
- iLog->Log( _L( "CreateThumbnails - error %d" ), id );
- return id;
- }
- else
- {
- iPreviousRequestId = id;
- iLog->Log( _L( "CreateThumbnails - request id %d" ), iPreviousRequestId );
- }
-
- iCreateThumbnails = ETrue;
-
- return KErrNone;
- }
-
-TInt CThumbnailManagerTest::UpdatePathL( CStifItemParser& aItem )
- {
- _LIT( KPanicTxt, "UpdatePath" );
- __ASSERT_ALWAYS( iEngine, User::Panic( KPanicTxt, 0 ));
-
- TInt id = 0;
- TPtrC path;
- User::LeaveIfError( aItem.GetNextInt( id ));
- User::LeaveIfError( aItem.GetNextString( path ));
-
- TFileName filePath( iDataPath );
- filePath.Append( path );
- filePath.ZeroTerminate();
-
- iLog->Log( _L( "UpdatePath - path = %S" ), &filePath );
-
- iEngine->UpdateThumbnailsL(id, filePath, 0, 1000, CActive::EPriorityIdle);
-
- return KErrNone;
- }
-
-TInt CThumbnailManagerTest::GetSupportedMimeTypesL( CStifItemParser& /*aItem*/ )
- {
- _LIT( KPanicTxt, "GetSupportedMimeTypesL" );
- __ASSERT_ALWAYS( iEngine, User::Panic( KPanicTxt, 0 ));
-
- iEngine->GetSupportedMimeTypesL();
-
- return KErrNone;
- }
-
-
-// ========================== OTHER EXPORTED FUNCTIONS =========================
-// None
-
-// [End of File] - Do not remove
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandling_plat/thumbnailmanager_api/tsrc/src/thumbnailcenrep.cpp
--- a/imagehandling_plat/thumbnailmanager_api/tsrc/src/thumbnailcenrep.cpp Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,325 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Class for handling central repositoty data
- *
-*/
-
-
-#include
-#include
-
-#include "thumbnailcenrep.h"
-
-
-#define THUMBNAIL_CENREP_UID 0x102830B0
-
-const TUint32 KSizeImageGridWidth = 0x0;
-const TUint32 KSizeImageGridHeight = 0x1;
-const TUint32 KSizeImageListWidth = 0x2;
-const TUint32 KSizeImageListHeight = 0x3;
-const TUint32 KSizeImageFullscreenWidth = 0x4;
-const TUint32 KSizeImageFullscreenHeight = 0x5;
-const TUint32 KSizeVideoGridWidth = 0x6;
-const TUint32 KSizeVideoGridHeight = 0x7;
-const TUint32 KSizeVideoListWidth = 0x8;
-const TUint32 KSizeVideoListHeight = 0x9;
-const TUint32 KSizeVideoFullscreenWidth = 0x10;
-const TUint32 KSizeVideoFullscreenHeight = 0x11;
-const TUint32 KSizeAudioGridWidth = 0x12;
-const TUint32 KSizeAudioGridHeight = 0x13;
-const TUint32 KSizeAudioListWidth = 0x14;
-const TUint32 KSizeAudioListHeight = 0x15;
-const TUint32 KSizeAudioFullscreenWidth = 0x16;
-const TUint32 KSizeAudioFullscreenHeight = 0x17;
-const TUint32 KSizeContactListWidth = 0x18;
-const TUint32 KSizeContactListHeight = 0x19;
-const TUint32 KSizeContactGridWidth = 0x20;
-const TUint32 KSizeContactGridHeight = 0x21;
-const TUint32 KSizeContactFullscreenWidth = 0x22;
-const TUint32 KSizeContactFullscreenHeight = 0x23;
-
-const TUint32 KAutoCreateImageGrid = 0x100;
-const TUint32 KAutoCreateImageList = 0x101;
-const TUint32 KAutoCreateImageFullscreen = 0x102;
-const TUint32 KAutoCreateVideoGrid = 0x103;
-const TUint32 KAutoCreateVideoList = 0x104;
-const TUint32 KAutoCreateVideoFullscreen = 0x105;
-const TUint32 KAutoCreateAudioGrid = 0x106;
-const TUint32 KAutoCreateAudioList = 0x107;
-const TUint32 KAutoCreateAudioFullscreen = 0x108;
-const TUint32 KAutoCreateContactGrid = 0x109;
-const TUint32 KAutoCreateContactList = 0x110;
-const TUint32 KAutoCreateContactFullscreen = 0x111;
-
-
-// ---------------------------------------------------------------------------
-// TThumbnailPersistentSize::TThumbnailPersistentSize
-// ---------------------------------------------------------------------------
-//
-TThumbnailPersistentSize::TThumbnailPersistentSize( const TSize& aSize, TBool
- aCrop, TDisplayMode aMode, TInt aFormat ): iSize( aSize ), iCrop( aCrop ),
- iMode( aMode ), iFormat( aFormat )
- {
- iType = EUnknownThumbnailSize;
- iSourceType = EUnknownSourceType;
- iAutoCreate = ETrue;
- }
-
-// ---------------------------------------------------------------------------
-// TThumbnailPersistentSize::TThumbnailPersistentSize
-// ---------------------------------------------------------------------------
-//
-TThumbnailPersistentSize::TThumbnailPersistentSize( TThumbnailSize aType,
- const TSize& aSize, TBool aCrop, TDisplayMode aMode, TInt aFormat,
- TBool aAutoCreate )
- : iType( aType ), iSize( aSize ), iCrop( aCrop ), iMode( aMode ),
- iFormat( aFormat ), iAutoCreate( aAutoCreate )
- {
- switch ( aType )
- {
- case EImageGridThumbnailSize:
- case EImageListThumbnailSize:
- case EImageFullScreenThumbnailSize:
- iSourceType = EImage;
- break;
- case EVideoGridThumbnailSize:
- case EVideoListThumbnailSize:
- case EVideoFullScreenThumbnailSize:
- iSourceType = EVideo;
- break;
- case EAudioGridThumbnailSize:
- case EAudioListThumbnailSize:
- case EAudioFullScreenThumbnailSize:
- iSourceType = EAudio;
- break;
- case EContactGridThumbnailSize:
- case EContactListThumbnailSize:
- case EContactFullScreenThumbnailSize:
- iSourceType = EContact;
- break;
- default:
- iSourceType = EUnknownSourceType;
- }
-
- }
-
-// ---------------------------------------------------------------------------
-// TThumbnailAutoCreate::TThumbnailAutoCreate
-// ---------------------------------------------------------------------------
-//
-TThumbnailAutoCreate::TThumbnailAutoCreate()
- : iImageGrid(EFalse), iImageList(EFalse), iImageFullscreen(EFalse),
- iVideoGrid(EFalse), iVideoList(EFalse), iVideoFullscreen(EFalse),
- iAudioGrid(EFalse), iAudioList(EFalse), iAudioFullscreen(EFalse),
- iContactGrid(EFalse), iContactList(EFalse), iContactFullscreen(EFalse)
- {
- // No implementation required
- }
-
-// ======== MEMBER FUNCTIONS ========
-
-// ---------------------------------------------------------------------------
-// CThumbnailCenRep::CThumbnailCenRep()
-// C++ default constructor can NOT contain any code, that might leave.
-// ---------------------------------------------------------------------------
-//
-CThumbnailCenRep::CThumbnailCenRep()
- {
- // No implementation required
- }
-
-
-// ---------------------------------------------------------------------------
-// CThumbnailCenRep::~CThumbnailCenRep()
-// Destructor.
-// ---------------------------------------------------------------------------
-//
-CThumbnailCenRep::~CThumbnailCenRep()
- {
- iPersistentSizes.Close();
- delete iAutoCreate;
- delete iRepository;
- }
-
-// ---------------------------------------------------------------------------
-// CThumbnailCenRep::NewL()
-// Two-phased constructor.
-// ---------------------------------------------------------------------------
-//
-CThumbnailCenRep* CThumbnailCenRep::NewL()
- {
- CThumbnailCenRep* self = new( ELeave )CThumbnailCenRep();
- CleanupStack::PushL( self );
- self->ConstructL();
- CleanupStack::Pop( self );
- return self;
- }
-
-// ---------------------------------------------------------------------------
-// CThumbnailCenRep::ConstructL()
-// Returns id of specific task.
-// ---------------------------------------------------------------------------
-//
-void CThumbnailCenRep::ConstructL()
- {
- iRepository = CRepository::NewL( TUid::Uid( THUMBNAIL_CENREP_UID ));
-
- TInt xSize( 0 );
- TInt ySize( 0 );
- TBool flags( EFalse );
- const TBool KGridAndListThumbnailCropped = ETrue;
- TInt raw_mode( EColor64K );
- TInt format( 0 );
- TBool autoCreate( EFalse );
-
- User::LeaveIfError( iRepository->Get( KSizeImageGridWidth, xSize ));
- User::LeaveIfError( iRepository->Get( KSizeImageGridHeight, ySize ));
- User::LeaveIfError( iRepository->Get( KAutoCreateImageGrid, autoCreate ));
-
- iPersistentSizes.AppendL( TThumbnailPersistentSize( EImageGridThumbnailSize, TSize( xSize, ySize ),
- KGridAndListThumbnailCropped, static_cast (raw_mode), format, autoCreate ));
-
- User::LeaveIfError( iRepository->Get( KSizeImageListWidth, xSize ));
- User::LeaveIfError( iRepository->Get( KSizeImageListHeight, ySize ));
- User::LeaveIfError( iRepository->Get( KAutoCreateImageList, autoCreate ));
-
- iPersistentSizes.AppendL( TThumbnailPersistentSize( EImageListThumbnailSize, TSize( xSize, ySize ),
- KGridAndListThumbnailCropped, static_cast (raw_mode), format, autoCreate ));
-
- User::LeaveIfError( iRepository->Get( KSizeImageFullscreenWidth, xSize ));
- User::LeaveIfError( iRepository->Get( KSizeImageFullscreenHeight, ySize ));
- User::LeaveIfError( iRepository->Get( KAutoCreateImageFullscreen, autoCreate ));
-
- iPersistentSizes.AppendL( TThumbnailPersistentSize( EImageFullScreenThumbnailSize, TSize( xSize, ySize ),
- flags, static_cast (raw_mode), format, autoCreate ));
-
- User::LeaveIfError( iRepository->Get( KSizeVideoGridWidth, xSize ));
- User::LeaveIfError( iRepository->Get( KSizeVideoGridHeight, ySize ));
- User::LeaveIfError( iRepository->Get( KAutoCreateVideoGrid, autoCreate ));
-
- iPersistentSizes.AppendL( TThumbnailPersistentSize( EVideoGridThumbnailSize, TSize( xSize, ySize ),
- KGridAndListThumbnailCropped, static_cast (raw_mode), format, autoCreate ));
-
- User::LeaveIfError( iRepository->Get( KSizeVideoListWidth, xSize ));
- User::LeaveIfError( iRepository->Get( KSizeVideoListHeight, ySize ));
- User::LeaveIfError( iRepository->Get( KAutoCreateVideoList, autoCreate ));
-
- iPersistentSizes.AppendL( TThumbnailPersistentSize( EVideoListThumbnailSize, TSize( xSize, ySize ),
- KGridAndListThumbnailCropped, static_cast (raw_mode), format, autoCreate ));
-
- User::LeaveIfError( iRepository->Get( KSizeVideoFullscreenWidth, xSize ));
- User::LeaveIfError( iRepository->Get( KSizeVideoFullscreenHeight, ySize ));
- User::LeaveIfError( iRepository->Get( KAutoCreateVideoFullscreen, autoCreate ));
-
- iPersistentSizes.AppendL( TThumbnailPersistentSize( EVideoFullScreenThumbnailSize, TSize( xSize, ySize ),
- flags, static_cast (raw_mode), format, autoCreate ));
-
- User::LeaveIfError( iRepository->Get( KSizeAudioGridWidth, xSize ));
- User::LeaveIfError( iRepository->Get( KSizeAudioGridHeight, ySize ));
- User::LeaveIfError( iRepository->Get( KAutoCreateAudioGrid, autoCreate ));
-
- iPersistentSizes.AppendL( TThumbnailPersistentSize( EAudioGridThumbnailSize, TSize( xSize, ySize ),
- KGridAndListThumbnailCropped, static_cast (raw_mode), format, autoCreate ));
-
- User::LeaveIfError( iRepository->Get( KSizeAudioListWidth, xSize ));
- User::LeaveIfError( iRepository->Get( KSizeAudioListHeight, ySize ));
- User::LeaveIfError( iRepository->Get( KAutoCreateAudioList, autoCreate ));
-
- iPersistentSizes.AppendL( TThumbnailPersistentSize( EAudioListThumbnailSize, TSize( xSize, ySize ),
- KGridAndListThumbnailCropped, static_cast (raw_mode), format, autoCreate ));
-
- User::LeaveIfError( iRepository->Get( KSizeAudioFullscreenWidth, xSize ));
- User::LeaveIfError( iRepository->Get( KSizeAudioFullscreenHeight, ySize ));
- User::LeaveIfError( iRepository->Get( KAutoCreateAudioFullscreen, autoCreate ));
-
- iPersistentSizes.AppendL( TThumbnailPersistentSize( EAudioFullScreenThumbnailSize, TSize( xSize, ySize ),
- flags, static_cast (raw_mode), format, autoCreate ));
-
- User::LeaveIfError( iRepository->Get( KSizeContactGridWidth, xSize ));
- User::LeaveIfError( iRepository->Get( KSizeContactGridHeight, ySize ));
- User::LeaveIfError( iRepository->Get( KAutoCreateContactGrid, autoCreate ));
-
- iPersistentSizes.AppendL( TThumbnailPersistentSize( EContactGridThumbnailSize, TSize( xSize, ySize ),
- KGridAndListThumbnailCropped, static_cast (raw_mode), format, autoCreate ));
-
- User::LeaveIfError( iRepository->Get( KSizeContactListWidth, xSize ));
- User::LeaveIfError( iRepository->Get( KSizeContactListHeight, ySize ));
- User::LeaveIfError( iRepository->Get( KAutoCreateContactList, autoCreate ));
-
- iPersistentSizes.AppendL( TThumbnailPersistentSize( EContactListThumbnailSize, TSize( xSize, ySize ),
- KGridAndListThumbnailCropped, static_cast (raw_mode), format, autoCreate ));
-
- User::LeaveIfError( iRepository->Get( KSizeContactFullscreenWidth, xSize ));
- User::LeaveIfError( iRepository->Get( KSizeContactFullscreenHeight, ySize ));
- User::LeaveIfError( iRepository->Get( KAutoCreateContactFullscreen, autoCreate ));
-
- iPersistentSizes.AppendL( TThumbnailPersistentSize( EContactFullScreenThumbnailSize, TSize( xSize, ySize ),
- flags, static_cast (raw_mode), format, autoCreate ));
-
- iAutoCreate = new (ELeave) TThumbnailAutoCreate();
-
- User::LeaveIfError( iRepository->Get( KAutoCreateImageGrid, iAutoCreate->iImageGrid ));
- User::LeaveIfError( iRepository->Get( KAutoCreateImageList, iAutoCreate->iImageList ));
- User::LeaveIfError( iRepository->Get( KAutoCreateImageFullscreen, iAutoCreate->iImageFullscreen ));
- User::LeaveIfError( iRepository->Get( KAutoCreateVideoGrid, iAutoCreate->iVideoGrid ));
- User::LeaveIfError( iRepository->Get( KAutoCreateVideoList, iAutoCreate->iVideoList ));
- User::LeaveIfError( iRepository->Get( KAutoCreateVideoFullscreen, iAutoCreate->iVideoFullscreen ));
- User::LeaveIfError( iRepository->Get( KAutoCreateAudioGrid, iAutoCreate->iAudioGrid ));
- User::LeaveIfError( iRepository->Get( KAutoCreateAudioList, iAutoCreate->iAudioList ));
- User::LeaveIfError( iRepository->Get( KAutoCreateAudioFullscreen, iAutoCreate->iAudioFullscreen ));
- User::LeaveIfError( iRepository->Get( KAutoCreateContactGrid, iAutoCreate->iContactGrid ));
- User::LeaveIfError( iRepository->Get( KAutoCreateContactList, iAutoCreate->iContactList ));
- User::LeaveIfError( iRepository->Get( KAutoCreateContactFullscreen, iAutoCreate->iContactFullscreen ));
- }
-
-// ---------------------------------------------------------------------------
-// CThumbnailCenRep::GetPersistentSizes()
-// ---------------------------------------------------------------------------
-//
-RArray < TThumbnailPersistentSize > & CThumbnailCenRep::GetPersistentSizes()
- {
- return iPersistentSizes;
- }
-
-// ---------------------------------------------------------------------------
-// CThumbnailCenRep::GetAutoCreateParams()
-// ---------------------------------------------------------------------------
-//
-TThumbnailAutoCreate & CThumbnailCenRep::GetAutoCreateParams()
- {
- return *iAutoCreate;
- }
-
-TThumbnailPersistentSize & CThumbnailCenRep::PersistentSizeL( TThumbnailSize
- aThumbnailSize )
- {
- TThumbnailPersistentSize* persistentSize = NULL;
- TInt i = iPersistentSizes.Count();
- for ( ; --i >= 0; )
- {
- persistentSize = &iPersistentSizes[i];
- if ( persistentSize->iType == aThumbnailSize )
- {
- break;
- }
- }
- if ( i < 0 )
- { // size not found
- User::Leave( KErrNotFound );
- }
-
- return *persistentSize;
- }
-
-// End of file
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlinglib/BWINS/IHLu.def
--- a/imagehandlinglib/BWINS/IHLu.def Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-EXPORTS
- ?CopyBitmapL@IHLBitmapUtil@@SAPAVCFbsBitmap@@ABV2@@Z @ 1 NONAME ; class CFbsBitmap * IHLBitmapUtil::CopyBitmapL(class CFbsBitmap const &)
- ?CopyBitmapL@IHLBitmapUtil@@SAPAVCFbsBitmap@@ABV2@ABVTRect@@@Z @ 2 NONAME ; class CFbsBitmap * IHLBitmapUtil::CopyBitmapL(class CFbsBitmap const &, class TRect const &)
- ?CopyBitmapLC@IHLBitmapUtil@@SAPAVCFbsBitmap@@ABV2@@Z @ 3 NONAME ; class CFbsBitmap * IHLBitmapUtil::CopyBitmapLC(class CFbsBitmap const &)
- ?CopyBitmapLC@IHLBitmapUtil@@SAPAVCFbsBitmap@@ABV2@ABVTRect@@@Z @ 4 NONAME ; class CFbsBitmap * IHLBitmapUtil::CopyBitmapLC(class CFbsBitmap const &, class TRect const &)
- ?CreateBitmapProcessorL@IHLProcessorFactory@@SAPAVMIHLBitmapProcessor@@K@Z @ 5 NONAME ; class MIHLBitmapProcessor * IHLProcessorFactory::CreateBitmapProcessorL(unsigned long)
- ?CreateImageViewerL@IHLViewerFactory@@SAPAVMIHLImageViewer@@ABVTSize@@AAVMIHLImage@@AAVMIHLBitmap@@AAVMIHLViewerObserver@@K@Z @ 6 NONAME ; class MIHLImageViewer * IHLViewerFactory::CreateImageViewerL(class TSize const &, class MIHLImage &, class MIHLBitmap &, class MIHLViewerObserver &, unsigned long)
- ?CreateL@IHLBitmap@@SAPAVMIHLBitmap@@XZ @ 7 NONAME ; class MIHLBitmap * IHLBitmap::CreateL(void)
- ?CreateL@IHLScaler@@SAPAVMIHLScaler@@K@Z @ 8 NONAME ; class MIHLScaler * IHLScaler::CreateL(unsigned long)
- ?DuplicateBitmapL@IHLBitmapUtil@@SAPAVCFbsBitmap@@ABV2@@Z @ 9 NONAME ; class CFbsBitmap * IHLBitmapUtil::DuplicateBitmapL(class CFbsBitmap const &)
- ?DuplicateBitmapLC@IHLBitmapUtil@@SAPAVCFbsBitmap@@ABV2@@Z @ 10 NONAME ; class CFbsBitmap * IHLBitmapUtil::DuplicateBitmapLC(class CFbsBitmap const &)
- ?OpenFileImageL@IHLImageFactory@@SAPAVMIHLFileImage@@AAVRFile@@@Z @ 11 NONAME ; class MIHLFileImage * IHLImageFactory::OpenFileImageL(class RFile &)
- ?OpenFileImageL@IHLImageFactory@@SAPAVMIHLFileImage@@AAVRFile@@H@Z @ 12 NONAME ; class MIHLFileImage * IHLImageFactory::OpenFileImageL(class RFile &, int)
- ?OpenFileImageL@IHLImageFactory@@SAPAVMIHLFileImage@@AAVRFs@@ABVTDesC16@@@Z @ 13 NONAME ; class MIHLFileImage * IHLImageFactory::OpenFileImageL(class RFs &, class TDesC16 const &)
- ?OpenFileImageL@IHLImageFactory@@SAPAVMIHLFileImage@@AAVRFs@@ABVTDesC16@@H@Z @ 14 NONAME ; class MIHLFileImage * IHLImageFactory::OpenFileImageL(class RFs &, class TDesC16 const &, int)
- ?ScaleBitmap@IHLBitmapUtil@@SAHABVCFbsBitmap@@AAV2@K@Z @ 15 NONAME ; int IHLBitmapUtil::ScaleBitmap(class CFbsBitmap const &, class CFbsBitmap &, unsigned long)
- ?ScaleBitmap@IHLBitmapUtil@@SAHABVCFbsBitmap@@ABVTRect@@AAV2@1K@Z @ 16 NONAME ; int IHLBitmapUtil::ScaleBitmap(class CFbsBitmap const &, class TRect const &, class CFbsBitmap &, class TRect const &, unsigned long)
- ?OpenFileImageL@IHLImageFactory@@SAPAVMIHLFileImage@@AAVRFile@@HK@Z @ 17 NONAME ; class MIHLFileImage * IHLImageFactory::OpenFileImageL(class RFile &, int, unsigned long)
- ?OpenFileImageL@IHLImageFactory@@SAPAVMIHLFileImage@@AAVRFs@@ABVTDesC16@@HK@Z @ 18 NONAME ; class MIHLFileImage * IHLImageFactory::OpenFileImageL(class RFs &, class TDesC16 const &, int, unsigned long)
- ?OpenBufferedFileImageL@IHLImageFactory@@SAPAVMIHLFileImage@@AAVRFs@@ABVTDesC8@@@Z @ 19 NONAME ; class MIHLFileImage * IHLImageFactory::OpenBufferedFileImageL(class RFs &, class TDesC8 const &)
- ?OpenBufferedFileImageL@IHLImageFactory@@SAPAVMIHLFileImage@@AAVRFs@@ABVTDesC8@@H@Z @ 20 NONAME ; class MIHLFileImage * IHLImageFactory::OpenBufferedFileImageL(class RFs &, class TDesC8 const &, int)
- ?OpenBufferedFileImageL@IHLImageFactory@@SAPAVMIHLFileImage@@AAVRFs@@ABVTDesC8@@HK@Z @ 21 NONAME ; class MIHLFileImage * IHLImageFactory::OpenBufferedFileImageL(class RFs &, class TDesC8 const &, int, unsigned long)
-
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlinglib/Group/IHL.mmp
--- a/imagehandlinglib/Group/IHL.mmp Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
-* Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Image Handling Library project file.*
-*/
-
-
-#include
-
-TARGET IHL.dll
-TARGETTYPE dll
-UID 0x1000008D 0x101f4d90 // Image Viewer uid
-CAPABILITY CAP_GENERAL_DLL
-VENDORID VID_DEFAULT
-
-OPTION ARMCC --cpu 6
-
-SOURCEPATH ../Src
-
-SOURCE IHLBitmapUtil.cpp
-SOURCE CIHLScaler.cpp
-SOURCE CIHLBitmap.cpp
-
-SOURCE IHLImageFactory.cpp
-SOURCE CIHLFileImage.cpp
-SOURCE CIHLFileImageExtJpg.cpp
-
-SOURCE IHLProcessorFactory.cpp
-SOURCE CIHLBitmapProcessor.cpp
-
-SOURCE IHLViewerFactory.cpp
-SOURCE CIHLImageViewer.cpp
-SOURCE CIHLImageViewerExtJpg.cpp
-
-USERINCLUDE .
-USERINCLUDE ../Src
-USERINCLUDE ../Inc // subsystem level inc dir
-USERINCLUDE ../../inc // ADo level inc dir
-
-// Default system include paths for middleware layer modules.
-MW_LAYER_SYSTEMINCLUDE
-SYSTEMINCLUDE /epoc32/include/icl
-
-
-LIBRARY euser.lib
-LIBRARY fbscli.lib
-LIBRARY bitgdi.lib
-LIBRARY ImageConversion.lib
-LIBRARY efsrv.lib
-LIBRARY CAF.lib
-LIBRARY IclExtJpegApi.lib
-LIBRARY hal.lib
-
-//Remove comment to enable debug print
-//MACRO IHL_ENABLE_DEBUG_PRINT
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlinglib/Group/bld.inf
--- a/imagehandlinglib/Group/bld.inf Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
-* Copyright (c) 2004-2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: This file provides the information required for building.*
-*/
-
-#include
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-// export iby file
-../Rom/Ihl.iby CORE_MW_LAYER_IBY_EXPORT_PATH( Ihl.iby )
-
-PRJ_MMPFILES
-
-IHL.mmp
-
-PRJ_TESTMMPFILES
-// specify the .mmp files required for building any test programs here
-//
-// You can specify "manual" to denote that a test should be listed in a
-// generated batch file for running a group of tests
-// which require user input during testing.
-// You can specify "support" to denote that a file is a test support file
-// and shouldn't be listed in a batch file for running a group of tests
-// By default, each test will be listed in a batch file for running a group
-// of tests which can be left to run without requiring watching over
-// by the person running the tests, i.e. tests where no user
-// input is required. The default will apply if neither "manual"
-// or "support" is specified.
-// Example:
-
-// ../tsrc/IHLValidation.mmp
-
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlinglib/Rom/Ihl.iby
--- a/imagehandlinglib/Rom/Ihl.iby Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/*
-* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: IBY file for Image Handling Library
-*
-*/
-
-
-#ifndef IMAGEHANDLINGLIBRARY_IBY
-#define IMAGEHANDLINGLIBRARY_IBY
-
-file=ABI_DIR\BUILD_DIR\Ihl.dll SHARED_LIB_DIR\Ihl.dll
-
-#endif // IMAGEHANDLINGLIBRARY_IBY
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlinglib/Src/CIHLBitmap.cpp
--- a/imagehandlinglib/Src/CIHLBitmap.cpp Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,371 +0,0 @@
-/*
-* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Default implementation of bitmap class.
-*
-*/
-
-
-// INCLUDE FILES
-#include "CIHLBitmap.h"
-#include
-
-// ======================== STATIC FACTORY FUNCTIONS ===========================
-// -----------------------------------------------------------------------------
-// IHLBitmap::CreateL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C MIHLBitmap* IHLBitmap::CreateL()
- {
- return CIHLBitmap::NewL();
- }
-
-// ============================ MEMBER FUNCTIONS ===============================
-// -----------------------------------------------------------------------------
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-CIHLBitmap::CIHLBitmap()
- {
- }
-
-// -----------------------------------------------------------------------------
-//
-// Second phase constructors. Can leave.
-// -----------------------------------------------------------------------------
-void CIHLBitmap::ConstructL()
- {
- iBitmap = new (ELeave) CFbsBitmap;
- iMask = new (ELeave) CFbsBitmap;
- }
-
-// -----------------------------------------------------------------------------
-//
-// Two-phased constructors.
-// -----------------------------------------------------------------------------
-CIHLBitmap* CIHLBitmap::NewL()
- {
- CIHLBitmap* self = new( ELeave ) CIHLBitmap;
- CleanupStack::PushL( self );
- self->ConstructL();
- CleanupStack::Pop(); // self
- return self;
- }
-
-// -----------------------------------------------------------------------------
-// Destructor
-// -----------------------------------------------------------------------------
-CIHLBitmap::~CIHLBitmap()
- {
- delete iBitmap;
- delete iMask;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLBitmap::Create
-// -----------------------------------------------------------------------------
-TInt CIHLBitmap::Create( const TSize& aSize, TDisplayMode aDisplayMode )
- {
- Reset();
- return iBitmap->Create( aSize, aDisplayMode );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLBitmap::Create
-// -----------------------------------------------------------------------------
-TInt CIHLBitmap::Create( const TSize& aSize, TDisplayMode aBitmapDisplayMode,
- TDisplayMode aMaskDisplayMode )
- {
- Reset();
- TInt err( KErrArgument );
- if( aMaskDisplayMode == EGray2 || aMaskDisplayMode == EGray256 )
- {
- err = iBitmap->Create( aSize, aBitmapDisplayMode );
- if( err )
- {
- return err;
- }
- err = iMask->Create( aSize, aMaskDisplayMode );
- if( err )
- {
- iBitmap->Reset();
- }
- }
- return err;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLBitmap::Copy
-// -----------------------------------------------------------------------------
-TInt CIHLBitmap::Copy( const CFbsBitmap& aBitmap, TBool aDuplicate )
- {
- Reset();
- TInt err( KErrNone );
- TInt bitmapHandle( aBitmap.Handle() );
- if( bitmapHandle )
- {
- if( aDuplicate )
- {
- err = iBitmap->Duplicate( bitmapHandle );
- }
- else
- {
- err = CopyBitmap( aBitmap, *iBitmap );
- }
- }
- return err;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLBitmap::Copy
-// -----------------------------------------------------------------------------
-TInt CIHLBitmap::Copy( const CFbsBitmap& aBitmap, const CFbsBitmap& aMask, TBool aDuplicate )
- {
- Reset();
- TInt bitmapHandle( aBitmap.Handle() );
- TInt maskHandle( aMask.Handle() );
- if( bitmapHandle && maskHandle &&
- aBitmap.SizeInPixels() != aMask.SizeInPixels() )
- {
- return KErrArgument;
- }
-
- if( maskHandle )
- {
- switch( aMask.DisplayMode() )
- {
- case EGray2:
- case EGray256:
- {
- break;
- }
- default:
- {
- return KErrArgument;
- }
- }
- }
-
- TInt err( KErrNone );
- if( bitmapHandle )
- {
- if( aDuplicate )
- {
- err = iBitmap->Duplicate( bitmapHandle );
- }
- else
- {
- err = CopyBitmap( aBitmap, *iBitmap );
- }
- }
-
- if( !err && maskHandle )
- {
- if( aDuplicate )
- {
- err = iMask->Duplicate( maskHandle );
- }
- else
- {
- err = CopyBitmap( aMask, *iMask );
- }
- if( err )
- {
- iBitmap->Reset();
- }
- }
- return err;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLBitmap::Copy
-// -----------------------------------------------------------------------------
-TInt CIHLBitmap::Copy( const MIHLBitmap& aBitmap, TBool aDuplicate )
- {
- return Copy( aBitmap.Bitmap(), aBitmap.Mask(), aDuplicate );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLBitmap::Reset
-// -----------------------------------------------------------------------------
-void CIHLBitmap::Reset()
- {
- iBitmap->Reset();
- iMask->Reset();
- iEditorPtr = NULL;
- iEditorValue = 0;
- }
-
-
-// -----------------------------------------------------------------------------
-// CIHLBitmap::IsCreated
-// -----------------------------------------------------------------------------
-TBool CIHLBitmap::IsCreated() const
- {
- return ( iBitmap->Handle() != 0 );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLBitmap::Bitmap
-// -----------------------------------------------------------------------------
-const CFbsBitmap& CIHLBitmap::Bitmap() const
- {
- return *iBitmap;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLBitmap::HasMask
-// -----------------------------------------------------------------------------
-TBool CIHLBitmap::HasMask() const
- {
- return ( iMask->Handle() != 0 );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLBitmap::Mask
-// -----------------------------------------------------------------------------
-const CFbsBitmap& CIHLBitmap::Mask() const
- {
- return *iMask;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLBitmap::Draw
-// -----------------------------------------------------------------------------
-void CIHLBitmap::Draw( CBitmapContext& aContext, const TPoint& aPoint ) const
- {
- if( iBitmap->Handle() )
- {
- if( iMask->Handle() )
- {
- aContext.BitBltMasked( aPoint, iBitmap, iBitmap->SizeInPixels(), iMask, EFalse );
- }
- else
- {
- aContext.BitBlt( aPoint, iBitmap, iBitmap->SizeInPixels() );
- }
- }
- }
-
-// -----------------------------------------------------------------------------
-// CIHLBitmap::Draw
-// -----------------------------------------------------------------------------
-void CIHLBitmap::Draw( CBitmapContext& aContext, const TPoint& aPoint,
- const TRect& aSourceRect ) const
- {
- if( iBitmap->Handle() )
- {
- if( iMask->Handle() )
- {
- aContext.BitBltMasked( aPoint, iBitmap, aSourceRect, iMask, EFalse );
- }
- else
- {
- aContext.BitBlt( aPoint, iBitmap, aSourceRect );
- }
- }
- }
-
-// Internal interface
-// -----------------------------------------------------------------------------
-// CIHLBitmap::SetFilename
-// -----------------------------------------------------------------------------
-CFbsBitmap& CIHLBitmap::BitmapModifyable()
- {
- return *iBitmap;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLBitmap::SetFilename
-// -----------------------------------------------------------------------------
-CFbsBitmap& CIHLBitmap::MaskModifyable()
- {
- return *iMask;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLBitmap::SetEditorPtr
-// -----------------------------------------------------------------------------
-void CIHLBitmap::SetEditorPtr( const TAny* aEditorPtr )
- {
- iEditorPtr = aEditorPtr;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLBitmap::SetEditorValue
-// -----------------------------------------------------------------------------
-void CIHLBitmap::SetEditorValue( TInt aEditorValue )
- {
- iEditorValue = aEditorValue;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLBitmap::EditorPtr
-// -----------------------------------------------------------------------------
-const TAny* CIHLBitmap::EditorPtr() const
- {
- return iEditorPtr;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLBitmap::FrameIndex
-// -----------------------------------------------------------------------------
-TInt CIHLBitmap::EditorValue() const
- {
- return iEditorValue;
- }
-
-// Private methods
-// -----------------------------------------------------------------------------
-// CIHLBitmap::CopyBitmap
-// -----------------------------------------------------------------------------
-TInt CIHLBitmap::CopyBitmap( const CFbsBitmap& aSource, CFbsBitmap& aDestination )
- {
- TSize size( aSource.SizeInPixels() );
- TDisplayMode displayMode( aSource.DisplayMode() );
- TInt err( aDestination.Create( size, displayMode ) );
- if( !err )
- {
- err = CopyBitmapData( aSource, aDestination, size, displayMode );
- if( err )
- {
- aDestination.Reset();
- }
- }
- return err;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLBitmap::CopyBitmapData
-// -----------------------------------------------------------------------------
-TInt CIHLBitmap::CopyBitmapData( const CFbsBitmap& aSource, CFbsBitmap& aDestination,
- const TSize& aSize, const TDisplayMode& aDisplayMode )
- {
- HBufC8* scanLine = HBufC8::New( aSource.ScanLineLength( aSize.iWidth, aDisplayMode ) );
- if( scanLine )
- {
- TPtr8 scanPtr( scanLine->Des() );
- TPoint pp;
- for( pp.iY = 0; pp.iY < aSize.iHeight; ++pp.iY )
- {
- aSource.GetScanLine( scanPtr, pp, aSize.iWidth, aDisplayMode );
- aDestination.SetScanLine( scanPtr, pp.iY );
- }
-
- delete scanLine;
- return KErrNone;
- }
- return KErrNoMemory; // scanLine alloc failed
- }
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlinglib/Src/CIHLBitmap.h
--- a/imagehandlinglib/Src/CIHLBitmap.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,184 +0,0 @@
-/*
-* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Default implementation of bitmap class.
-*
-*/
-
-
-#ifndef CIHLBITMAP_H
-#define CIHLBITMAP_H
-
-// INCLUDES
-#include
-#include
-
-// CLASS DECLARATION
-/**
-* CIHLBitmap
-*
-* Default implementation of bitmap class.
-* @lib IHL.lib
-* @since 3.0
-*/
-NONSHARABLE_CLASS( CIHLBitmap ) : public CBase, public MIHLBitmap
- {
- public: // Constructors and destructor
-
- /**
- * Two-phased constructors
- */
- static CIHLBitmap* NewL();
-
- /**
- * Virtual destructor.
- */
- virtual ~CIHLBitmap();
-
- public: // From base class MIHLBitmap
-
- /**
- * From MIHLBitmap, see base class header.
- */
- TInt Create( const TSize& aSize, TDisplayMode aDisplayMode );
-
- /**
- * From MIHLBitmap, see base class header.
- */
- TInt Create( const TSize& aSize, TDisplayMode aBitmapDisplayMode,
- TDisplayMode aMaskDisplayMode );
-
- /**
- * From MIHLBitmap, see base class header.
- */
- TInt Copy( const CFbsBitmap& aBitmap, TBool aDuplicate );
-
- /**
- * From MIHLBitmap, see base class header.
- */
- TInt Copy( const CFbsBitmap& aBitmap, const CFbsBitmap& aMask, TBool aDuplicate );
-
- /**
- * From MIHLBitmap, see base class header.
- */
- TInt Copy( const MIHLBitmap& aBitmap, TBool aDuplicate );
-
- /**
- * From MIHLBitmap, see base class header.
- */
- void Reset();
-
- /**
- * From MIHLBitmap, see base class header.
- */
- TBool IsCreated() const;
-
- /**
- * From MIHLBitmap, see base class header.
- */
- const CFbsBitmap& Bitmap() const;
-
- /**
- * From MIHLBitmap, see base class header.
- */
- TBool HasMask() const;
-
- /**
- * From MIHLBitmap, see base class header.
- */
- const CFbsBitmap& Mask() const;
-
- /**
- * From MIHLBitmap, see base class header.
- */
- void Draw( CBitmapContext& aContext, const TPoint& aPoint ) const;
-
- /**
- * From MIHLBitmap, see base class header.
- */
- void Draw( CBitmapContext& aContext, const TPoint& aPoint, const TRect& aSourceRect ) const;
-
- public: // Internal interface
-
- /**
- * Non-const bitmap reference.
- * @since 3.0
- * @return Non-const bitmap reference.
- */
- CFbsBitmap& BitmapModifyable();
-
- /**
- * Non-const bitmap reference.
- * @since 3.0
- * @return Non-const bitmap reference.
- */
- CFbsBitmap& MaskModifyable();
-
- /**
- * Set editor pointer. This information is used
- * internally to detect what class has made changes to bitmap data.
- * @since 3.0
- * @param aEditorPtr Editor pointer
- */
- void SetEditorPtr( const TAny* aEditorPtr );
-
- /**
- * Set editor value. Meaning of this value may vary depending
- * on type of editor class.
- * @since 3.0
- * @param aEditorValue Editor custom value
- */
- void SetEditorValue( TInt aEditorValue );
-
- /**
- * Return Editor pointer. NULL if just created or reseted.
- * @return Editor pointer.
- */
- const TAny* EditorPtr() const;
-
- /**
- * Return editor value.
- * @since 3.0
- * @return Editor custom value.
- */
- TInt EditorValue() const;
-
- public: // Private methods
-
- TInt CopyBitmap( const CFbsBitmap& aSource, CFbsBitmap& aDestination );
-
- TInt CopyBitmapData( const CFbsBitmap& aSource, CFbsBitmap& aDestination,
- const TSize& aSize, const TDisplayMode& aDisplayMode );
-
- private: // Private constructors
-
- CIHLBitmap();
- void ConstructL();
-
- private: // Data
-
- // Own: Bitmap pointers
- CFbsBitmap* iBitmap;
- CFbsBitmap* iMask;
-
- // Ref: Editor ptr
- const TAny* iEditorPtr;
-
- // Editor value
- TInt iEditorValue;
-
- };
-
-#endif // CIHLBITMAP_H
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlinglib/Src/CIHLBitmapProcessor.cpp
--- a/imagehandlinglib/Src/CIHLBitmapProcessor.cpp Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,293 +0,0 @@
-/*
-* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of scaling processor
-* : using MIHLBitmap type bitmaps.
-*
-*/
-
-
-
-// INCLUDE FILES
-#include "CIHLBitmapProcessor.h"
-
-#include "CIHLScaler.h"
-#include "CIHLBitmap.h"
-#include "IHLImplementationIds.h"
-#include "IHLDebugPrint.h" // Debug print
-
-#include
-#include // CFbsBitmap
-#include // CFbsBitmapDevice, CFbsBitGc
-
-// Private namespace for constants and functions
-namespace
- {
- // Panic function
- _LIT( KIHLPanicString, "IHLBitmapProcessor" );
- void Panic( TInt aPanicCode ) { User::Panic( KIHLPanicString, aPanicCode ); }
- }
-
-// ============================ MEMBER FUNCTIONS ===============================
-// -----------------------------------------------------------------------------
-//
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-CIHLBitmapProcessor::CIHLBitmapProcessor()
-:CActive( CActive::EPriorityStandard )
- {
- CActiveScheduler::Add( this );
- }
-
-// -----------------------------------------------------------------------------
-//
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-CIHLBitmapProcessor* CIHLBitmapProcessor::NewL( const TUint32 aOptions )
- {
- CIHLBitmapProcessor* self = new( ELeave ) CIHLBitmapProcessor();
- CleanupStack::PushL( self );
- self->ConstructL( aOptions );
- CleanupStack::Pop(); // self
- return self;
- }
-
-// -----------------------------------------------------------------------------
-//
-// Symbian constructor can leave.
-// -----------------------------------------------------------------------------
-void CIHLBitmapProcessor::ConstructL( const TUint32 aOptions )
- {
- iScaler = CIHLScaler::NewL( aOptions );
- }
-
-// -----------------------------------------------------------------------------
-// Destructor
-// -----------------------------------------------------------------------------
-CIHLBitmapProcessor::~CIHLBitmapProcessor()
- {
- Cancel();
- delete iScaler;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLBitmapProcessor::Type
-// -----------------------------------------------------------------------------
-TIHLInterfaceType CIHLBitmapProcessor::Type() const
- {
- return TIHLInterfaceType( KIHLInterfaceIdBitmapProcessor, KIHLImplementationIdBitmapProcessor );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLBitmapProcessor::Process
-// -----------------------------------------------------------------------------
-TInt CIHLBitmapProcessor::Process( TRequestStatus& aStatus,
- const MIHLBitmap& aSrcBitmap,
- const TRect& aSrcRect,
- MIHLBitmap& aDstBitmap,
- const TRect& aDstRect )
- {
- if( IsBusy() )
- {
- return KErrNotReady;
- }
-
- // Check bitmaps (no checking of masks is needed)
- const CFbsBitmap& srcBitmap = aSrcBitmap.Bitmap();
- const CFbsBitmap& dstBitmap = aDstBitmap.Bitmap();
- if( !srcBitmap.Handle() ||
- !iScaler->IsValidRect( srcBitmap.SizeInPixels(), aSrcRect ) ||
- !dstBitmap.Handle() ||
- !iScaler->IsValidRect( dstBitmap.SizeInPixels(), aDstRect ) )
- {
- return KErrArgument;
- }
-
- IHL_DEBUG1( KIHLDebug, "IHL - CIHLBitmapProcessor - Start asynchronous bitmap processing" );
-
- // Set references to member data
- iSrcBitmap = &aSrcBitmap;
- iSrcRect = aSrcRect;
- iDstBitmap = static_cast( &aDstBitmap ); //lint !e826
- iDstRect = aDstRect;
-
- // Start processing
- iProcessorStatus = &aStatus;
- *iProcessorStatus = KRequestPending;
-
- iProcessorState = EProcessBitmap;
- SelfComplete();
- return KErrNone;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLBitmapProcessor::IsBusy
-// -----------------------------------------------------------------------------
-TBool CIHLBitmapProcessor::IsBusy() const
- {
- return ( iProcessorState != EInactive );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLBitmapProcessor::CancelProcess
-// -----------------------------------------------------------------------------
-void CIHLBitmapProcessor::CancelProcess()
- {
- IHL_DEBUG1( KIHLDebug, "IHL - CIHLBitmapProcessor - Process cancelled" );
-
- Cancel();
- }
-
-// -----------------------------------------------------------------------------
-// CIHLBitmapProcessor::SetFilter
-// -----------------------------------------------------------------------------
-void CIHLBitmapProcessor::SetFilter( MIHFilter* /*aFilter*/ )
- {
- // Not in use
- }
-
-// -----------------------------------------------------------------------------
-// CIHLBitmapProcessor::DoCancel
-// -----------------------------------------------------------------------------
-void CIHLBitmapProcessor::DoCancel()
- {
- iScaler->CancelProcess();
- iProcessorState = EInactive;
- RequestComplete( KErrCancel );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLBitmapProcessor::RunL
-// -----------------------------------------------------------------------------
-void CIHLBitmapProcessor::RunL()
- {
- User::LeaveIfError( iStatus.Int() );
-
- switch( iProcessorState )
- {
- case EProcessBitmap:
- {
- ProcessBitmapL();
- if( iDstBitmap->Mask().Handle() )
- {
- iProcessorState = EProcessMask;
- }
- else
- {
- // Destination has no mask -> finish process
- iProcessorState = EFinish;
- }
- break;
- }
- case EProcessMask:
- {
- ProcessMaskL();
- iProcessorState = EFinish;
- break;
- }
- case EFinish:
- {
- IHL_DEBUG1( KIHLDebug, "IHL - CIHLBitmapProcessor - Process complete!" );
-
- iProcessorState = EInactive;
- RequestComplete( KErrNone );
- break;
- }
- default:
- {
- Panic( KErrTotalLossOfPrecision );
- }
- }
- }
-
-// -----------------------------------------------------------------------------
-// CIHLBitmapProcessor::RunError
-// -----------------------------------------------------------------------------
-TInt CIHLBitmapProcessor::RunError( TInt aError )
- {
- IHL_DEBUG2( KIHLDebug, "IHL - CIHLBitmapProcessor - Processing error: %d", aError );
-
- iProcessorState = EInactive;
- RequestComplete( aError );
- return KErrNone;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLBitmapProcessor::ProcessBitmapL
-// -----------------------------------------------------------------------------
-void CIHLBitmapProcessor::ProcessBitmapL()
- {
- User::LeaveIfError( iScaler->Scale( iStatus,
- iSrcBitmap->Bitmap(),
- iSrcRect,
- iDstBitmap->BitmapModifyable(),
- iDstRect ) );
- SetActive();
- }
-
-// -----------------------------------------------------------------------------
-// CIHLBitmapProcessor::ProcessMaskL
-// -----------------------------------------------------------------------------
-void CIHLBitmapProcessor::ProcessMaskL()
- {
- if( iSrcBitmap->Mask().Handle() )
- {
- User::LeaveIfError( iScaler->Scale( iStatus,
- iSrcBitmap->Mask(),
- iSrcRect,
- iDstBitmap->MaskModifyable(),
- iDstRect ) );
- SetActive();
- }
- else
- {
- // No source bitmap where mask can be copied
- // -> clear destination mask at given rectangle
- CFbsBitGc* bitGc;
- CFbsBitmapDevice* bitDev = CFbsBitmapDevice::NewL(
- &(iDstBitmap->BitmapModifyable()) );
- CleanupStack::PushL( bitDev );
- User::LeaveIfError( bitDev->CreateContext( bitGc ) );
- CleanupStack::PushL( bitGc );
-
- bitGc->SetPenColor( KRgbWhite ); // white is non-transparent
- bitGc->SetBrushColor( KRgbWhite );
- bitGc->SetBrushStyle( CGraphicsContext::ESolidBrush );
- bitGc->DrawRect( iDstRect );
-
- CleanupStack::PopAndDestroy( 2 ); // bitGc, bitDev
- }
- }
-
-// -----------------------------------------------------------------------------
-// CIHLBitmapProcessor::SelfComplete
-// -----------------------------------------------------------------------------
-void CIHLBitmapProcessor::SelfComplete()
- {
- SetActive();
- iStatus = KRequestPending;
- TRequestStatus* status = &iStatus;
- User::RequestComplete( status, KErrNone );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLBitmapProcessor::RequestComplete
-// -----------------------------------------------------------------------------
-void CIHLBitmapProcessor::RequestComplete( TInt aReason )
- {
- ASSERT( iProcessorStatus );
- User::RequestComplete( iProcessorStatus, aReason );
- }
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlinglib/Src/CIHLBitmapProcessor.h
--- a/imagehandlinglib/Src/CIHLBitmapProcessor.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,167 +0,0 @@
-/*
-* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of scaling processor
-* : using MIHLBitmap type bitmaps.
-*
-*/
-
-
-#ifndef CIHLBITMAPPROCESSOR_H
-#define CIHLBITMAPPROCESSOR_H
-
-// INCLUDES
-#include
-#include
-
-// FORWARD DECLARATIONS
-class CIHLScaler;
-class CIHLBitmap;
-
-// CLASS DECLARATION
-/**
-* CIHLBitmapProcessor
-*
-* Implementation of scaling processor
-* using MIHLBitmap type bitmaps.
-* @lib IHL.lib
-* @since 3.0
-*/
-NONSHARABLE_CLASS( CIHLBitmapProcessor ) : public CActive,
- public MIHLBitmapProcessor
- {
- public: // Constructors and destructor
-
- /**
- * Two-phased constructor.
- */
- static CIHLBitmapProcessor* NewL( const TUint32 aOptions = 0 );
-
- /*
- * Virtual destructor.
- */
- virtual ~CIHLBitmapProcessor();
-
- public: // From base class MIHLProcessor
-
- /*
- * From MIHLProcessor, see base class header.
- */
- TIHLInterfaceType Type() const;
-
- public: // From base class MIHLBitmapProcessor
-
- /*
- * From MIHLBitmapProcessor, see base class header.
- */
- TInt Process( TRequestStatus& aStatus,
- const MIHLBitmap& aSrcBitmap,
- const TRect& aSrcRect,
- MIHLBitmap& aDstBitmap,
- const TRect& aDstRect );
-
- /*
- * From MIHLBitmapProcessor, see base class header.
- */
- TBool IsBusy() const;
-
- /*
- * From MIHLBitmapProcessor, see base class header.
- */
- void CancelProcess();
-
- /*
- * From MIHLBitmapProcessor, see base class header.
- */
- void SetFilter( MIHFilter* aFilter );
-
- private: // From base class CActive
-
- /*
- * From CActive, see base class header.
- */
- void DoCancel();
-
- /*
- * From CActive, see base class header.
- */
- void RunL();
-
- /*
- * From CActive, see base class header.
- */
- TInt RunError( TInt aError );
-
-
- private: // Private methods
-
- /*
- * Process bitmap part of source image
- */
- void ProcessBitmapL();
-
- /*
- * Process mask part of source image
- */
- void ProcessMaskL();
-
- /*
- * Set this active object to completed state
- * -> one process step (RunL) will be executed.
- */
- void SelfComplete();
-
- /*
- * Set client request to completed state
- * -> process complete.
- * @param aReason Request complete reason
- */
- void RequestComplete( TInt aReason );
-
- private: // Private constructors
-
- CIHLBitmapProcessor();
- void ConstructL( const TUint32 aOptions );
-
- private: // Private data types
-
- enum TProcessorState
- {
- EInactive,
- EProcessBitmap,
- EProcessMask,
- EFinish,
- };
-
- private: // Data
-
- // Ref: Process status & state
- TRequestStatus* iProcessorStatus;
- TProcessorState iProcessorState;
-
- // Ref: Source bitmap & rect
- const MIHLBitmap* iSrcBitmap;
- TRect iSrcRect;
-
- // Ref: Destination bitmap & rect
- CIHLBitmap* iDstBitmap;
- TRect iDstRect;
-
- // Own: Scaler
- CIHLScaler* iScaler;
-
- };
-
-#endif // CIHLBITMAPPROCESSOR_H
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlinglib/Src/CIHLFileImage.cpp
--- a/imagehandlinglib/Src/CIHLFileImage.cpp Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,992 +0,0 @@
-/*
-* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of Image class.
-*
-*/
-
-
-// INCLUDE FILES
-#include "CIHLFileImage.h"
-
-#include "CIHLBitmap.h"
-#include "IHLImplementationIds.h"
-#include "IHLDebugPrint.h" // Debug print
-#include
-
-// Private namespace for constants and functions
-namespace
- {
- // Fixed scale factors
- enum TScaleFactors
- {
- EFull = 1,
- EHalf = 2,
- EQuarter = 4,
- EEighth = 8,
- };
-
- // Panic function
- _LIT( KIHLPanicString, "IHLImage" );
- void Panic( TInt aPanicCode ) { User::Panic( KIHLPanicString, aPanicCode ); }
- }
-
-// ============================ MEMBER FUNCTIONS ===============================
-// -----------------------------------------------------------------------------
-//
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-CIHLFileImage::CIHLFileImage( TInt aImageIndex )
-:CActive( CActive::EPriorityStandard ),
-iImageIndex( aImageIndex )
- {
- CActiveScheduler::Add( this );
- }
-
-// -----------------------------------------------------------------------------
-//
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-CIHLFileImage* CIHLFileImage::NewL( RFile& aFile, TInt aImageIndex, const TUint32 aOptions )
- {
- CIHLFileImage* self = new (ELeave) CIHLFileImage( aImageIndex );
- CleanupStack::PushL( self );
- self->ConstructL( aFile, aOptions );
- CleanupStack::Pop(); // self
- return self;
- }
-
-CIHLFileImage* CIHLFileImage::NewL( RFs& aFs, const TDesC8& aDataBuf,
- TInt aImageIndex, const TUint32 aOptions )
- {
- CIHLFileImage* self = new (ELeave) CIHLFileImage( aImageIndex );
- CleanupStack::PushL( self );
- self->ConstructL( aFs, aDataBuf, aOptions );
- CleanupStack::Pop(); // self
- return self;
- }
-
-// -----------------------------------------------------------------------------
-//
-// Symbian constructor can leave.
-// -----------------------------------------------------------------------------
-void CIHLFileImage::ConstructL( RFile& aFile, const TUint32 aOptions )
- {
- TInt decoderOptions( CImageDecoder::EOptionNoDither | CImageDecoder::EOptionUseFrameSizeInPixels );
-
- // Open decoder
- IHL_DEBUG1( KIHLDebug1, "IHL - CIHLFileImage - Start create ICL image decoder" );
- if( aOptions & MIHLFileImage::EOptionNoDRMConsume )
- {
- iDecoder = CImageDecoder::FileNewL( aFile, ContentAccess::EPeek,
- (CImageDecoder::TOptions)decoderOptions );
- }
- else
- {
- iDecoder = CImageDecoder::FileNewL( aFile, ContentAccess::EView,
- (CImageDecoder::TOptions)decoderOptions );
- }
- ConstructCommonL();
- IHL_DEBUG1( KIHLDebug2, "IHL - CIHLFileImage - ICL image decoder ready!" );
- }
-
-void CIHLFileImage::ConstructL( RFs& aFs, const TDesC8& aDataBuf, const TUint32 /*aOptions*/ )
- {
- TInt decoderOptions( CImageDecoder::EOptionNoDither | CImageDecoder::EOptionUseFrameSizeInPixels );
-
- IHL_DEBUG1( KIHLDebug1, "IHL - CIHLFileImage - Start create buffered ICL image decoder" );
-
- iDecoder = CImageDecoder::DataNewL( aFs, aDataBuf, (CImageDecoder::TOptions)decoderOptions );
- ConstructCommonL();
-
- IHL_DEBUG1( KIHLDebug2, "IHL - CIHLFileImage - Buffered ICL image decoder ready!" );
- }
-
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::ConstructCommonL
-// -----------------------------------------------------------------------------
-
-void CIHLFileImage::ConstructCommonL()
- {
- // Check frame count and image index
- iImageCount = iDecoder->FrameCount();
- __ASSERT_ALWAYS( iImageCount > 0, User::Leave( KErrCorrupt ) );
-
- // Get image types
- iDecoder->ImageType( iImageIndex, iImageType, iImageSubType );
-
- if( KImageTypeGIFUid == iImageType )
- {
- iGif = ETrue;
- if( iImageCount > 1 )
- {
- iAnimation = ETrue;
- iAnimationFrameCount = iImageCount;
- iImageCount = 1; // Handled as one animated image
- }
- }
- __ASSERT_ALWAYS( iImageIndex >= 0 && iImageIndex < iImageCount, User::Leave( KErrArgument ) );
-
- // cache frame info and set scale sizes
- iFrameInfo = iDecoder->FrameInfo( iImageIndex );
- if( !iAnimation )
- {
- // Animation must always be loaded 1:1
- if( !iGif &&
- iFrameInfo.iFlags & TFrameInfo::EFullyScaleable )
- {
- // Gif cannot be fully scaleable
- iFullyScaleable = ETrue;
- }
- else
- {
- TSize size( iFrameInfo.iOverallSizeInPixels );
- iLoadSizeArray.AppendL( ScaledLoadSize( size, EEighth ) );
- iLoadSizeArray.AppendL( ScaledLoadSize( size, EQuarter ) );
- iLoadSizeArray.AppendL( ScaledLoadSize( size, EHalf ) );
- }
- }
- }
-
-// -----------------------------------------------------------------------------
-// Destructor
-// -----------------------------------------------------------------------------
-CIHLFileImage::~CIHLFileImage()
- {
- Cancel();
- delete iPrevAnimationFrame;
- delete iSubFrameBitmap;
- delete iDecoder;
- iLoadSizeArray.Reset();
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::Type
-// -----------------------------------------------------------------------------
-TIHLInterfaceType CIHLFileImage::Type() const
- {
- return TIHLInterfaceType( KIHLInterfaceIdFileImage,
- KIHLImplementationIdFileImage );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::ImageType
-// -----------------------------------------------------------------------------
-const TUid& CIHLFileImage::ImageType() const
- {
- return iImageType;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::ImageSubType
-// -----------------------------------------------------------------------------
-const TUid& CIHLFileImage::ImageSubType() const
- {
- return iImageSubType;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::ImageIndex
-// -----------------------------------------------------------------------------
-TInt CIHLFileImage::ImageIndex() const
- {
- return iImageIndex;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::ImageCount
-// -----------------------------------------------------------------------------
-TInt CIHLFileImage::ImageCount() const
- {
- return iImageCount;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::Size
-// -----------------------------------------------------------------------------
-TSize CIHLFileImage::Size() const
- {
- return iFrameInfo.iOverallSizeInPixels;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::DisplayMode
-// -----------------------------------------------------------------------------
-TDisplayMode CIHLFileImage::DisplayMode() const
- {
- if( iGif )
- {
- // We cannot trust iFrameDisplayMode for GIF images. It always return EColor256.
- // This is error because palette sure holds only 256 colors but these colors can
- // be still any RGB values and so for cannot be directly put to 8 bit bitmap (EColor256).
- // To decrypt image correctly and without color dithering, we must use 24 bit (EColor16M)
- // destination bitmap. Note that CFbsBitmap has palette methods but they are
- // not supported currently.
- // Return maximum color mode to ensure best image quality.
- return EColor16MU;
- }
- else if( iFrameInfo.iFrameDisplayMode < EColor16MU ||
- iFrameInfo.iFrameDisplayMode == EColor4K )
- {
- return EColor64K;
- }
- return EColor16MU;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::MaskDisplayMode
-// -----------------------------------------------------------------------------
-TDisplayMode CIHLFileImage::MaskDisplayMode() const
- {
- if( iFrameInfo.iFlags & TFrameInfo::ETransparencyPossible )
- {
- if( iFrameInfo.iFlags & TFrameInfo::EAlphaChannel )
- {
- return EGray256;
- }
- return EGray2;
- }
- return ENone;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::BackgroundColor
-// -----------------------------------------------------------------------------
-TRgb CIHLFileImage::BackgroundColor() const
- {
- return iFrameInfo.iBackgroundColor;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::CustomLoadSizeArray
-// -----------------------------------------------------------------------------
-const RArray& CIHLFileImage::CustomLoadSizeArray() const
- {
- return iLoadSizeArray;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::CustomLoadSizeArray
-// -----------------------------------------------------------------------------
-TBool CIHLFileImage::IsFullyScaleable() const
- {
- return iFullyScaleable;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::IsAnimation
-// -----------------------------------------------------------------------------
-TBool CIHLFileImage::IsAnimation() const
- {
- return iAnimation;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::AnimationFrameCount
-// -----------------------------------------------------------------------------
-TInt CIHLFileImage::AnimationFrameCount() const
- {
- return iAnimationFrameCount;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::AnimationFrameDelay
-// -----------------------------------------------------------------------------
-TTimeIntervalMicroSeconds32 CIHLFileImage::AnimationFrameDelay( TInt aAnimationFrameIndex ) const
- {
- __ASSERT_ALWAYS( aAnimationFrameIndex >= 0 &&
- aAnimationFrameIndex < iAnimationFrameCount, Panic( KErrArgument ) );
-
- return I64INT( iDecoder->FrameInfo( aAnimationFrameIndex ).iDelay.Int64() );
- }
-
-// ------------------------------------------------------------------------------
-// CIHLFileImage::Load
-// ------------------------------------------------------------------------------
-
-TInt CIHLFileImage::Load( TRequestStatus& aStatus, MIHLBitmap& aDestination, TInt aFrameIndex )
- {
- iImageIndex = aFrameIndex;
- return LoadRequest( aStatus, aDestination, iImageIndex );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::LoadAnimation
-// -----------------------------------------------------------------------------
-TInt CIHLFileImage::LoadAnimation( TRequestStatus& aStatus, MIHLBitmap& aDestination,
- TInt aAnimationFrameIndex )
- {
- __ASSERT_ALWAYS( aAnimationFrameIndex >= 0 &&
- aAnimationFrameIndex < iAnimationFrameCount, Panic( KErrArgument ) );
-
- return LoadRequest( aStatus, aDestination, aAnimationFrameIndex );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::IsBusy
-// -----------------------------------------------------------------------------
-TBool CIHLFileImage::IsBusy() const
- {
- return ( iImageState != EInactive );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::CancelLoad
-// -----------------------------------------------------------------------------
-void CIHLFileImage::CancelLoad()
- {
- Cancel();
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::SetFilter
-// -----------------------------------------------------------------------------
-void CIHLFileImage::SetFilter( MIHLFilter* /*aFilter*/ )
- {
- // Not in use
- }
-
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::Decoder
-// -----------------------------------------------------------------------------
-const CImageDecoder& CIHLFileImage::Decoder() const
- {
- return *iDecoder;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::DoCancel
-// -----------------------------------------------------------------------------
-void CIHLFileImage::DoCancel()
- {
- iDecoder->Cancel();
-
- // Delete all processed bitmaps
- ErrorCleanup();
-
- // Complete with cancel
- iImageState = EInactive;
- RequestComplete( KErrCancel );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::RunL
-// -----------------------------------------------------------------------------
-void CIHLFileImage::RunL()
- {
- __ASSERT_DEBUG( iDestination, Panic( KErrGeneral ) );
- User::LeaveIfError( iStatus.Int() );
-
- switch( iImageState )
- {
- case EStartLoad:
- {
- // start loading the bitmaps
- StartLoadL();
- break;
- }
- case ECompleteLoad:
- {
- // complete loading the bitmaps
- CompleteLoadL();
- break;
- }
- default:
- {
- Panic( KErrTotalLossOfPrecision );
- }
- }
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::RunError
-// -----------------------------------------------------------------------------
-TInt CIHLFileImage::RunError( TInt aError )
- {
- IHL_DEBUG2( KIHLDebug, "IHL - CIHLFileImage - Loading error: %d", aError );
-
- // Delete all processed bitmaps
- ErrorCleanup();
-
- // Complete with error
- iImageState = EInactive;
- RequestComplete( aError );
- return KErrNone;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::LoadRequest
-// -----------------------------------------------------------------------------
-TInt CIHLFileImage::LoadRequest( TRequestStatus& aStatus,
- MIHLBitmap& aDestination,
- TInt aFrameIndex )
- {
- if( IsBusy() )
- {
- return KErrNotReady;
- }
-
- if( aFrameIndex < 0 || aFrameIndex >= iDecoder->FrameCount() )
- {
- return KErrArgument;
- }
-
- const CFbsBitmap& dstBitmap = aDestination.Bitmap();
- if( !dstBitmap.Handle() )
- {
- return KErrArgument;
- }
-
- TSize dstSize( dstBitmap.SizeInPixels() );
- if( dstSize != Size() &&
- !iFullyScaleable )
- {
- TBool sizeFound( EFalse );
- const TInt count( iLoadSizeArray.Count() );
- for( TInt i( 0 ); i < count; ++i )
- {
- if( dstSize == iLoadSizeArray[ i ] )
- {
- sizeFound = ETrue;
- }
- }
- if( !sizeFound )
- {
- return KErrArgument;
- }
- }
-
- IHL_DEBUG1( KIHLDebug, "IHL - CIHLFileImage - Frame loading requested" );
-
- iImageStatus = &aStatus;
- *iImageStatus = KRequestPending;
-
- iDestination = static_cast( &aDestination ); //lint !e826
- iFrameIndex = aFrameIndex;
-
- // Start the active object
- iImageState = EStartLoad;
- SelfComplete();
- return KErrNone;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::StartLoadL
-// -----------------------------------------------------------------------------
-void CIHLFileImage::StartLoadL()
- {
- __ASSERT_DEBUG( !iSubFrameBitmap, Panic( KErrGeneral ) );
-
- IHL_DEBUG1( KIHLDebug, "IHL - CIHLFileImage - Start ICL convert" );
-
- if( iAnimation )
- {
- // Start animation from first frame by default
- iSubFrameIndex = 0;
-
- // Check is animation can be continued on top of destination bitmap
- if( iDestination->IsCreated() &&
- iDestination->EditorPtr() == this &&
- iDestination->EditorValue() < iFrameIndex )
- {
- // Editor value means frame index
- iSubFrameIndex = iDestination->EditorValue() + 1;
- }
-
- StartLoadSubFrameL( iSubFrameIndex, ETrue );
- }
- else if( iGif )
- {
- StartLoadSubFrameL( iFrameIndex, EFalse );
- }
- else
- {
- // Frame fills the whole image -> normal load
- StartLoadNormalFrame( iFrameIndex );
- }
-
- iImageState = ECompleteLoad;
- SetActive();
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::StartLoadNormalFrame
-// -----------------------------------------------------------------------------
-void CIHLFileImage::StartLoadNormalFrame( TInt aFrameIndex )
- {
- CFbsBitmap& dstBitmap = iDestination->BitmapModifyable();
- CFbsBitmap& dstMask = iDestination->MaskModifyable();
-
- if( MaskDisplayMode() && dstMask.Handle() )
- {
- iDecoder->Convert( &iStatus, dstBitmap, dstMask, aFrameIndex );
- }
- else
- {
- dstMask.Reset();
- iDecoder->Convert( &iStatus, dstBitmap, aFrameIndex );
- }
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::StartLoadSubFrameL
-// -----------------------------------------------------------------------------
-void CIHLFileImage::StartLoadSubFrameL( TInt aFrameIndex, TBool aAnimation )
- {
- __ASSERT_DEBUG( !iSubFrameBitmap, Panic( KErrGeneral ) );
-
- // Create animation bitmap
- iSubFrameBitmap = CIHLBitmap::NewL();
- CFbsBitmap& subBitmap = iSubFrameBitmap->BitmapModifyable();
- CFbsBitmap& subMask = iSubFrameBitmap->MaskModifyable();
-
- TSize dstSize( iDestination->Bitmap().SizeInPixels() );
- TFrameInfo subFrameInfo( iDecoder->FrameInfo( aFrameIndex ) );
-
- // Check is client uses downscaling (not used in animations)
- TSize loadSize( subFrameInfo.iFrameSizeInPixels );
- iSubFrameScaleFactor = EFull;
- if( !aAnimation &&
- dstSize != iFrameInfo.iOverallSizeInPixels )
- {
- if( dstSize == ScaledLoadSize( iFrameInfo.iOverallSizeInPixels, EHalf ) )
- {
- iSubFrameScaleFactor = EHalf;
- loadSize = ScaledLoadSize( loadSize, EHalf );
- }
- else if( dstSize == ScaledLoadSize( iFrameInfo.iOverallSizeInPixels, EQuarter ) )
- {
- iSubFrameScaleFactor = EQuarter;
- loadSize = ScaledLoadSize( loadSize, EQuarter );
- }
- else if( dstSize == ScaledLoadSize( iFrameInfo.iOverallSizeInPixels, EEighth ) )
- {
- iSubFrameScaleFactor = EEighth;
- loadSize = ScaledLoadSize( loadSize, EEighth );
- }
- }
- User::LeaveIfError( subBitmap.Create( loadSize, EColor16M ) );
-
- if( subFrameInfo.iFlags & TFrameInfo::ETransparencyPossible )
- {
- User::LeaveIfError( subMask.Create( loadSize,
- subFrameInfo.iFlags & TFrameInfo::EAlphaChannel ? EGray256 : EGray2 ) );
- iDecoder->Convert( &iStatus, subBitmap, subMask, aFrameIndex );
- }
- else
- {
- iDecoder->Convert( &iStatus, subBitmap, aFrameIndex );
- }
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::CompleteLoadL
-// -----------------------------------------------------------------------------
-void CIHLFileImage::CompleteLoadL()
- {
- IHL_DEBUG1( KIHLDebug1, "IHL - CIHLFileImage - ICL convert complete!" );
-
- if( iSubFrameBitmap )
- {
- IHL_DEBUG1( KIHLDebug2, "IHL - CIHLFileImage - Start build animation frame" );
-
- // Copy animation bitmap to destination
- BuildSubFrameL();
- delete iSubFrameBitmap;
- iSubFrameBitmap = NULL;
-
- IHL_DEBUG1( KIHLDebug3, "IHL - CIHLFileImage - Animation frame complete!" );
-
- // Save source info destination
- iDestination->SetEditorPtr( this );
- iDestination->SetEditorValue( iSubFrameIndex );
-
- if( iSubFrameIndex < iFrameIndex )
- {
- // re-start the active object and load next subframe
- iSubFrameIndex++;
- iImageState = EStartLoad;
- SelfComplete();
- }
- else
- {
- // Animation/subframe image ready
- iDestination = NULL;
- iImageState = EInactive;
- RequestComplete( KErrNone );
- }
- }
- else
- {
- // Save source info destination
- iDestination->SetEditorPtr( this );
- iDestination->SetEditorValue( iFrameIndex );
-
- // Normal image ready
- iDestination = NULL;
- iImageState = EInactive;
- RequestComplete( KErrNone );
- }
-
- IHL_DEBUG1( KIHLDebug4, "IHL - CIHLFileImage - Frame loading request complete!" );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::BuildSubFrameL
-// -----------------------------------------------------------------------------
-void CIHLFileImage::BuildSubFrameL()
- {
- __ASSERT_DEBUG( iSubFrameBitmap, Panic( KErrGeneral ) );
- const CFbsBitmap& subBitmap = iSubFrameBitmap->Bitmap();
- const CFbsBitmap& subMask = iSubFrameBitmap->Mask();
- __ASSERT_DEBUG( subBitmap.Handle(), Panic( KErrGeneral ) );
-
- if( !iAnimation ||
- ( iAnimation && iSubFrameIndex == 0 ) )
- {
- TFrameInfo frameInfo( iDecoder->FrameInfo( iSubFrameIndex ) );
- if( iDestination->Bitmap().SizeInPixels() == subBitmap.SizeInPixels() &&
- frameInfo.iFrameCoordsInPixels.iTl == TPoint(0,0) )
- {
- // Sub frame is same size as destination image and has no offset
- // -> put directly into destination
- User::LeaveIfError( iDestination->Copy( subBitmap, subMask, ETrue ) );
- }
- else
- {
- // Sub frame size differs from destination image size
- CFbsBitmap& desBitmap = iDestination->BitmapModifyable();
- CFbsBitmap& desMask = iDestination->MaskModifyable();
-
- // Other frames must be build on top of previous frames
- __ASSERT_DEBUG( desBitmap.Handle(), Panic( KErrGeneral ) );
-
- // Fill destination using background color
- FillL( desBitmap, frameInfo.iBackgroundColor );
-
- // Copy loaded frame on top of background
- CFbsBitGc* bitGc;
- CFbsBitmapDevice* bitDevice = CFbsBitmapDevice::NewL( &desBitmap );
- CleanupStack::PushL( bitDevice );
- User::LeaveIfError( bitDevice->CreateContext( bitGc ) );
- CleanupStack::PushL( bitGc );
-
- TPoint framePos( ScaledFramePosition(
- frameInfo.iFrameCoordsInPixels.iTl, iSubFrameScaleFactor ) );
- if( subMask.Handle() )
- {
- bitGc->BitBltMasked( framePos, &subBitmap,
- subBitmap.SizeInPixels(), &subMask, EFalse );
- }
- else
- {
- bitGc->BitBlt( framePos, &subBitmap, subBitmap.SizeInPixels() );
- }
- CleanupStack::PopAndDestroy( 2, bitDevice ); // bitGc, bitDevice
-
- if( desMask.Handle() )
- {
- // Fill mask to transparent
- FillL( desMask, KRgbBlack );
-
- // Fill bg mask with transparency (=black)
- CFbsBitmapDevice* maskDev = CFbsBitmapDevice::NewL( &desMask );
- CleanupStack::PushL( maskDev );
- CFbsBitGc* maskGc;
- User::LeaveIfError( maskDev->CreateContext( maskGc ) );
- CleanupStack::PushL( maskGc );
-
- // Combine bg mask with first frame mask
- maskGc->BitBlt( framePos, &subMask, subMask.SizeInPixels() );
-
- CleanupStack::PopAndDestroy( 2, maskDev ); // maskGc, maskDev
- }
- }
-
- // Create "previous frame" if animation
- if( iAnimation )
- {
- if( !iPrevAnimationFrame )
- {
- iPrevAnimationFrame = CIHLBitmap::NewL();
- }
- CFbsBitmap& desBitmap = iDestination->BitmapModifyable();
- CFbsBitmap& desMask = iDestination->MaskModifyable();
- if( iSubFrameBitmap->HasMask() )
- {
- User::LeaveIfError(
- iPrevAnimationFrame->Create( desBitmap.SizeInPixels(),
- desBitmap.DisplayMode(), desMask.DisplayMode() ) );
- FillL( iPrevAnimationFrame->BitmapModifyable(), frameInfo.iBackgroundColor );
- FillL( iPrevAnimationFrame->MaskModifyable(), KRgbBlack );
- }
- else
- {
- User::LeaveIfError(
- iPrevAnimationFrame->Create( desBitmap.SizeInPixels(),
- desBitmap.DisplayMode() ) );
- FillL( iPrevAnimationFrame->BitmapModifyable(), frameInfo.iBackgroundColor );
- }
- }
- }
- else // same as iAnimation && iSubFrameIndex > 0
- {
- TFrameInfo prevFrameInfo( iDecoder->FrameInfo( iSubFrameIndex - 1 ) );
- if ( prevFrameInfo.iFlags & TFrameInfo::ERestoreToPrevious )
- {
- // Restore destination to "previous frame"
- User::LeaveIfError( iDestination->Copy( *iPrevAnimationFrame, EFalse ) );
- }
-
- CFbsBitmap& prevBitmap = iDestination->BitmapModifyable();
- CFbsBitmap& prevMask = iDestination->MaskModifyable();
-
- // Other frames must be build on top of previous frames
- __ASSERT_DEBUG( prevBitmap.Handle(), Panic( KErrGeneral ) );
-
- // Restore area in destination bitmap if needed
- TRect restoreRect;
- TBool restoreToBackground( EFalse );
- if( prevFrameInfo.iFlags & TFrameInfo::ERestoreToBackground )
- {
- restoreToBackground = ETrue;
- restoreRect = prevFrameInfo.iFrameCoordsInPixels;
- FillRectL( prevBitmap, restoreRect, prevFrameInfo.iBackgroundColor );
-
- // Cache new "previous frame"
- User::LeaveIfError( iPrevAnimationFrame->Copy( *iDestination, EFalse ) );
- }
- else if( prevFrameInfo.iFlags & TFrameInfo::ELeaveInPlace )
- {
- // Cache new "previous frame"
- User::LeaveIfError( iPrevAnimationFrame->Copy( *iDestination, EFalse ) );
- }
-
- // Copy animation frame to destination bitmap
- TFrameInfo frameInfo( iDecoder->FrameInfo( iSubFrameIndex ) );
- CFbsBitGc* bitGc;
- CFbsBitmapDevice* bitDevice = CFbsBitmapDevice::NewL( &prevBitmap );
- CleanupStack::PushL( bitDevice );
- User::LeaveIfError( bitDevice->CreateContext( bitGc ) );
- CleanupStack::PushL( bitGc );
- if( subMask.Handle() )
- {
- bitGc->BitBltMasked( frameInfo.iFrameCoordsInPixels.iTl, &subBitmap,
- subBitmap.SizeInPixels(), &subMask, EFalse );
- }
- else
- {
- bitGc->BitBlt( frameInfo.iFrameCoordsInPixels.iTl, &subBitmap,
- subBitmap.SizeInPixels() );
- }
- CleanupStack::PopAndDestroy( 2 ); // bitGc, bitDevice
-
- // Combine masks if any
- if( prevMask.Handle() && subMask.Handle() )
- {
- //////////////////////////////////////////////////////////////////////////
- // ALTERNATIVE WAY TO COMBINE MASKS!
- // Current solution doesn't combine soft masks.
- // Following code could be used if soft masks are enabled in animations.
- // Do not delete!
- //////////////////////////////////////////////////////////////////////////
- /*
- if( restoreToBackground )
- {
- bitDevice = CFbsBitmapDevice::NewL( &prevMask );
- CleanupStack::PushL( bitDevice );
- User::LeaveIfError( bitDevice->CreateContext( bitGc ) );
- CleanupStack::PushL( bitGc );
-
- bitGc->SetBrushColor( KRgbBlack );
- bitGc->SetBrushStyle( CGraphicsContext::ESolidBrush );
- bitGc->DrawRect( restoreRect );
- bitGc->SetBrushStyle( CGraphicsContext::ENullBrush );
-
- CleanupStack::PopAndDestroy( 2 ); // bitDevice, bitGc
- }
-
- prevMask.LockHeap();
-
- TUint8* srcAddress = reinterpret_cast( animMask.DataAddress() );
- TSize srcSize( animMask.SizeInPixels() );
- TPoint srcPos( 0,0 );
- TInt srcScanLen8 = CFbsBitmap::ScanLineLength( srcSize.iWidth, EGray256 );
-
- TUint8* dstAddress = reinterpret_cast( prevMask.DataAddress() );
- TSize dstSize( prevMask.SizeInPixels() );
- TPoint dstPos( frameInfo.iFrameCoordsInPixels.iTl );
- TPoint dstEndPos( frameInfo.iFrameCoordsInPixels.iBr );
- TInt dstScanLen8 = CFbsBitmap::ScanLineLength( dstSize.iWidth, EGray256 );
-
- while( dstPos.iY < dstEndPos.iY )
- {
- TUint8* srcAddressCur = srcAddress + ( srcPos.iY * srcScanLen8 );
- TUint8* dstAddressCur = dstAddress + ( dstPos.iY * dstScanLen8 );
- while( dstPos.iX < dstEndPos.iX )
- {
- TUint8& srcPixel = srcAddressCur[ srcPos.iX++ ];
- TUint8& dstPixel = dstAddressCur[ dstPos.iX++ ];
- if( srcPixel > dstPixel )
- {
- dstPixel = srcPixel;
- }
- }
-
- srcPos.iX = 0;
- srcPos.iY++;
- dstPos.iX = frameInfo.iFrameCoordsInPixels.iTl.iX;
- dstPos.iY++;
- }
-
- animMask.UnlockHeap();
- */
-
- if( restoreToBackground )
- {
- FillRectL( prevMask, restoreRect, KRgbBlack );
- }
-
- bitDevice = CFbsBitmapDevice::NewL( &prevMask );
- CleanupStack::PushL( bitDevice );
- User::LeaveIfError( bitDevice->CreateContext( bitGc ) );
- CleanupStack::PushL( bitGc );
-
- CFbsBitmap* tmpMask = new(ELeave) CFbsBitmap;
- CleanupStack::PushL( tmpMask );
- User::LeaveIfError( tmpMask->Create( prevMask.SizeInPixels(), prevMask.DisplayMode() ) );
- CFbsBitmapDevice* tmpMaskDev = CFbsBitmapDevice::NewL( tmpMask );
- CleanupStack::PushL( tmpMaskDev );
- CFbsBitGc* tmpMaskGc;
- User::LeaveIfError( tmpMaskDev->CreateContext( tmpMaskGc ) );
- CleanupStack::PushL( tmpMaskGc );
-
- tmpMaskGc->BitBlt( TPoint( 0, 0 ), &prevMask, frameInfo.iFrameCoordsInPixels );
-
- bitGc->BitBltMasked( frameInfo.iFrameCoordsInPixels.iTl, &subMask,
- subMask.SizeInPixels(), tmpMask, ETrue );
-
- CleanupStack::PopAndDestroy( 5 ); // tmpMaskGc,tmpMaskDev,tmpMask,bitGc,bitDevice
- }
- else
- {
- prevMask.Reset(); // Mask not valid anymore -> reset
- }
- }
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::FillL
-// -----------------------------------------------------------------------------
-void CIHLFileImage::FillL( CFbsBitmap& aBitmap, const TRgb& aColor )
- {
- CFbsBitGc* bitGc;
- CFbsBitmapDevice* bitDevice = CFbsBitmapDevice::NewL( &aBitmap );
- CleanupStack::PushL( bitDevice );
- User::LeaveIfError( bitDevice->CreateContext( bitGc ) );
- CleanupStack::PushL( bitGc );
-
- bitGc->SetBrushColor( aColor );
- bitGc->SetPenColor( aColor );
- bitGc->SetBrushStyle( CGraphicsContext::ESolidBrush );
- bitGc->Clear();
- bitGc->SetBrushStyle( CGraphicsContext::ENullBrush );
-
- CleanupStack::PopAndDestroy( 2 ); // bitGc, bitDevice
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::FillRectL
-// -----------------------------------------------------------------------------
-void CIHLFileImage::FillRectL( CFbsBitmap& aBitmap, const TRect& aRect,
- const TRgb& aColor )
- {
- CFbsBitGc* bitGc;
- CFbsBitmapDevice* bitDevice = CFbsBitmapDevice::NewL( &aBitmap );
- CleanupStack::PushL( bitDevice );
- User::LeaveIfError( bitDevice->CreateContext( bitGc ) );
- CleanupStack::PushL( bitGc );
-
- bitGc->SetBrushColor( aColor );
- bitGc->SetPenColor( aColor );
- bitGc->SetBrushStyle( CGraphicsContext::ESolidBrush );
- bitGc->DrawRect( aRect );
- bitGc->SetBrushStyle( CGraphicsContext::ENullBrush );
-
- CleanupStack::PopAndDestroy( 2 ); // bitGc, bitDevice
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::ErrorCleanup
-// -----------------------------------------------------------------------------
-void CIHLFileImage::ErrorCleanup()
- {
- if( iSubFrameBitmap )
- {
- delete iSubFrameBitmap;
- iSubFrameBitmap = NULL;
- }
-
- if( iDestination )
- {
- iDestination = NULL;
- }
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::SelfComplete
-// -----------------------------------------------------------------------------
-void CIHLFileImage::SelfComplete()
- {
- SetActive();
- iStatus = KRequestPending;
- TRequestStatus* status = &iStatus;
- User::RequestComplete( status, KErrNone );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::RequestComplete
-// -----------------------------------------------------------------------------
-void CIHLFileImage::RequestComplete( TInt aReason )
- {
- ASSERT( iImageStatus );
- User::RequestComplete( iImageStatus, aReason );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::ScaledLoadSize
-// -----------------------------------------------------------------------------
-TSize CIHLFileImage::ScaledLoadSize( const TSize& aOriginalSize, TInt aScaleFactor )
- {
- // Divide original size with scalefactor
- // Round always up if result is not integer
- return ( aScaleFactor == EFull ) ? aOriginalSize :
- TSize( aOriginalSize.iWidth / aScaleFactor + ( aOriginalSize.iWidth % aScaleFactor ? 1 : 0 ),
- aOriginalSize.iHeight / aScaleFactor + ( aOriginalSize.iHeight % aScaleFactor ? 1 : 0 ) );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImage::ScaledLoadSize
-// -----------------------------------------------------------------------------
-TPoint CIHLFileImage::ScaledFramePosition( const TPoint& aOriginalPos, TInt aScaleFactor )
- {
- // Divide original position with scalefactor
- // Round always up if result is not integer
- return ( aScaleFactor == EFull ) ? aOriginalPos :
- TPoint( aOriginalPos.iX / aScaleFactor + ( aOriginalPos.iX % aScaleFactor ? 1 : 0 ),
- aOriginalPos.iY / aScaleFactor + ( aOriginalPos.iY % aScaleFactor ? 1 : 0 ) );
- }
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlinglib/Src/CIHLFileImage.h
--- a/imagehandlinglib/Src/CIHLFileImage.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,314 +0,0 @@
-/*
-* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of ImageFile class.
-*
-*/
-
-
-#ifndef CIHLFILEIMAGE_H
-#define CIHLFILEIMAGE_H
-
-// INCLUDES
-#include
-#include
-#include // TFrameInfo
-#include // TDisplayMode
-#include
-
-// FORWARD DECLARATIONS
-class MIHLBitmap;
-class CIHLBitmap;
-class CImageDecoder;
-class TRequestStatus;
-
-// CLASS DECLARATION
-/**
-* CIHLImage
-*
-* Implementation of file based image class.
-* @lib IHL.lib
-* @since 3.0
-*/
-NONSHARABLE_CLASS( CIHLFileImage ) : public CActive, public MIHLFileImage
- {
- public: // Constructors and destructor
-
- /**
- * Two-phased constructor.
- */
- static CIHLFileImage* NewL( RFile& aFile, TInt aImageIndex, const TUint32 aOptions );
- static CIHLFileImage* NewL( RFs& aFs, const TDesC8& aDataBuf,
- TInt aImageIndex, const TUint32 aOptions );
-
- /*
- * Virtual destructor.
- */
- virtual ~CIHLFileImage();
-
- public: // From base class MIHLImage
-
- /*
- * From MIHLImage, see base class header.
- */
- TIHLInterfaceType Type() const;
-
- public: // From base class MIHLFileImage
-
- /*
- * From MIHLFileImage, see base class header.
- */
- const TUid& ImageType() const;
-
- /*
- * From MIHLFileImage, see base class header.
- */
- const TUid& ImageSubType() const;
-
- /*
- * From MIHLFileImage, see base class header.
- */
- TInt ImageIndex() const;
-
- /*
- * From MIHLFileImage, see base class header.
- */
- TInt ImageCount() const;
-
- /*
- * From MIHLFileImage, see base class header.
- */
- TSize Size() const;
-
- /*
- * From MIHLFileImage, see base class header.
- */
- TDisplayMode DisplayMode() const;
-
- /*
- * From MIHLFileImage, see base class header.
- */
- TDisplayMode MaskDisplayMode() const;
-
- /*
- * From MIHLFileImage, see base class header.
- */
- TRgb BackgroundColor() const;
-
- /*
- * From MIHLFileImage, see base class header.
- */
- const RArray& CustomLoadSizeArray() const;
-
- /*
- * From MIHLFileImage, see base class header.
- */
- TBool IsFullyScaleable() const;
-
- /*
- * From MIHLFileImage, see base class header.
- */
- TBool IsAnimation() const;
-
- /*
- * From MIHLFileImage, see base class header.
- */
- TInt AnimationFrameCount() const;
-
- /*
- * From MIHLFileImage, see base class header.
- */
- TTimeIntervalMicroSeconds32 AnimationFrameDelay( TInt aAnimationFrameIndex ) const;
-
- /*
- * From MIHLFileImage, see base class header.
- */
- TInt Load( TRequestStatus& aStatus, MIHLBitmap& aDestination, TInt aFrameIndex = 0 );
-
- /*
- * From MIHLFileImage, see base class header.
- */
- TInt LoadAnimation( TRequestStatus& aStatus, MIHLBitmap& aDestination,
- TInt aAnimationFrameIndex );
-
- /*
- * From MIHLFileImage, see base class header.
- */
- TBool IsBusy() const;
-
- /*
- * From MIHLFileImage, see base class header.
- */
- void CancelLoad();
-
- /*
- * From MIHLFileImage, see base class header.
- */
- void SetFilter( MIHLFilter* aFilter );
-
- private: // From base class CActive
-
- /*
- * From CActive, see base class header.
- */
- void DoCancel();
-
- /*
- * From CActive, see base class header.
- */
- void RunL();
-
- /*
- * From CActive, see base class header.
- */
- TInt RunError( TInt aError );
-
- public: // Internal interface
-
- /**
- * Return reference to used CImageDecoder instance.
- * For internal use.
- * @since 3.0
- * @return Reference to used CImageDecoder instance.
- */
- const CImageDecoder& Decoder() const;
-
- private: // Private methods
-
- /*
- * Request load and start ActiveScheduler.
- * Called from Load() and LoadAnimation() methods.
- */
- TInt LoadRequest( TRequestStatus& aStatus, MIHLBitmap& aDestination, TInt aFrameIndex );
-
- /*
- * Start loading from file. Checks if image is still or animation.
- * Called by ActiveSheduler when state is EStartLoad.
- */
- void StartLoadL();
-
- /*
- * Start loading normal frame. Called by StartLoadL() method.
- */
- void StartLoadNormalFrame( TInt aFrameIndex );
-
- /*
- * Start loading sub frame. Called by StartLoadL() method.
- */
- void StartLoadSubFrameL( TInt aFrameIndex, TBool aAnimation );
-
- /*
- * Loading complete. Build possible animation and notify client.
- * Called by ActiveSheduler when state is ECompleteLoad.
- */
- void CompleteLoadL();
-
- /*
- * Build sub frame. Called by CompleteLoadL() method.
- */
- void BuildSubFrameL();
-
- /*
- * Fill whole bitmap using given color.
- * Used by BuildAnimationFrameL().
- */
- void FillL( CFbsBitmap& aBitmap, const TRgb& aColor );
-
- /*
- * Fill bitmap rect using given color.
- * Used by BuildAnimationFrameL().
- */
- void FillRectL( CFbsBitmap& aBitmap, const TRect& aRect, const TRgb& aColor );
-
- /*
- * Error cleanup. Called if error occurs during load.
- */
- void ErrorCleanup();
-
- /*
- * Complete dummy request. This causes RunL() method to be called.
- * Needed by state machine.
- */
- void SelfComplete();
-
- /*
- * Complete client load request.
- * This causes client RunL() method to be called.
- */
- void RequestComplete( TInt aReason );
-
- /*
- * Calculate scaled size.
- * Original size is divided by scale factor and result is rounded up
- * to next integer.
- */
- TSize ScaledLoadSize( const TSize& aOriginalSize, TInt aScaleFactor );
-
- /*
- * Calculate scaled frame position.
- * Original position is divided by scale factor and result is rounded up
- * to next integer.
- */
- TPoint ScaledFramePosition( const TPoint& aOriginalPos, TInt aScaleFactor );
-
- private: // Private constructors
-
- CIHLFileImage( TInt aImageIndex );
- void ConstructL( RFile& aFile, const TUint32 aOptions );
- void ConstructL( RFs& aFs, const TDesC8& aDataBuf, const TUint32 aOptions );
- void ConstructCommonL();
-
- private: // Private data types
-
- enum TImageState
- {
- EInactive,
- EStartLoad,
- ECompleteLoad,
- };
-
- private: // Data
-
- // Ref: Image status & state
- TRequestStatus* iImageStatus;
- TImageState iImageState;
-
- // Own: Image decoder
- CImageDecoder* iDecoder;
-
- // Image information
- TUid iImageType;
- TUid iImageSubType;
- TInt iImageIndex;
- TInt iImageCount;
- RArray iLoadSizeArray;
- TBool iFullyScaleable;
- TFrameInfo iFrameInfo;
- TBool iGif;
- TBool iAnimation;
- TInt iAnimationFrameCount;
-
- // Ref: Destination bitmap
- CIHLBitmap* iDestination;
- TInt iFrameIndex;
-
- // Own: Temporary animation bitmap
- CIHLBitmap* iSubFrameBitmap;
- TInt iSubFrameIndex;
- CIHLBitmap* iPrevAnimationFrame;
- TInt iSubFrameScaleFactor;
- };
-
-#endif // CIHLFILEIMAGE_H
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlinglib/Src/CIHLFileImageExtJpg.cpp
--- a/imagehandlinglib/Src/CIHLFileImageExtJpg.cpp Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,610 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of FileImageExtJpg class.
-*
-*/
-
-
-// INCLUDE FILES
-#include "CIHLFileImageExtJpg.h"
-
-#include "CIHLBitmap.h"
-#include "IHLImplementationIds.h"
-#include
-#include
-
-// Private namespace for constants and functions
-namespace
- {
- // Fixed scale factors
- enum TScaleFactors
- {
- EHalf = 2,
- EQuarter = 4,
- EEighth = 8,
- };
-
- // Panic function
- _LIT( KIHLExtJpgPanic, "IHLImageExtJpg" );
- void Panic( TInt aPanicCode ) { User::Panic( KIHLExtJpgPanic, aPanicCode ); }
- }
-
-// ============================ MEMBER FUNCTIONS ===============================
-// -----------------------------------------------------------------------------
-//
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-CIHLFileImageExtJpg::CIHLFileImageExtJpg( TInt aImageIndex )
-:CActive( CActive::EPriorityStandard ),
-iImageIndex( aImageIndex )
- {
- CActiveScheduler::Add( this );
- }
-
-// -----------------------------------------------------------------------------
-//
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-
-CIHLFileImageExtJpg* CIHLFileImageExtJpg::NewL( RFs& aFs, const TDesC8& aDataBuf,
- TInt aImageIndex, const TUint32 aOptions )
- {
- CIHLFileImageExtJpg* self = new (ELeave) CIHLFileImageExtJpg( aImageIndex );
- CleanupStack::PushL( self );
- self->ConstructL( aFs, aDataBuf, aOptions );
- CleanupStack::Pop(); // self
- return self;
- }
-
-CIHLFileImageExtJpg* CIHLFileImageExtJpg::NewL( RFs& aFs, const TDesC& aFilename,
- TInt aImageIndex, const TUint32 aOptions )
- {
- CIHLFileImageExtJpg* self = new (ELeave) CIHLFileImageExtJpg( aImageIndex );
- CleanupStack::PushL( self );
- self->ConstructL( aFs, aFilename, aOptions );
- CleanupStack::Pop(); // self
- return self;
- }
-
-// -----------------------------------------------------------------------------
-//
-// Symbian constructor can leave.
-// -----------------------------------------------------------------------------
-
-
-void CIHLFileImageExtJpg::ConstructL( RFs& aFs, const TDesC& aFilename, const TUint32 /*aOptions*/ )
- {
- TRAPD( err, iDecoder = CExtJpegDecoder::FileNewL( CExtJpegDecoder::EHwImplementation, aFs, aFilename ) );
-
- if ( err != KErrNone )
- {
- iDecoder = CExtJpegDecoder::FileNewL( CExtJpegDecoder::ESwImplementation, aFs, aFilename );
- }
-
- ConstructCommonL();
- }
-
-void CIHLFileImageExtJpg::ConstructL( RFs& aFs, const TDesC8& aDataBuf, const TUint32 /*aOptions*/ )
- {
- TRAPD( err, iDecoder = CExtJpegDecoder::DataNewL( CExtJpegDecoder::EHwImplementation, aFs, aDataBuf ) );
-
- if ( err != KErrNone )
- {
- iDecoder = CExtJpegDecoder::DataNewL( CExtJpegDecoder::ESwImplementation, aFs, aDataBuf );
- }
-
- ConstructCommonL();
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::ConstructCommonL
-// -----------------------------------------------------------------------------
-void CIHLFileImageExtJpg::ConstructCommonL()
- {
- // Check frame count and image index
- iImageCount = iDecoder->FrameCount();
- __ASSERT_ALWAYS( iImageCount > 0, User::Leave( KErrCorrupt ) );
-
- // Get image types
- iDecoder->ImageType( iImageIndex, iImageType, iImageSubType );
-
- __ASSERT_ALWAYS( iImageIndex >= 0 && iImageIndex < iImageCount, User::Leave( KErrArgument ) );
-
- // cache frame info and set scale sizes
- iFrameInfo = iDecoder->FrameInfo( iImageIndex );
- if( iFrameInfo.iFlags & TFrameInfo::EFullyScaleable )
- {
- iFullyScaleable = ETrue;
- }
- }
-
-// -----------------------------------------------------------------------------
-// Destructor
-// -----------------------------------------------------------------------------
-CIHLFileImageExtJpg::~CIHLFileImageExtJpg()
- {
- Cancel();
- delete iDecoder;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::Type
-// -----------------------------------------------------------------------------
-TIHLInterfaceType CIHLFileImageExtJpg::Type() const
- {
- return TIHLInterfaceType( KIHLInterfaceIdFileImage,
- KIHLImplementationIdFileImageExtJpg );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::ImageType
-// -----------------------------------------------------------------------------
-const TUid& CIHLFileImageExtJpg::ImageType() const
- {
- return iImageType;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::ImageSubType
-// -----------------------------------------------------------------------------
-const TUid& CIHLFileImageExtJpg::ImageSubType() const
- {
- return iImageSubType;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::ImageIndex
-// -----------------------------------------------------------------------------
-TInt CIHLFileImageExtJpg::ImageIndex() const
- {
- return iImageIndex;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::ImageCount
-// -----------------------------------------------------------------------------
-TInt CIHLFileImageExtJpg::ImageCount() const
- {
- return iImageCount;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::Size
-// -----------------------------------------------------------------------------
-TSize CIHLFileImageExtJpg::Size() const
- {
- return iFrameInfo.iOverallSizeInPixels;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::DisplayMode
-// -----------------------------------------------------------------------------
-TDisplayMode CIHLFileImageExtJpg::DisplayMode() const
- {
- TDisplayMode displayMode( iFrameInfo.iFrameDisplayMode );
- if( iFrameInfo.iFrameDisplayMode <= EGray256 )
- {
- displayMode = EGray256;
- }
- else if( iFrameInfo.iFrameDisplayMode <= EColor256 )
- {
- displayMode = EColor256;
- }
-
- return displayMode;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::MaskDisplayMode
-// -----------------------------------------------------------------------------
-TDisplayMode CIHLFileImageExtJpg::MaskDisplayMode() const
- {
- if( iFrameInfo.iFlags & TFrameInfo::ETransparencyPossible )
- {
- if( iFrameInfo.iFlags & TFrameInfo::EAlphaChannel )
- {
- return EGray256;
- }
- return EGray2;
- }
- return ENone;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::BackgroundColor
-// -----------------------------------------------------------------------------
-TRgb CIHLFileImageExtJpg::BackgroundColor() const
- {
- return iFrameInfo.iBackgroundColor;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::CustomLoadSizeArray
-// -----------------------------------------------------------------------------
-const RArray& CIHLFileImageExtJpg::CustomLoadSizeArray() const
- {
- return iLoadSizeArray;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::IsFullyScaleable
-// -----------------------------------------------------------------------------
-TBool CIHLFileImageExtJpg::IsFullyScaleable() const
- {
- return iFullyScaleable;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::IsAnimation
-// -----------------------------------------------------------------------------
-TBool CIHLFileImageExtJpg::IsAnimation() const
- {
- return iAnimation;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::AnimationFrameCount
-// -----------------------------------------------------------------------------
-TInt CIHLFileImageExtJpg::AnimationFrameCount() const
- {
- return iAnimationFrameCount;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::AnimationFrameDelay
-// -----------------------------------------------------------------------------
-TTimeIntervalMicroSeconds32 CIHLFileImageExtJpg::AnimationFrameDelay( TInt aAnimationFrameIndex ) const
- {
- //Animation is not supported
- ( void ) aAnimationFrameIndex;
- Panic( KErrNotSupported );
- return 0;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::Load
-// -----------------------------------------------------------------------------
-TInt CIHLFileImageExtJpg::Load( TRequestStatus& aStatus, MIHLBitmap& aDestination, TInt aFrameIndex )
- {
- iImageIndex = aFrameIndex;
- return LoadRequest( aStatus, aDestination, iImageIndex );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::Load
-// -----------------------------------------------------------------------------
-TInt CIHLFileImageExtJpg::Load( TRect aSrcRect, TRequestStatus& aStatus, MIHLBitmap& aDestination, TInt aFrameIndex )
- {
- TRAPD( err, SetCroppingL( aSrcRect ) );
- if( err )
- {
- return err;
- }
- iImageIndex = aFrameIndex;
- return LoadRequest( aStatus, aDestination, iImageIndex );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::LoadAnimation
-// -----------------------------------------------------------------------------
-TInt CIHLFileImageExtJpg::LoadAnimation( TRequestStatus& aStatus, MIHLBitmap& aDestination,
- TInt aAnimationFrameIndex )
- {
- //Animation is not supported
- ( void ) aStatus;
- ( void ) aDestination;
- ( void ) aAnimationFrameIndex;
- Panic( KErrNotSupported );
- return 0;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::IsBusy
-// -----------------------------------------------------------------------------
-TBool CIHLFileImageExtJpg::IsBusy() const
- {
- return ( iImageState != EInactive );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::CancelLoad
-// -----------------------------------------------------------------------------
-void CIHLFileImageExtJpg::CancelLoad()
- {
- Cancel();
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::SetFilter
-// -----------------------------------------------------------------------------
-void CIHLFileImageExtJpg::SetFilter( MIHLFilter* /*aFilter*/ )
- {
- // Not in use
- }
-
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::Decoder
-// -----------------------------------------------------------------------------
-const CExtJpegDecoder& CIHLFileImageExtJpg::Decoder() const
- {
- return *iDecoder;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::DoCancel
-// -----------------------------------------------------------------------------
-void CIHLFileImageExtJpg::DoCancel()
- {
- iDecoder->Cancel();
-
- // Delete all processed bitmaps
- ErrorCleanup();
-
- // Complete with cancel
- iImageState = EInactive;
- RequestComplete( KErrCancel );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::RunL
-// -----------------------------------------------------------------------------
-void CIHLFileImageExtJpg::RunL()
- {
- __ASSERT_DEBUG( iDestination, Panic( KErrGeneral ) );
- User::LeaveIfError( iStatus.Int() );
-
- switch( iImageState )
- {
- case EStartLoad:
- {
- // start loading the bitmaps
- StartLoadL();
- break;
- }
- case ECompleteLoad:
- {
- // complete loading the bitmaps
- CompleteLoadL();
- break;
- }
- default:
- {
- Panic( KErrTotalLossOfPrecision );
- }
- }
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::RunError
-// -----------------------------------------------------------------------------
-TInt CIHLFileImageExtJpg::RunError( TInt aError )
- {
- // Delete all processed bitmaps
- ErrorCleanup();
-
- // Complete with error
- iImageState = EInactive;
- RequestComplete( aError );
- return KErrNone;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::LoadRequest
-// -----------------------------------------------------------------------------
-TInt CIHLFileImageExtJpg::LoadRequest( TRequestStatus& aStatus, MIHLBitmap& aDestination, TInt aFrameIndex )
- {
- if( IsBusy() )
- {
- return KErrNotReady;
- }
-
- if( aFrameIndex < 0 || aFrameIndex >= iDecoder->FrameCount() )
- {
- return KErrArgument;
- }
-
- const CFbsBitmap& dstBitmap = aDestination.Bitmap();
- if( !dstBitmap.Handle() )
- {
- return KErrArgument;
- }
-
- iImageStatus = &aStatus;
- *iImageStatus = KRequestPending;
-
- iDestination = static_cast( &aDestination ); //lint !e826
- iFrameIndex = aFrameIndex;
-
- // Start the active object
- iImageState = EStartLoad;
- SelfComplete();
- return KErrNone;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::StartLoadL
-// -----------------------------------------------------------------------------
-void CIHLFileImageExtJpg::StartLoadL()
- {
- CFbsBitmap& dstBitmap = iDestination->BitmapModifyable();
- CFbsBitmap& dstMask = iDestination->MaskModifyable();
-
- if( MaskDisplayMode() && dstMask.Handle() )
- {
- iDecoder->Convert( &iStatus, dstBitmap, dstMask, iFrameIndex );
- }
- else
- {
- dstMask.Reset();
- iDecoder->Convert( &iStatus, dstBitmap, iFrameIndex );
- }
- iImageState = ECompleteLoad;
- SetActive();
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::CompleteLoadL
-// -----------------------------------------------------------------------------
-void CIHLFileImageExtJpg::CompleteLoadL()
- {
- // Save source info destination
- iDestination->SetEditorPtr( this );
- iDestination->SetEditorValue( iFrameIndex );
-
- // Normal image ready
- iDestination = NULL;
- iImageState = EInactive;
- RequestComplete( KErrNone );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::ErrorCleanup
-// -----------------------------------------------------------------------------
-void CIHLFileImageExtJpg::ErrorCleanup()
- {
- if( iDestination )
- {
- iDestination = NULL;
- }
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::SelfComplete
-// -----------------------------------------------------------------------------
-void CIHLFileImageExtJpg::SelfComplete()
- {
- SetActive();
- iStatus = KRequestPending;
- TRequestStatus* status = &iStatus;
- User::RequestComplete( status, KErrNone );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::RequestComplete
-// -----------------------------------------------------------------------------
-void CIHLFileImageExtJpg::RequestComplete( TInt aReason )
- {
- ASSERT( iImageStatus );
- User::RequestComplete( iImageStatus, aReason );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::SetCroppingL
-// -----------------------------------------------------------------------------
-
-void CIHLFileImageExtJpg::SetCroppingL( TRect aCropRect )
- {
- iDecoder->SetCroppingL( aCropRect );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::SetStreamingL
-// -----------------------------------------------------------------------------
-
-void CIHLFileImageExtJpg::SetStreamingL( TSize& aMacroBlockSize )
- {
- iDecoder->SetStreamingL( aMacroBlockSize );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::SetRotationL
-// -----------------------------------------------------------------------------
-
-void CIHLFileImageExtJpg::SetRotationL( TInt aDegree )
- {
- iDecoder->SetRotationL( aDegree );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::SetFlippingL
-// -----------------------------------------------------------------------------
-
-void CIHLFileImageExtJpg::SetFlippingL()
- {
- iDecoder->SetFlippingL();
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::SetMirroringL
-// -----------------------------------------------------------------------------
-
-void CIHLFileImageExtJpg::SetMirroringL()
- {
- iDecoder->SetMirroringL();
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::SetDctDecodingL
-// -----------------------------------------------------------------------------
-
-void CIHLFileImageExtJpg::SetDctDecodingL()
- {
- iDecoder->SetDctDecodingL();
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::ConvertL
-// -----------------------------------------------------------------------------
-
-void CIHLFileImageExtJpg::ConvertL(
- TRequestStatus* aRequestStatus,
- const CVisualFrame* aDestinationFrame,
- TInt& aNoOfDecodedMBlocks,
- TInt aFrameNumber )
- {
- iDecoder->ConvertL(
- aRequestStatus,
- aDestinationFrame,
- aNoOfDecodedMBlocks,
- aFrameNumber );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::ContinueConvertL
-// -----------------------------------------------------------------------------
-
-void CIHLFileImageExtJpg::ContinueConvertL(
- TRequestStatus* aRequestStatus,
- const CVisualFrame* aDestinationFrame,
- TInt& aNoOfDecodedMBlocks,
- TInt aFrameNumber )
- {
- iDecoder->ContinueConvertL(
- aRequestStatus,
- aDestinationFrame,
- aNoOfDecodedMBlocks,
- aFrameNumber );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::SupportedFormatsL
-// -----------------------------------------------------------------------------
-
-TInt CIHLFileImageExtJpg::SupportedFormatsL()
- {
- return iDecoder->SupportedFormatsL();
- }
-
-// -----------------------------------------------------------------------------
-// CIHLFileImageExtJpg::CapabilitiesL
-// -----------------------------------------------------------------------------
-
-TInt CIHLFileImageExtJpg::CapabilitiesL()
- {
- return iDecoder->CapabilitiesL();
- }
-
-//End of file
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlinglib/Src/CIHLFileImageExtJpg.h
--- a/imagehandlinglib/Src/CIHLFileImageExtJpg.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,330 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of ImageFile class.
-*
-*/
-
-
-#ifndef CIHLFILEIMAGEEXTJPG_H
-#define CIHLFILEIMAGEEXTJPG_H
-
-// INCLUDES
-#include
-#include // TFrameInfo
-#include // TDisplayMode
-#include "MIHLFileImageExtJpg.h"
-
-// FORWARD DECLARATIONS
-class MIHLBitmap;
-class CIHLBitmap;
-class CExtJpegDecoder;
-class CVisualFrame;
-
-// CLASS DECLARATION
-/**
-* CIHLFileImageExtJpg
-*
-* Implementation of file based ext jpg image class.
-* @lib IHL.lib
-* @since 3.0
-*/
-
-NONSHARABLE_CLASS( CIHLFileImageExtJpg ) : public CActive, public MIHLFileImageExtJpg
- {
- public: // Constructors and destructor
-
- /**
- * Two-phased constructor.
- */
- static CIHLFileImageExtJpg* NewL( RFs& aFs, const TDesC8& aDataBuf,
- TInt aImageIndex, const TUint32 aOptions );
- static CIHLFileImageExtJpg* NewL( RFs& aFs, const TDesC& aFilename,
- TInt aImageIndex, const TUint32 aOptions );
- /*
- * Virtual destructor.
- */
- virtual ~CIHLFileImageExtJpg();
-
- public: // From base class MIHLImage
-
- TIHLInterfaceType Type() const;
-
- public: // From base class MIHLFileImage
-
- /*
- * From MIHLFileImage, see base class header.
- */
- const TUid& ImageType() const;
-
- /*
- * From MIHLFileImage, see base class header.
- */
- const TUid& ImageSubType() const;
-
- /*
- * From MIHLFileImage, see base class header.
- */
- TInt ImageIndex() const;
-
- /*
- * From MIHLFileImage, see base class header.
- */
- TInt ImageCount() const;
-
- /*
- * From MIHLFileImage, see base class header.
- */
- TSize Size() const;
-
- /*
- * From MIHLFileImage, see base class header.
- */
- TDisplayMode DisplayMode() const;
-
- /*
- * From MIHLFileImage, see base class header.
- */
- TDisplayMode MaskDisplayMode() const;
-
- /*
- * From MIHLFileImage, see base class header.
- */
- TRgb BackgroundColor() const;
-
- /*
- * From MIHLFileImage, see base class header.
- */
- const RArray& CustomLoadSizeArray() const;
-
- /*
- * From MIHLFileImage, see base class header.
- */
- TBool IsFullyScaleable() const;
-
- /*
- * From MIHLFileImage, see base class header.
- */
- TBool IsAnimation() const;
-
- /*
- * From MIHLFileImage, see base class header.
- */
- TInt AnimationFrameCount() const;
-
- /*
- * From MIHLFileImage, see base class header.
- */
- TTimeIntervalMicroSeconds32 AnimationFrameDelay( TInt aAnimationFrameIndex ) const;
-
- /*
- * From MIHLFileImage, see base class header.
- */
- TInt Load( TRequestStatus& aStatus, MIHLBitmap& aDestination, TInt aFrameIndex = 0 );
-
- /*
- * From MIHLFileImage, see base class header.
- */
- TInt LoadAnimation( TRequestStatus& aStatus, MIHLBitmap& aDestination, TInt aAnimationFrameIndex );
-
- /*
- * From MIHLFileImage, see base class header.
- */
- TBool IsBusy() const;
-
- /*
- * From MIHLFileImage, see base class header.
- */
- void CancelLoad();
-
- /*
- * From MIHLFileImage, see base class header.
- */
- void SetFilter( MIHLFilter* aFilter );
-
- public: // From MIHLFileImageExtJpg
-
- /*
- * From MIHLFileImageExtJpg, see base class header.
- */
- TInt Load( TRect aSrcRect, TRequestStatus& aStatus, MIHLBitmap& aDestination, TInt aFrameIndex = 0 );
-
- /*
- * From MIHLFileImageExtJpg, see base class header.
- */
- void SetCroppingL( TRect aCropRect );
-
- /*
- * From MIHLFileImageExtJpg, see base class header.
- */
- void SetStreamingL( TSize& aMacroBlockSize );
-
- /*
- * From MIHLFileImageExtJpg, see base class header.
- */
- void SetRotationL( TInt aDegree );
-
- /*
- * From MIHLFileImageExtJpg, see base class header.
- */
- void SetFlippingL();
-
- /*
- * From MIHLFileImageExtJpg, see base class header.
- */
- void SetMirroringL();
-
- /*
- * From MIHLFileImageExtJpg, see base class header.
- */
- void SetDctDecodingL();
-
- /*
- * From MIHLFileImageExtJpg, see base class header.
- */
- void ConvertL(
- TRequestStatus* aRequestStatus,
- const CVisualFrame* aDestinationFrame,
- TInt& aNoOfDecodedMBlocks,
- TInt aFrameNumber = 0 );
-
- /*
- * From MIHLFileImageExtJpg, see base class header.
- */
- void ContinueConvertL(
- TRequestStatus* aRequestStatus,
- const CVisualFrame* aDestinationFrame,
- TInt& aNoOfDecodedMBlocks,
- TInt aFrameNumber = 0 );
-
- /*
- * From MIHLFileImageExtJpg, see base class header.
- */
- TInt SupportedFormatsL();
-
- /*
- * From MIHLFileImageExtJpg, see base class header.
- */
- TInt CapabilitiesL();
-
- private: // From base class CActive
-
- /*
- * From CActive, see base class header.
- */
- void DoCancel();
-
- /*
- * From CActive, see base class header.
- */
- void RunL();
-
- /*
- * From CActive, see base class header.
- */
- TInt RunError( TInt aError );
-
- public: // Internal interface
-
- /**
- * Return reference to used CExtJpegDecoder instance.
- * For internal use.
- * @since 3.0
- * @return Reference to used CExtJpegDecoder instance.
- */
- const CExtJpegDecoder& Decoder() const;
-
- private: // Private methods
-
- /*
- * Request load and start ActiveScheduler.
- * Called from Load() and LoadAnimation() methods.
- */
- TInt LoadRequest( TRequestStatus& aStatus, MIHLBitmap& aDestination, TInt aFrameIndex );
-
- /*
- * Start loading from file. Checks if image is still or animation.
- * Called by ActiveSheduler when state is EStartLoad.
- */
- void StartLoadL();
-
- /*
- * Loading complete. Build possible animation and notify client.
- * Called by ActiveSheduler when state is ECompleteLoad.
- */
- void CompleteLoadL();
-
- /*
- * Error cleanup. Called if error occurs during load.
- */
- void ErrorCleanup();
-
- /*
- * Complete dummy request. This causes RunL() method to be called.
- * Needed by state machine.
- */
- void SelfComplete();
-
- /*
- * Complete client load request.
- * This causes client RunL() method to be called.
- */
- void RequestComplete( TInt aReason );
-
- private: // Private constructors
-
- CIHLFileImageExtJpg( TInt aImageIndex );
-
- void ConstructL( RFs& aFs, const TDesC& aFilename, const TUint32 aOptions );
- void ConstructL( RFs& aFs, const TDesC8& aDataBuf, const TUint32 aOptions );
- void ConstructCommonL();
-
- private: // Private data types
-
- enum TImageState
- {
- EInactive,
- EStartLoad,
- ECompleteLoad,
- };
-
- private: // Data
-
- // Ref: Image status & state
- TRequestStatus* iImageStatus;
- TImageState iImageState;
-
- // Own: Image decoder
- CExtJpegDecoder* iDecoder;
-
- // Image information
- TUid iImageType;
- TUid iImageSubType;
- TInt iImageIndex;
- TInt iImageCount;
-
- TBool iFullyScaleable;
- TFrameInfo iFrameInfo;
- TBool iAnimation;
- TInt iAnimationFrameCount;
-
- // Ref: Destination bitmap
- CIHLBitmap* iDestination;
- TInt iFrameIndex;
-
- RArray iLoadSizeArray;
- };
-
-#endif // CIHLFILEIMAGEEXTJPG_H
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlinglib/Src/CIHLImageViewer.cpp
--- a/imagehandlinglib/Src/CIHLImageViewer.cpp Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1369 +0,0 @@
-/*
-* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of Image Viewer class.
-*
-*/
-
-
-// INCLUDE FILES
-#include "CIHLImageViewer.h"
-
-#include "CIHLBitmap.h"
-#include "CIHLBitmapProcessor.h"
-#include "IHLImplementationIds.h"
-#include "IHLDebugPrint.h" // Debug print
-#include
-#include
-#include
-#include
-#include
-
-// Private namespace for constants and functions
-namespace
- {
- // Panic function
- _LIT( KIHLPanicString, "IHLImageViewer" );
- void Panic( TInt aPanicCode ) { User::Panic( KIHLPanicString, aPanicCode ); }
- }
-
-// ============================ MEMBER FUNCTIONS ===============================
-// -----------------------------------------------------------------------------
-//
-// C++ constructor can NOT contain any code, that might leave.
-// -----------------------------------------------------------------------------
-CIHLImageViewer::CIHLImageViewer( const TSize& aViewerSize,
- MIHLFileImage& aSource,
- MIHLBitmap& aDestination,
- MIHLViewerObserver& aObserver,
- const TUint32 aOptions )
-:CTimer( EPriorityNormal ), iObserver( aObserver ),
-iSource( aSource ), iDestination( aDestination ),
-iOptions( aOptions ), iViewerSize( aViewerSize ), iSrcBitmapScaleFactor(1)
- {
- CActiveScheduler::Add( this );
- iAnimDelay = 0;
- iAnimLastFrameDrawTime = 0;
- iAnimDrawStartFastTime = 0;
- }
-
-// -----------------------------------------------------------------------------
-//
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-CIHLImageViewer* CIHLImageViewer::NewL( const TSize& aViewerSize,
- MIHLFileImage& aSource,
- MIHLBitmap& aDestination,
- MIHLViewerObserver& aObserver,
- const TUint32 aOptions )
- {
- CIHLImageViewer* self = new( ELeave ) CIHLImageViewer(
- aViewerSize, aSource, aDestination, aObserver, aOptions );
- CleanupStack::PushL( self );
- self->ConstructL();
- CleanupStack::Pop(); // self
- return self;
- }
-
-// -----------------------------------------------------------------------------
-//
-// Symbian constructor can leave.
-// -----------------------------------------------------------------------------
-void CIHLImageViewer::ConstructL()
- {
- CTimer::ConstructL();
-
- HAL::Get(HALData::EFastCounterFrequency, iTickPeriod);
-
- iCacheSource = CIHLBitmap::NewL();
- iCacheDestination = CIHLBitmap::NewL();
- iProcessor = CIHLBitmapProcessor::NewL( iOptions );
-
- // Initialize settings and start load (default is zoom to fit)
- iSourceSize = iSource.Size();
- CalculateZoomToFitRatio();
- User::LeaveIfError( SetZoomRatio( iZoomToFitRatio ) );
- }
-
-// -----------------------------------------------------------------------------
-// Destructor
-// -----------------------------------------------------------------------------
-CIHLImageViewer::~CIHLImageViewer()
- {
- Cancel();
- delete iProcessor;
- delete iCacheDestination;
- delete iCacheSource;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::Id
-// -----------------------------------------------------------------------------
-TIHLInterfaceType CIHLImageViewer::Type() const
- {
- return TIHLInterfaceType( KIHLInterfaceIdImageViewer, KIHLImplementationIdImageViewer );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::IsAnimation
-// -----------------------------------------------------------------------------
-TBool CIHLImageViewer::IsAnimation() const
- {
- return iSource.IsAnimation();
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::SheduleNextFrame
-// -----------------------------------------------------------------------------
-void CIHLImageViewer::SheduleNextFrame(TTimeIntervalMicroSeconds32 aDelay)
- {
- TInt delay=aDelay.Int();
-
- if (delay == 0) // 0 second deleay set in GIF file
- {
- iAnimDelay = TTimeIntervalMicroSeconds32(100000-iAnimLastFrameDrawTime);
- }
- else
- {
- iAnimDelay = delay - iAnimLastFrameDrawTime;
- }
-
- if (iAnimDelay.Int() <=0) //last frame drawn longer than animation frame interval.
- {
- iAnimDelay = KMinimumInterval;
- }
- iAnimInitFastTime=User::FastCounter(); //store the start time
- HighRes(iAnimDelay);
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::Play
-// -----------------------------------------------------------------------------
-void CIHLImageViewer::Play()
- {
- if( iSource.IsAnimation() )
- {
- iIsPlaying = ETrue;
- if( iViewerState == EInactive)
- {
- iViewerState = EAnimation;
- SheduleNextFrame( iSource.AnimationFrameDelay( iAnimationIndex ) );
- }
- }
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::Stop
-// -----------------------------------------------------------------------------
-void CIHLImageViewer::Stop()
- {
- iIsPlaying = EFalse;
- if( iViewerState == EAnimation )
- {
- Cancel();
- }
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::IsPlaying
-// -----------------------------------------------------------------------------
-TBool CIHLImageViewer::IsPlaying() const
- {
- return iIsPlaying;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::AnimationFrameCount
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewer::AnimationFrameCount() const
- {
- return iSource.AnimationFrameCount();
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::AnimationFrame
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewer::AnimationFrame() const
- {
- return iAnimationIndex;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::SetAnimationFrame
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewer::SetAnimationFrame( TInt aFrameIndex )
- {
- // Public API, boundary check -> panic also on hardware
- __ASSERT_ALWAYS( aFrameIndex >= 0 &&
- aFrameIndex < iSource.AnimationFrameCount(), Panic( KErrArgument ) );
-
- // Save new index and clear old source cache to force load new frame
- iAnimationIndex = aFrameIndex;
- iCacheSource->Reset();
-
- // Start load
- return ApplySettings();
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::SetViewerSize
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewer::SetViewerSize( const TSize& aViewerSize, int aSrcBitmapScaleFactor )
- {
- // Public API, negative value check -> panic also on hardware
- __ASSERT_ALWAYS( aViewerSize.iWidth >= 0 &&
- aViewerSize.iHeight >= 0, Panic( KErrArgument ) );
-
- iSrcBitmapScaleFactor = aSrcBitmapScaleFactor;
-
- // Save new viewer size
- iViewerSize = aViewerSize;
-
- // Recalculate source rect and destination size
- CalculateSourceRectAndDestinationSize();
-
- // Recalculate zoom to fit ratio
- CalculateZoomToFitRatio();
-
- // Start load
- return ApplySettings();
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::ViewerSize
-// -----------------------------------------------------------------------------
-TSize CIHLImageViewer::ViewerSize() const
- {
- return iViewerSize;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::MoveSourceRect
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewer::MoveSourceRect( TInt aDx, TInt aDy )
- {
- TInt dx( aDx );
- TInt dy( aDy );
- switch( iRotationAngle )
- {
- case ERotationAngle0:
- {
- break;
- }
- case ERotationAngle90:
- {
- dx = aDy;
- dy = -aDx;
- break;
- }
- case ERotationAngle180:
- {
- dx = -aDx;
- dy = -aDy;
- break;
- }
- case ERotationAngle270:
- {
- dx = -aDy;
- dy = aDx;
- break;
- }
- default:
- {
- // Internal state error, debug panic only
- #ifdef _DEBUG
- Panic( KErrGeneral );
- #endif
- }
- }
- if( iHorizontalMirroring )
- {
- dx = -dx;
- }
- if( iVerticalMirroring )
- {
- dy = -dy;
- }
-
- if( iSourceRect.iTl.iX + dx < 0 ||
- iSourceRect.iBr.iX + dx > iSourceSize.iWidth ||
- iSourceRect.iTl.iY + dy < 0 ||
- iSourceRect.iBr.iY + dy > iSourceSize.iHeight )
- {
- return KErrArgument;
- }
-
- iSourceRect.Move( dx, dy );
-
- // Start load
- return ApplySettings();
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::SetSourceRectPosition
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewer::SetSourceRectPosition( const TPoint& aPosition )
- {
- TPoint newPosition( aPosition );
- TSize sourceRectSize( iSourceRect.Size() );
- switch( iRotationAngle )
- {
- case ERotationAngle0:
- {
- break;
- }
- case ERotationAngle90:
- {
- newPosition.iX = aPosition.iY;
- newPosition.iY = iSourceSize.iHeight - sourceRectSize.iHeight - aPosition.iX;
- break;
- }
- case ERotationAngle180:
- {
- newPosition.iX = iSourceSize.iWidth - sourceRectSize.iWidth - aPosition.iX;
- newPosition.iY = iSourceSize.iHeight - sourceRectSize.iHeight - aPosition.iY;
- break;
- }
- case ERotationAngle270:
- {
- newPosition.iX = iSourceSize.iWidth - sourceRectSize.iWidth - aPosition.iY;
- newPosition.iY = aPosition.iX;
- break;
- }
- default:
- {
- // Internal state error, debug panic only
- #ifdef _DEBUG
- Panic( KErrGeneral );
- #endif
- }
- }
- if( iHorizontalMirroring )
- {
- newPosition.iX = iSourceSize.iWidth - sourceRectSize.iWidth - newPosition.iX;
- }
- if( iVerticalMirroring )
- {
- newPosition.iY = iSourceSize.iHeight - sourceRectSize.iHeight - newPosition.iY;
- }
-
- if( newPosition.iX < 0 ||
- newPosition.iX > ( iSourceSize.iWidth - sourceRectSize.iWidth ) ||
- newPosition.iY < 0 ||
- newPosition.iY > ( iSourceSize.iHeight - sourceRectSize.iHeight ) )
- {
- return KErrArgument;
- }
-
- iSourceRect = TRect( newPosition, sourceRectSize );
-
- // Start load
- return ApplySettings();
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::SourceRect
-// -----------------------------------------------------------------------------
-TRect CIHLImageViewer::SourceRect() const
- {
- TRect mirroredSourceRect( iSourceRect );
- if( iHorizontalMirroring )
- {
- mirroredSourceRect.iTl.iX = iSourceSize.iWidth - iSourceRect.iBr.iX;
- mirroredSourceRect.iBr.iX = iSourceSize.iWidth - iSourceRect.iTl.iX;
- }
- if( iVerticalMirroring )
- {
- mirroredSourceRect.iTl.iY = iSourceSize.iHeight - iSourceRect.iBr.iY;
- mirroredSourceRect.iBr.iY = iSourceSize.iHeight - iSourceRect.iTl.iY;
- }
-
- TRect rotatedSourceRect( mirroredSourceRect );
- switch( iRotationAngle )
- {
- case ERotationAngle0:
- {
- break;
- }
- case ERotationAngle90:
- {
- rotatedSourceRect.iTl.iX = iSourceSize.iHeight - mirroredSourceRect.iBr.iY;
- rotatedSourceRect.iTl.iY = mirroredSourceRect.iTl.iX;
- rotatedSourceRect.iBr.iX = iSourceSize.iHeight - mirroredSourceRect.iTl.iY;
- rotatedSourceRect.iBr.iY = mirroredSourceRect.iBr.iX;
- break;
- }
- case ERotationAngle180:
- {
- rotatedSourceRect.iTl.iX = iSourceSize.iWidth - mirroredSourceRect.iBr.iX;
- rotatedSourceRect.iTl.iY = iSourceSize.iHeight - mirroredSourceRect.iBr.iY;
- rotatedSourceRect.iBr.iX = iSourceSize.iWidth - mirroredSourceRect.iTl.iX;
- rotatedSourceRect.iBr.iY = iSourceSize.iHeight - mirroredSourceRect.iTl.iY;
- break;
- }
- case ERotationAngle270:
- {
- rotatedSourceRect.iTl.iX = mirroredSourceRect.iTl.iY;
- rotatedSourceRect.iTl.iY = iSourceSize.iWidth - mirroredSourceRect.iBr.iX;
- rotatedSourceRect.iBr.iX = mirroredSourceRect.iBr.iY;
- rotatedSourceRect.iBr.iY = iSourceSize.iWidth - mirroredSourceRect.iTl.iX;
- break;
- }
- default:
- {
- // Internal state error, debug panic only
- #ifdef _DEBUG
- Panic( KErrGeneral );
- #endif
- }
- }
-
- return rotatedSourceRect;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::SourceSize
-// -----------------------------------------------------------------------------
-TSize CIHLImageViewer::SourceSize() const
- {
- if( iRotationAngle == ERotationAngle90 ||
- iRotationAngle == ERotationAngle270 )
- {
- return TSize( iSourceSize.iHeight, iSourceSize.iWidth );
- }
- else
- {
- return iSourceSize;
- }
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::SetZoomRatio
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewer::SetZoomRatio( TReal aZoomRatio )
- {
- if( aZoomRatio <= 0 || Math::IsInfinite( aZoomRatio ) )
- {
- return KErrArgument;
- }
-
- iZoomRatio = aZoomRatio;
-
- // Recalculate source rect and destination size
- CalculateSourceRectAndDestinationSize();
-
- // Start load
- return ApplySettings();
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::ZoomRatio
-// -----------------------------------------------------------------------------
-TReal CIHLImageViewer::ZoomRatio() const
- {
- return iZoomRatio;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::ZoomToFitRatio
-// -----------------------------------------------------------------------------
-TReal CIHLImageViewer::ZoomToFitRatio() const
- {
- return iZoomToFitRatio;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::RotateClockwise
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewer::RotateClockwise()
- {
- TInt rotationAngle( iRotationAngle + ERotationAngle90 );
- if( rotationAngle > ERotationAngle270 )
- {
- rotationAngle = ERotationAngle0;
- }
-
- return SetRotationAngle( rotationAngle );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::RotateCounterClockwise
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewer::RotateCounterClockwise()
- {
- TInt rotationAngle( iRotationAngle - ERotationAngle90 );
- if( rotationAngle < ERotationAngle0 )
- {
- rotationAngle = ERotationAngle270;
- }
-
- return SetRotationAngle( rotationAngle );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::SetRotationAngle
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewer::SetRotationAngle( TInt aRotationAngle )
- {
- if( aRotationAngle != ERotationAngle0 &&
- aRotationAngle != ERotationAngle90 &&
- aRotationAngle != ERotationAngle180 &&
- aRotationAngle != ERotationAngle270 )
- {
- return KErrArgument;
- }
-
- iRotationAngle = aRotationAngle;
-
- // Recalculate source rect and destination size
- CalculateSourceRectAndDestinationSize();
-
- // Recalculate zoom to fit ratio
- CalculateZoomToFitRatio();
-
- // Start load
- return ApplySettings();
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::RotationAngle
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewer::RotationAngle() const
- {
- return iRotationAngle;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::SetVerticalMirroring
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewer::SetVerticalMirroring( TBool aValue )
- {
- if( iVerticalMirroring != aValue )
- {
- iVerticalMirroring = aValue;
-
- // Start load
- return ApplySettings();
- }
- return KErrNone;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::VerticalMirroring
-// -----------------------------------------------------------------------------
-TBool CIHLImageViewer::VerticalMirroring() const
- {
- return iVerticalMirroring;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::SetHorizontalMirroring
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewer::SetHorizontalMirroring( TBool aValue )
- {
- if( iHorizontalMirroring != aValue )
- {
- iHorizontalMirroring = aValue;
- return ApplySettings();
- }
- return KErrNone;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::HorizontalMirroring
-// -----------------------------------------------------------------------------
-TBool CIHLImageViewer::HorizontalMirroring() const
- {
- return iHorizontalMirroring;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::SetFilter
-// -----------------------------------------------------------------------------
-void CIHLImageViewer::SetFilter( MIHLFilter* /*aFilter*/ )
- {
- // Not in use
- }
-
-
-
-// Private methods
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::DoCancel
-// -----------------------------------------------------------------------------
-void CIHLImageViewer::DoCancel()
- {
- CTimer::DoCancel();
- switch( iViewerState )
- {
- case ELoad:
- {
- // Cancel asynchronous source loading
- iSource.CancelLoad();
- iCacheSource->Reset();
- break;
- }
- case EProcess:
- {
- // Cancel asynchronous processing
- iProcessor->CancelProcess();
- iCacheDestination->Reset();
- break;
- }
- default:
- {
- break;
- }
- }
-
- // Set state to inactive
- iViewerState = EInactive;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::RunL
-// -----------------------------------------------------------------------------
-void CIHLImageViewer::RunL()
- {
- User::LeaveIfError( iStatus.Int() );
-
-
- TInt err( KErrNone );
- switch( iViewerState )
- {
- case ELoad:
- {
- // Async load successful; start async processing if needed
- if( NeedAsyncProcess() )
- {
- err = AsyncProcess();
- if( !err )
- {
- iViewerState = EProcess;
- SetActive();
- }
- break;
- }
- else
- {
- iViewerState=EInactive;
- // Flowtrough to EProcess if no error
- err = SyncProcess();
- if( err )
- {
- break;
- }
- }
- }
- case EProcess:
- {
- // Process successful; finish and check if animation is needed
- err = Finish();
- if( !err )
- {
- TInt64 currentTime = User::FastCounter();
- if(iAnimDrawStartFastTime > 0)
- {
- iAnimLastFrameDrawTime=(currentTime-iAnimDrawStartFastTime)*1000000/iTickPeriod;
- }
-
- if( iIsPlaying )
- {
- iViewerState = EAnimation;
- SheduleNextFrame(iSource.AnimationFrameDelay( iAnimationIndex ));
- }
- else
- {
- iViewerState = EInactive;
- }
- // Notify client
- // NOTE! client may call any API method in this point!
- iObserver.ViewerBitmapChangedL();
- }
- break;
- }
- case EAnimation:
- {
- // Check if still playing..
- iAnimDrawStartFastTime = User::FastCounter();
- if( iIsPlaying )
- {
- // Change animation frame + 1
- UpdateAnimationIndex();
- err = AsyncLoad();
- if( !err )
- {
- iViewerState = ELoad;
- SetActive();
- }
- else
- {
- iViewerState = EInactive;
- }
- }
- else
- {
- iViewerState = EInactive;
- }
- break;
- }
- default:
- {
- // Internal state error, debug panic only
- #ifdef _DEBUG
- Panic( KErrGeneral );
- #endif
- }
- }
-
-
- User::LeaveIfError( err );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::RunError
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewer::RunError( TInt aError )
- {
- switch( iViewerState )
- {
- case ELoad:
- {
- // Cleanup cached source if load has been failed
- iCacheSource->Reset();
- break;
- }
- case EProcess:
- {
- // Cleanup cached destination if process has been failed
- iCacheDestination->Reset();
- break;
- }
- default:
- {
- break;
- }
- }
-
- iViewerState = EInactive;
- iObserver.ViewerError( aError );
- return KErrNone;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::Set
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewer::ApplySettings()
- {
- // Assert source rect and destination, debug build only
-#ifdef _DEBUG
- AssertSourceRectAndDestinationSize();
-#endif
-
- // Cancel current process if any
- Cancel();
-
- // Check if cached source bitmap is already valid for processing..
- TBool validSourceCache( EFalse );
- const CFbsBitmap& cacheSource = iCacheSource->Bitmap();
- if( cacheSource.Handle() )
- {
- const TSize cacheSize( cacheSource.SizeInPixels() );
- const TSize minLoadSize( MinimumSourceLoadSize() );
- if( cacheSize.iWidth >= minLoadSize.iWidth &&
- cacheSize.iHeight >= minLoadSize.iHeight )
- {
- validSourceCache = ETrue;
- }
- }
-
- // Start async load/process..
- TInt err( KErrNone );
- if( validSourceCache )
- {
- if( NeedAsyncProcess() )
- {
- err = AsyncProcess();
- if( !err )
- {
- iViewerState = EProcess;
- SetActive();
- }
- }
- else
- {
- err = SyncProcess();
- if( !err )
- {
- iViewerState = EProcess;
- SelfComplete();
- }
- }
- }
- else
- {
- err = AsyncLoad();
- if( !err )
- {
- iViewerState = ELoad;
- SetActive();
- }
- }
-
- return err;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::AsyncLoad
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewer::AsyncLoad()
- {
- // Internal state check, debug panic only
- __ASSERT_DEBUG( !iCacheDestination->Bitmap().Handle(), Panic( KErrGeneral ) );
-
- TInt err( KErrNone );
- if( !iSource.IsAnimation() )
- {
- // Do not reset animation frame because loading
- // might be faster if previous frame can be utilized
- iCacheSource->Reset();
- }
- if( !iCacheSource->Bitmap().Handle() )
- {
- TDisplayMode transparency( iSource.MaskDisplayMode() );
- if( transparency )
- {
- err = iCacheSource->Create( MinimumSourceLoadSize(),
- iSource.DisplayMode(),
- transparency );
- }
- else
- {
- err = iCacheSource->Create( MinimumSourceLoadSize(),
- iSource.DisplayMode() );
- }
- }
-
- // Load source bitmap
- if( !err )
- {
- if( iSource.IsAnimation() )
- {
- err = iSource.LoadAnimation( iStatus, *iCacheSource, iAnimationIndex );
- }
- else
- {
- err = iSource.Load( iStatus, *iCacheSource, iSource.ImageIndex() );
- }
-
- }
-
- // Error cleanup if needed
- if( err )
- {
- iCacheSource->Reset();
- }
- return err;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::NeedAsyncProcess
-// -----------------------------------------------------------------------------
-TBool CIHLImageViewer::NeedAsyncProcess()
- {
- // Internal state check, debug panic only
- __ASSERT_DEBUG( iCacheSource->Bitmap().Handle(), Panic( KErrGeneral ) );
- __ASSERT_DEBUG( !iCacheDestination->Bitmap().Handle(), Panic( KErrGeneral ) );
-
- // First check if destination size differs from source size
- // (=scaling needed)
- TSize scaledSrcSize( iCacheSource->Bitmap().SizeInPixels() );
- if( scaledSrcSize.iWidth != iDestinationSize.iWidth ||
- scaledSrcSize.iHeight != iDestinationSize.iHeight )
- {
- return ETrue;
- }
-
- // Then check if source rect and source size differs
- // (=clipping needed)
- if( iSourceRect.iTl != TPoint( 0,0 ) ||
- iSourceRect.iBr != iSource.Size().AsPoint() )
- {
- return ETrue;
- }
-
- // Finally check rotation and mirroring
- if( iRotationAngle == ERotationAngle0 &&
- !iHorizontalMirroring &&
- !iVerticalMirroring )
- {
- return EFalse;
- }
- else if( iRotationAngle == ERotationAngle180 &&
- iHorizontalMirroring &&
- iVerticalMirroring )
- {
- return EFalse;
- }
- else
- {
- return ETrue;
- }
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::AsyncProcess
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewer::AsyncProcess()
- {
- IHL_DEBUG1( KIHLDebug, "IHL - CIHLImageViewer - AsyncProcess" );
-
- // Internal state check, debug panic only
- __ASSERT_DEBUG( iCacheSource->Bitmap().Handle(), Panic( KErrGeneral ) );
- __ASSERT_DEBUG( !iCacheDestination->Bitmap().Handle(), Panic( KErrGeneral ) );
-
- const CFbsBitmap& srcBitmap = iCacheSource->Bitmap();
- const CFbsBitmap& srcMask = iCacheSource->Mask();
- TInt err( KErrNone );
-
- // Create new cached destination
- if( srcMask.Handle() )
- {
- err = iCacheDestination->Create( iDestinationSize,
- srcBitmap.DisplayMode(), srcMask.DisplayMode() );
- }
- else
- {
- err = iCacheDestination->Create( iDestinationSize, srcBitmap.DisplayMode() );
- }
-
- // Scale and clip bitmap from cached source to new cached destination
- if( !err )
- {
- TRect scaledSourceRect(
- CalculateProcessSourceRect( srcBitmap.SizeInPixels() ) );
-
- TRect destinationRect( CalculateProcessDestinationRect() );
-
- err = iProcessor->Process( iStatus, *iCacheSource, scaledSourceRect,
- *iCacheDestination, destinationRect );
- }
-
- // Error cleanup if needed
- if( err )
- {
- iCacheDestination->Reset();
- }
-
- return err;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::SyncProcess
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewer::SyncProcess()
- {
- IHL_DEBUG1( KIHLDebug, "IHL - CIHLImageViewer - SyncProcess" );
-
- // Internal state check, debug panic only
- __ASSERT_DEBUG( iCacheSource->Bitmap().Handle(), Panic( KErrGeneral ) );
- __ASSERT_DEBUG( !iCacheDestination->Bitmap().Handle(), Panic( KErrGeneral ) );
-
- // Duplicate destination cache to destination bitmap
- TInt err( iCacheDestination->Copy( *iCacheSource, EFalse ) );
- return err;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::Finish
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewer::Finish()
- {
- // Internal state check, debug panic only
- __ASSERT_DEBUG( iCacheDestination->Bitmap().Handle(), Panic( KErrGeneral ) );
-
- // Duplicate destination cache to destination bitmap
- TInt err( iDestination.Copy( *iCacheDestination, ETrue ) );
- iCacheDestination->Reset();
-
- // Error cleanup if needed
- if( err )
- {
- iDestination.Reset();
- }
- return err;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::UpdateAnimationIndex
-// -----------------------------------------------------------------------------
-void CIHLImageViewer::UpdateAnimationIndex()
- {
- // Internal state check, debug panic only
- __ASSERT_DEBUG( iIsPlaying, Panic( KErrGeneral ) );
-
- // Check if animation is in last frame
- if( iAnimationIndex == iSource.AnimationFrameCount() - 1 )
- {
- iAnimationIndex = 0;
- }
- else
- {
- // Not in last frame; move to next frame
- iAnimationIndex++;
- }
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::SelfComplete
-// -----------------------------------------------------------------------------
-void CIHLImageViewer::SelfComplete()
- {
- SetActive();
- iStatus = KRequestPending;
- TRequestStatus* status = &iStatus;
- User::RequestComplete( status, KErrNone );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::MinimumSourceLoadSize
-// -----------------------------------------------------------------------------
-TSize CIHLImageViewer::MinimumSourceLoadSize()
- {
- TSize minumumLoadSize( iSource.Size() );
-
- if( iSource.IsFullyScaleable() )
- {
- const TSize originalSize( iSource.Size() );
- switch( iRotationAngle )
- {
- case ERotationAngle0:
- case ERotationAngle180:
- {
- minumumLoadSize.iWidth = originalSize.iWidth * iDestinationSize.iWidth / Abs( iSourceRect.Width() );
- minumumLoadSize.iHeight = originalSize.iHeight * iDestinationSize.iHeight / Abs( iSourceRect.Height() );
- break;
- }
- case ERotationAngle90:
- case ERotationAngle270:
- {
- minumumLoadSize.iWidth = originalSize.iWidth * iDestinationSize.iWidth / Abs( iSourceRect.Height() );
- minumumLoadSize.iHeight = originalSize.iHeight * iDestinationSize.iHeight / Abs( iSourceRect.Width() );
- break;
- }
- default:
- {
- // Internal state error, debug panic only
- #ifdef _DEBUG
- Panic( KErrGeneral );
- #endif
- }
- }
-
- // Limit fully scaleable loadsize to original size
- if( minumumLoadSize.iWidth > originalSize.iWidth ||
- minumumLoadSize.iHeight > originalSize.iHeight )
- {
- minumumLoadSize = originalSize;
- }
- }
- else
- {
- const RArray& loadSizeArray = iSource.CustomLoadSizeArray();
- const TInt count( loadSizeArray.Count() );
-
- if( count )
- {
- TRect loadRect;
- TSize loadRectSize;
- TBool indexFound( EFalse );
- for( TInt i( 0 ); ( i < count ) && !indexFound; ++i )
- {
- loadRect = CalculateProcessSourceRect( loadSizeArray[ i ] );
- loadRectSize = loadRect.Size();
- loadRectSize.iWidth = Abs( loadRectSize.iWidth );
- loadRectSize.iHeight = Abs( loadRectSize.iHeight );
-
- if( iDestinationSize.iWidth <= loadRectSize.iWidth &&
- iDestinationSize.iHeight <= loadRectSize.iHeight )
- {
- minumumLoadSize = loadSizeArray[ i ];
- indexFound = ETrue;
- }
- }
- }
- }
-
- return minumumLoadSize;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::CalculateProcessSourceRect
-// -----------------------------------------------------------------------------
-TRect CIHLImageViewer::CalculateProcessSourceRect( const TSize& aLoadSize )
- {
- const TSize originalSize( iSource.Size() );
- TRect loadRect;
- if ( aLoadSize.iWidth > KErrNone && aLoadSize.iHeight > KErrNone )
- {
- loadRect.iTl.iX = iSourceRect.iTl.iX * aLoadSize.iWidth / originalSize.iWidth;
- loadRect.iTl.iY = iSourceRect.iTl.iY * aLoadSize.iHeight / originalSize.iHeight;
- loadRect.iBr.iX = iSourceRect.iBr.iX * aLoadSize.iWidth / originalSize.iWidth;
- loadRect.iBr.iY = iSourceRect.iBr.iY * aLoadSize.iHeight / originalSize.iHeight;
- }
- else
- {
- loadRect.SetRect(0,0,0,0);
- return loadRect;
- }
-
- switch( iRotationAngle )
- {
- case ERotationAngle0:
- {
- break;
- }
- case ERotationAngle90:
- {
- TInt tmp( loadRect.iTl.iY );
- loadRect.iTl.iY = loadRect.iBr.iY;
- loadRect.iBr.iY = tmp;
- break;
- }
- case ERotationAngle180:
- {
- TPoint tmp( loadRect.iTl );
- loadRect.iTl = loadRect.iBr;
- loadRect.iBr = tmp;
- break;
- }
- case ERotationAngle270:
- {
- TInt tmp( loadRect.iTl.iX );
- loadRect.iTl.iX = loadRect.iBr.iX;
- loadRect.iBr.iX = tmp;
- break;
- }
- default:
- {
- // Internal state error, debug panic only
- #ifdef _DEBUG
- Panic( KErrGeneral );
- #endif
- }
- }
-
- return loadRect;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::CalculateProcessDestinationRect
-// -----------------------------------------------------------------------------
-TRect CIHLImageViewer::CalculateProcessDestinationRect()
- {
- TRect dstRect( iDestinationSize );
- switch( iRotationAngle )
- {
- case ERotationAngle0:
- case ERotationAngle180:
- {
- if( iHorizontalMirroring )
- {
- TInt tmp( dstRect.iTl.iX );
- dstRect.iTl.iX = dstRect.iBr.iX;
- dstRect.iBr.iX = tmp;
- }
- if( iVerticalMirroring )
- {
- TInt tmp( dstRect.iTl.iY );
- dstRect.iTl.iY = dstRect.iBr.iY;
- dstRect.iBr.iY = tmp;
- }
- break;
- }
- case ERotationAngle90:
- case ERotationAngle270:
- {
- if( iHorizontalMirroring )
- {
- TInt tmp( dstRect.iTl.iY );
- dstRect.iTl.iY = dstRect.iBr.iY;
- dstRect.iBr.iY = tmp;
- }
- if( iVerticalMirroring )
- {
- TInt tmp( dstRect.iTl.iX );
- dstRect.iTl.iX = dstRect.iBr.iX;
- dstRect.iBr.iX = tmp;
- }
- break;
- }
- default:
- {
- // Internal state error, debug panic only
- #ifdef _DEBUG
- Panic( KErrGeneral );
- #endif
- }
- }
- return dstRect;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::CalculateZoomToFitRatio
-// -----------------------------------------------------------------------------
-void CIHLImageViewer::CalculateZoomToFitRatio()
- {
- TSize sourceSize( SourceSize() );
- TReal widthRatio( TReal( iViewerSize.iWidth ) / TReal( sourceSize.iWidth ) );
- TReal heightRatio( TReal( iViewerSize.iHeight ) / TReal( sourceSize.iHeight ) );
-
- if( iOptions & MIHLImageViewer::EOptionIgnoreAspectRatio )
- {
- iZoomToFitRatio = ( widthRatio > heightRatio ) ? widthRatio : heightRatio;
- }
- else
- {
- iZoomToFitRatio = ( widthRatio < heightRatio ) ? widthRatio : heightRatio;
- }
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::CalculateSourceRectAndDestinationSize
-// -----------------------------------------------------------------------------
-void CIHLImageViewer::CalculateSourceRectAndDestinationSize()
- {
- // Calculate new source rect
- TSize oldSourceRectSize( iSourceRect.Size() );
-
- TReal newSourceRectWidth;
- TReal newSourceRectHeight;
- TReal widthZoomRatio( iZoomRatio );
- TReal heightZoomRatio( iZoomRatio );
-
- if( iOptions & MIHLImageViewer::EOptionIgnoreAspectRatio )
- {
- TReal widthRatio( TReal( iViewerSize.iWidth ) / TReal( iSourceSize.iWidth ) );
- TReal heightRatio( TReal( iViewerSize.iHeight ) / TReal( iSourceSize.iHeight ) );
- if( widthRatio < heightRatio )
- {
- widthZoomRatio = widthZoomRatio * widthRatio / heightRatio;
- }
- else
- {
- heightZoomRatio = heightZoomRatio * heightRatio / widthRatio;
- }
- }
-
- if( iRotationAngle == ERotationAngle90 ||
- iRotationAngle == ERotationAngle270 )
- {
- newSourceRectWidth = iSrcBitmapScaleFactor * iViewerSize.iHeight / heightZoomRatio; //widthZoomRatio
- newSourceRectHeight = iSrcBitmapScaleFactor * iViewerSize.iWidth / widthZoomRatio; //heightZoomRatio
- }
- else
- {
- newSourceRectWidth = iSrcBitmapScaleFactor * iViewerSize.iWidth / widthZoomRatio;
- newSourceRectHeight = iSrcBitmapScaleFactor * iViewerSize.iHeight / heightZoomRatio;
- }
-
- // Check if source rect is not larger than source area
- if( newSourceRectWidth > iSourceSize.iWidth )
- {
- newSourceRectWidth = iSourceSize.iWidth;
- }
- if( newSourceRectHeight > iSourceSize.iHeight )
- {
- newSourceRectHeight = iSourceSize.iHeight;
- }
-
- // Rounding the results
- TReal roundedWidth;
- Math::Round( roundedWidth, newSourceRectWidth, 0 );
- TReal roundedHeight;
- Math::Round( roundedHeight, newSourceRectHeight, 0 );
-
- iSourceRect.SetWidth( (TInt)roundedWidth );
- iSourceRect.SetHeight( (TInt)roundedHeight );
-
- // Calculate actual destination size (always same or smaller than iViewerSize !)
- if( iRotationAngle == ERotationAngle90 ||
- iRotationAngle == ERotationAngle270 )
- {
- iDestinationSize.iWidth = (TInt)( newSourceRectHeight * widthZoomRatio ); //heightZoomRatio
- iDestinationSize.iHeight = (TInt)( newSourceRectWidth * heightZoomRatio ); //widthZoomRatio
- }
- else
- {
- iDestinationSize.iWidth = (TInt)( newSourceRectWidth * widthZoomRatio );
- iDestinationSize.iHeight = (TInt)( newSourceRectHeight * heightZoomRatio );
- }
- // Check that destination size is not rounded to zero
- if( iDestinationSize.iWidth == 0 )
- {
- iDestinationSize.iWidth = 1;
- }
- if( iDestinationSize.iHeight == 0 )
- {
- iDestinationSize.iHeight = 1;
- }
-
- // Move source rect keeping center point in same location
- iSourceRect.Move( ( oldSourceRectSize.iWidth - (TInt)newSourceRectWidth ) / 2,
- ( oldSourceRectSize.iHeight - (TInt)newSourceRectHeight ) / 2 );
-
- // Move rect if partially out of source area
- TPoint moveOffset( 0, 0 );
- if( iSourceRect.iTl.iX < 0 )
- {
- moveOffset.iX = -iSourceRect.iTl.iX;
- }
- else if( iSourceRect.iBr.iX > iSourceSize.iWidth )
- {
- moveOffset.iX = iSourceSize.iWidth - iSourceRect.iBr.iX;
- }
- if( iSourceRect.iTl.iY < 0 ) //lint !e961
- {
- moveOffset.iY = -iSourceRect.iTl.iY;
- }
- else if( iSourceRect.iBr.iY > iSourceSize.iHeight )
- {
- moveOffset.iY = iSourceSize.iHeight - iSourceRect.iBr.iY;
- }
- iSourceRect.Move( moveOffset ); //lint !e961
-
- // Assert that rectangle is valid, debug build only
-#ifdef _DEBUG
- AssertSourceRectAndDestinationSize();
-#endif
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewer::AssertSourceRectAndDestinationSize
-// Used in debug build only
-// -----------------------------------------------------------------------------
-#ifdef _DEBUG
-void CIHLImageViewer::AssertSourceRectAndDestinationSize()
- {
- if( iSourceRect.iTl.iX < 0 ||
- iSourceRect.iBr.iX > iSourceSize.iWidth ||
- iSourceRect.iTl.iY < 0 ||
- iSourceRect.iBr.iY > iSourceSize.iHeight ||
- iDestinationSize.iWidth <= 0 || iDestinationSize.iHeight <= 0 )
- {
- Panic( KErrGeneral );
- }
- }
-#endif
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlinglib/Src/CIHLImageViewer.h
--- a/imagehandlinglib/Src/CIHLImageViewer.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,374 +0,0 @@
-/*
-* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of Image Viewer class.
-*
-*/
-
-
-#ifndef CIHLIMAGEVIEWER_H
-#define CIHLIMAGEVIEWER_H
-
-// INCLUDES
-#include
-#include
-#include
-
-//FORWARD DECLARATIONS
-class MIHLFileImage;
-class MIHLBitmap;
-class MIHLViewerObserver;
-class CIHLBitmap;
-class CIHLBitmapProcessor;
-
-#define KMinimumInterval 10000
-
-// CLASS DECLARATION
-/**
-* CIHLImageViewer
-*
-* Image Viewer implementation class.
-* @lib IHL.lib
-* @since 3.0
-*/
-NONSHARABLE_CLASS( CIHLImageViewer ) : public CTimer, public MIHLImageViewer
- {
- public: // Constructors and destructor
-
- /**
- * Two-phased constructor.
- */
- static CIHLImageViewer* NewL( const TSize& aViewerSize,
- MIHLFileImage& aSource,
- MIHLBitmap& aDestination,
- MIHLViewerObserver& aObserver,
- const TUint32 aOptions );
-
- /*
- * Virtual destructor.
- */
- virtual ~CIHLImageViewer();
-
- public: // From base class MIHLViewer
-
- /*
- * From MIHLViewer, see base class header.
- */
- TIHLInterfaceType Type() const;
-
- public: // From base class MIHLImageViewer
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TBool IsAnimation() const;
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- void Play();
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- void Stop();
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TBool IsPlaying() const;
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TInt AnimationFrameCount() const;
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TInt AnimationFrame() const;
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TInt SetAnimationFrame( TInt aFrameIndex );
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TInt SetViewerSize( const TSize& aViewerSize, TInt srcBitmapScaleFactor = 1 );
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TSize ViewerSize() const;
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TInt MoveSourceRect( TInt aDx, TInt aDy );
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TInt SetSourceRectPosition( const TPoint& aPosition );
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TRect SourceRect() const;
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TSize SourceSize() const;
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TInt SetZoomRatio( TReal aZoomRatio );
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TReal ZoomRatio() const;
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TReal ZoomToFitRatio() const;
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TInt RotateClockwise();
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TInt RotateCounterClockwise();
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TInt SetRotationAngle( TInt aRotationAngle );
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TInt RotationAngle() const;
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TInt SetVerticalMirroring( TBool aValue );
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TBool VerticalMirroring() const;
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TInt SetHorizontalMirroring( TBool aValue );
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TBool HorizontalMirroring() const;
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- void SetFilter( MIHLFilter* aFilter );
-
- public: // From base class CTimer
-
- /*
- * From CTimer, see base class header.
- */
- void DoCancel();
-
- /*
- * From CTimer, see base class header.
- */
- void RunL();
-
- /*
- * From CTimer, see base class header.
- */
- TInt RunError( TInt aError );
-
- private: // Private methods
-
- /*
- * Start asynchronous processing with new settings.
- * This is needed always when settings are changed.
- */
- TInt ApplySettings();
-
- /*
- * Start load process source bitmap.
- */
- TInt AsyncLoad();
-
- /*
- * Check if process is needed.
- */
- TBool NeedAsyncProcess();
-
- /*
- * Start processing with new settings.
- */
- TInt AsyncProcess();
-
- /*
- * No external processing.
- * Just duplicates source to destination.
- */
- TInt SyncProcess();
-
- /*
- * Finish processing and notify client.
- */
- TInt Finish();
-
- /*
- * Update frame index when playing animation.
- */
- void UpdateAnimationIndex();
-
- /*
- * Complete dummy request. This causes RunL() method to be called.
- * Needed by state machine.
- */
- void SelfComplete();
-
- /*
- * Calculate minimum source bitmap size (using fixed loadsizes)
- * needed by processing and destination bitmap.
- */
- TSize MinimumSourceLoadSize();
-
- /*
- * Calculate source bitmap rectangle needed by processor.
- * Rectangle is affected by rotating and mirroring settings etc.
- */
- TRect CalculateProcessSourceRect( const TSize& aLoadSize );
-
- /*
- * Calculate destination bitmap rectangle needed by processor.
- * Rectangle is affected by rotating and mirroring settings etc.
- */
- TRect CalculateProcessDestinationRect();
-
- /*
- * Calculate needed zoomratio for "fit-to-screen" zooming.
- */
- void CalculateZoomToFitRatio();
-
- /*
- * Calculate source bitmap rectangle and destination bitmap size.
- * These values needs to be recalculated when rectangle setting is changed.
- */
- void CalculateSourceRectAndDestinationSize( );
-
- /*
- * Shedules next frame of animation in using aDelay CTimer::Hires().
- * If this is not the first frame the shedule time is decreased by
- * previous frame draw time.
- */
- void SheduleNextFrame(TTimeIntervalMicroSeconds32 aDelay);
-
- /*
- * Assert if source bitmap rectangle and destination bitmpa size are valid.
- * This method is called by CalculateSourceRectAndDestinationSize()
- */
-#ifdef _DEBUG
- void AssertSourceRectAndDestinationSize();
-#endif
-
- private: // Private constructors
-
- void ConstructL();
- CIHLImageViewer( const TSize& aViewerSize,
- MIHLFileImage& aSource,
- MIHLBitmap& aDestination,
- MIHLViewerObserver& aObserver,
- const TUint32 aOptions );
-
- private: // Private data types
-
- enum TViewerState
- {
- EInactive,
- ELoad,
- EProcess,
- EAnimation,
- };
-
- private: // Data
-
- // Viewer state
- TViewerState iViewerState;
-
- // Ref: Observers
- MIHLViewerObserver& iObserver;
-
- // Ref: Viewer source image
- MIHLFileImage& iSource;
- TSize iSourceSize;
- TRect iSourceRect;
-
- // Ref: Viewer destination bitmap
- MIHLBitmap& iDestination;
- TSize iDestinationSize;
-
- // Viewing settings
- const TUint32 iOptions;
- TSize iViewerSize;
- TReal iZoomRatio;
- TReal iZoomToFitRatio;
- TInt iRotationAngle;
- TBool iVerticalMirroring;
- TBool iHorizontalMirroring;
-
- // Own: Bitmap caches
- CIHLBitmap* iCacheSource;
- CIHLBitmap* iCacheDestination;
-
- // Own: Bitmap processor
- CIHLBitmapProcessor* iProcessor;
-
- // Animation info
- TBool iIsPlaying;
- TInt iAnimationIndex;
-
- // src bitmap scale factor
- TInt iSrcBitmapScaleFactor;
-
- // Animation time tweaking
- TInt64 iAnimInitFastTime; //clock ticks
- TInt64 iAnimDrawStartFastTime; //clock tics
- TInt iAnimLastFrameDrawTime; //micro seconds
- TInt iTickPeriod; //clock tick period
- TTimeIntervalMicroSeconds32 iAnimDelay;
-
-
-
- };
-
-#endif // CIHLIMAGEVIEWER_H
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlinglib/Src/CIHLImageViewerExtJpg.cpp
--- a/imagehandlinglib/Src/CIHLImageViewerExtJpg.cpp Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1037 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of Image Viewer class.
-*
-*/
-
-
-// INCLUDE FILES
-#include "CIHLImageViewerExtJpg.h"
-
-#include "CIHLBitmap.h"
-#include "CIHLBitmapProcessor.h"
-#include "IHLImplementationIds.h"
-#include
-#include
-#include
-#include
-#include "MIHLFileImageExtJpg.h"
-#include
-
-// Private namespace for constants and functions
-namespace
- {
- // Panic function
- _LIT( KIHLImageViewerExtJpgPanic, "IHLImageViewerExtJpg" );
- void Panic( TInt aPanicCode ) { User::Panic( KIHLImageViewerExtJpgPanic, aPanicCode ); }
- }
-
-// ============================ MEMBER FUNCTIONS ===============================
-// -----------------------------------------------------------------------------
-//
-// C++ constructor can NOT contain any code, that might leave.
-// -----------------------------------------------------------------------------
-CIHLImageViewerExtJpg::CIHLImageViewerExtJpg( const TSize& aViewerSize,
- MIHLFileImageExtJpg& aSource,
- MIHLBitmap& aDestination,
- MIHLViewerObserver& aObserver,
- const TUint32 aOptions )
-: CTimer( EPriorityNormal ), iObserver( aObserver ),
-iSource( aSource ), iDestination( aDestination ),
-iOptions( aOptions ), iViewerSize( aViewerSize ), iSrcBitmapScaleFactor(1)
- {
-
- CActiveScheduler::Add( this );
- }
-
-// -----------------------------------------------------------------------------
-//
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-CIHLImageViewerExtJpg* CIHLImageViewerExtJpg::NewL( const TSize& aViewerSize,
- MIHLFileImageExtJpg& aSource,
- MIHLBitmap& aDestination,
- MIHLViewerObserver& aObserver,
- const TUint32 aOptions )
- {
- CIHLImageViewerExtJpg* self = new( ELeave ) CIHLImageViewerExtJpg(
- aViewerSize, aSource, aDestination, aObserver, aOptions );
- CleanupStack::PushL( self );
- self->ConstructL();
- CleanupStack::Pop(); // self
- return self;
- }
-
-// -----------------------------------------------------------------------------
-//
-// Symbian constructor can leave.
-// -----------------------------------------------------------------------------
-void CIHLImageViewerExtJpg::ConstructL()
- {
- CTimer::ConstructL();
-
- iCacheSource = CIHLBitmap::NewL();
- iCacheDestination = CIHLBitmap::NewL();
-
- // Check codec capabilities
- iCapabilities = iSource.CapabilitiesL();
- if( !( iCapabilities & ( CExtJpegDecoder::ECapRotation +
- CExtJpegDecoder::ECapMirroring +
- CExtJpegDecoder::ECapFlipping ) ) )
- {
- iInternalProcessingNeeded = ETrue;
- iProcessor = CIHLBitmapProcessor::NewL( iOptions );
- }
-
- // Initialize settings and start load (default is zoom to fit)
- iSourceSize = iSource.Size();
- CalculateZoomToFitRatio();
- User::LeaveIfError( SetZoomRatio( iZoomToFitRatio ) );
- }
-
-// -----------------------------------------------------------------------------
-// Destructor
-// -----------------------------------------------------------------------------
-CIHLImageViewerExtJpg::~CIHLImageViewerExtJpg()
- {
- Cancel();
- if( iProcessor )
- {
- delete iProcessor;
- }
- delete iCacheSource;
- delete iCacheDestination;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::Id
-// -----------------------------------------------------------------------------
-TIHLInterfaceType CIHLImageViewerExtJpg::Type() const
- {
- return TIHLInterfaceType( KIHLInterfaceIdImageViewer, KIHLImplementationIdImageViewerExtJpg );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::IsAnimation
-// -----------------------------------------------------------------------------
-TBool CIHLImageViewerExtJpg::IsAnimation() const
- {
- return EFalse;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::Play
-// -----------------------------------------------------------------------------
-void CIHLImageViewerExtJpg::Play()
- {
-
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::Stop
-// -----------------------------------------------------------------------------
-void CIHLImageViewerExtJpg::Stop()
- {
-
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::IsPlaying
-// -----------------------------------------------------------------------------
-TBool CIHLImageViewerExtJpg::IsPlaying() const
- {
- return EFalse;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::AnimationFrameCount
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewerExtJpg::AnimationFrameCount() const
- {
- return KErrNone;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::AnimationFrame
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewerExtJpg::AnimationFrame() const
- {
- return KErrNone;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::SetAnimationFrame
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewerExtJpg::SetAnimationFrame( TInt /*aFrameIndex*/ )
- {
- return KErrNone;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::SetViewerSize
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewerExtJpg::SetViewerSize( const TSize& aViewerSize, int aSrcBitmapScaleFactor )
- {
- // Public API, negative value check -> panic also on hardware
- __ASSERT_ALWAYS( aViewerSize.iWidth >= 0 &&
- aViewerSize.iHeight >= 0, Panic( KErrArgument ) );
-
- iSrcBitmapScaleFactor = aSrcBitmapScaleFactor;
-
- // Save new viewer size
- iViewerSize = aViewerSize;
-
- // Recalculate source rect and destination size
- CalculateSourceRectAndDestinationSize();
-
- // Recalculate zoom to fit ratio
- CalculateZoomToFitRatio();
-
- // Start load
- return ApplySettings();
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::ViewerSize
-// -----------------------------------------------------------------------------
-TSize CIHLImageViewerExtJpg::ViewerSize() const
- {
- return iViewerSize;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::MoveSourceRect
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewerExtJpg::MoveSourceRect( TInt aDx, TInt aDy )
- {
- TInt dx( aDx );
- TInt dy( aDy );
- switch( iRotationAngle )
- {
- case ERotationAngle0:
- {
- break;
- }
- case ERotationAngle90:
- {
- dx = aDy;
- dy = -aDx;
- break;
- }
- case ERotationAngle180:
- {
- dx = -aDx;
- dy = -aDy;
- break;
- }
- case ERotationAngle270:
- {
- dx = -aDy;
- dy = aDx;
- break;
- }
- default:
- {
- // Internal state error, debug panic only
- #ifdef _DEBUG
- Panic( KErrGeneral );
- #endif
- }
- }
- if( iHorizontalMirroring )
- {
- dx = -dx;
- }
- if( iVerticalMirroring )
- {
- dy = -dy;
- }
-
- if( iSourceRect.iTl.iX + dx < 0 ||
- iSourceRect.iBr.iX + dx > iSourceSize.iWidth ||
- iSourceRect.iTl.iY + dy < 0 ||
- iSourceRect.iBr.iY + dy > iSourceSize.iHeight )
- {
- return KErrArgument;
- }
-
- iSourceRect.Move( dx, dy );
-
- // Start load
- return ApplySettings();
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::SetSourceRectPosition
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewerExtJpg::SetSourceRectPosition( const TPoint& aPosition )
- {
- TPoint newPosition( aPosition );
- TSize sourceRectSize( iSourceRect.Size() );
- switch( iRotationAngle )
- {
- case ERotationAngle0:
- {
- break;
- }
- case ERotationAngle90:
- {
- newPosition.iX = aPosition.iY;
- newPosition.iY = iSourceSize.iHeight - sourceRectSize.iHeight - aPosition.iX;
- break;
- }
- case ERotationAngle180:
- {
- newPosition.iX = iSourceSize.iWidth - sourceRectSize.iWidth - aPosition.iX;
- newPosition.iY = iSourceSize.iHeight - sourceRectSize.iHeight - aPosition.iY;
- break;
- }
- case ERotationAngle270:
- {
- newPosition.iX = iSourceSize.iWidth - sourceRectSize.iWidth - aPosition.iY;
- newPosition.iY = aPosition.iX;
- break;
- }
- default:
- {
- // Internal state error, debug panic only
- #ifdef _DEBUG
- Panic( KErrGeneral );
- #endif
- }
- }
- if( iHorizontalMirroring )
- {
- newPosition.iX = iSourceSize.iWidth - sourceRectSize.iWidth - newPosition.iX;
- }
- if( iVerticalMirroring )
- {
- newPosition.iY = iSourceSize.iHeight - sourceRectSize.iHeight - newPosition.iY;
- }
-
- if( newPosition.iX < 0 ||
- newPosition.iX > ( iSourceSize.iWidth - sourceRectSize.iWidth ) ||
- newPosition.iY < 0 ||
- newPosition.iY > ( iSourceSize.iHeight - sourceRectSize.iHeight ) )
- {
- return KErrArgument;
- }
-
- iSourceRect = TRect( newPosition, sourceRectSize );
-
- // Start load
- return ApplySettings();
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::SourceRect
-// -----------------------------------------------------------------------------
-TRect CIHLImageViewerExtJpg::SourceRect() const
- {
- TRect mirroredSourceRect( iSourceRect );
- if( iHorizontalMirroring )
- {
- mirroredSourceRect.iTl.iX = iSourceSize.iWidth - iSourceRect.iBr.iX;
- mirroredSourceRect.iBr.iX = iSourceSize.iWidth - iSourceRect.iTl.iX;
- }
- if( iVerticalMirroring )
- {
- mirroredSourceRect.iTl.iY = iSourceSize.iHeight - iSourceRect.iBr.iY;
- mirroredSourceRect.iBr.iY = iSourceSize.iHeight - iSourceRect.iTl.iY;
- }
-
- TRect rotatedSourceRect( mirroredSourceRect );
- switch( iRotationAngle )
- {
- case ERotationAngle0:
- {
- break;
- }
- case ERotationAngle90:
- {
- rotatedSourceRect.iTl.iX = iSourceSize.iHeight - mirroredSourceRect.iBr.iY;
- rotatedSourceRect.iTl.iY = mirroredSourceRect.iTl.iX;
- rotatedSourceRect.iBr.iX = iSourceSize.iHeight - mirroredSourceRect.iTl.iY;
- rotatedSourceRect.iBr.iY = mirroredSourceRect.iBr.iX;
- break;
- }
- case ERotationAngle180:
- {
- rotatedSourceRect.iTl.iX = iSourceSize.iWidth - mirroredSourceRect.iBr.iX;
- rotatedSourceRect.iTl.iY = iSourceSize.iHeight - mirroredSourceRect.iBr.iY;
- rotatedSourceRect.iBr.iX = iSourceSize.iWidth - mirroredSourceRect.iTl.iX;
- rotatedSourceRect.iBr.iY = iSourceSize.iHeight - mirroredSourceRect.iTl.iY;
- break;
- }
- case ERotationAngle270:
- {
- rotatedSourceRect.iTl.iX = mirroredSourceRect.iTl.iY;
- rotatedSourceRect.iTl.iY = iSourceSize.iWidth - mirroredSourceRect.iBr.iX;
- rotatedSourceRect.iBr.iX = mirroredSourceRect.iBr.iY;
- rotatedSourceRect.iBr.iY = iSourceSize.iWidth - mirroredSourceRect.iTl.iX;
- break;
- }
- default:
- {
- // Internal state error, debug panic only
- #ifdef _DEBUG
- Panic( KErrGeneral );
- #endif
- }
- }
-
- return rotatedSourceRect;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::SourceSize
-// -----------------------------------------------------------------------------
-TSize CIHLImageViewerExtJpg::SourceSize() const
- {
- if( iRotationAngle == ERotationAngle90 ||
- iRotationAngle == ERotationAngle270 )
- {
- return TSize( iSourceSize.iHeight, iSourceSize.iWidth );
- }
- else
- {
- return iSourceSize;
- }
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::SetZoomRatio
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewerExtJpg::SetZoomRatio( TReal aZoomRatio )
- {
- if( aZoomRatio <= 0 )
- {
- return KErrArgument;
- }
-
- iZoomRatio = aZoomRatio;
-
- // Recalculate source rect and destination size
- CalculateSourceRectAndDestinationSize();
-
- // Start load
- return ApplySettings();
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::ZoomRatio
-// -----------------------------------------------------------------------------
-TReal CIHLImageViewerExtJpg::ZoomRatio() const
- {
- return iZoomRatio;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::ZoomToFitRatio
-// -----------------------------------------------------------------------------
-TReal CIHLImageViewerExtJpg::ZoomToFitRatio() const
- {
- return iZoomToFitRatio;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::RotateClockwise
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewerExtJpg::RotateClockwise()
- {
- TInt rotationAngle( iRotationAngle + ERotationAngle90 );
- if( rotationAngle > ERotationAngle270 )
- {
- rotationAngle = ERotationAngle0;
- }
-
- return SetRotationAngle( rotationAngle );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::RotateCounterClockwise
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewerExtJpg::RotateCounterClockwise()
- {
- TInt rotationAngle( iRotationAngle - ERotationAngle90 );
- if( rotationAngle < ERotationAngle0 )
- {
- rotationAngle = ERotationAngle270;
- }
-
- return SetRotationAngle( rotationAngle );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::SetRotationAngle
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewerExtJpg::SetRotationAngle( TInt aRotationAngle )
- {
- if( aRotationAngle != ERotationAngle0 &&
- aRotationAngle != ERotationAngle90 &&
- aRotationAngle != ERotationAngle180 &&
- aRotationAngle != ERotationAngle270 )
- {
- return KErrArgument;
- }
-
- iRotationAngle = aRotationAngle;
-
- // Recalculate source rect and destination size
- CalculateSourceRectAndDestinationSize();
-
- // Recalculate zoom to fit ratio
- CalculateZoomToFitRatio();
-
- // Start load
- return ApplySettings();
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::RotationAngle
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewerExtJpg::RotationAngle() const
- {
- return iRotationAngle;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::SetVerticalMirroring
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewerExtJpg::SetVerticalMirroring( TBool aValue )
- {
- if( iVerticalMirroring != aValue )
- {
- iVerticalMirroring = aValue;
-
- // Start load
- return ApplySettings();
- }
- return KErrNone;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::VerticalMirroring
-// -----------------------------------------------------------------------------
-TBool CIHLImageViewerExtJpg::VerticalMirroring() const
- {
- return iVerticalMirroring;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::SetHorizontalMirroring
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewerExtJpg::SetHorizontalMirroring( TBool aValue )
- {
- if( iHorizontalMirroring != aValue )
- {
- iHorizontalMirroring = aValue;
- return ApplySettings();
- }
- return KErrNone;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::HorizontalMirroring
-// -----------------------------------------------------------------------------
-TBool CIHLImageViewerExtJpg::HorizontalMirroring() const
- {
- return iHorizontalMirroring;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::SetFilter
-// -----------------------------------------------------------------------------
-void CIHLImageViewerExtJpg::SetFilter( MIHLFilter* /*aFilter*/ )
- {
- // Not in use
- }
-
-
-
-// Private methods
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::DoCancel
-// -----------------------------------------------------------------------------
-void CIHLImageViewerExtJpg::DoCancel()
- {
- CTimer::DoCancel();
- // Set state to inactive
- switch( iViewerState )
- {
- case ELoad:
- {
- // Cancel asynchronous source loading
- iSource.CancelLoad();
- iCacheSource->Reset();
- break;
- }
- case EProcess:
- {
- // Cancel asynchronous processing
- iProcessor->CancelProcess();
- iCacheDestination->Reset();
- break;
- }
- default:
- {
- break;
- }
- }
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::RunL
-// -----------------------------------------------------------------------------
-void CIHLImageViewerExtJpg::RunL()
- {
- User::LeaveIfError( iStatus.Int() );
-
- // Save previous state and set current state immediately
- // to inactive to keep state up-to-date
- TViewerState prevState( iViewerState );
- iViewerState = EInactive;
-
- switch( prevState )
- {
- case ELoad:
- {
- //Use the internal processor if the codec is lacking some processing capability
- if( iInternalProcessingNeeded )
- {
- const CFbsBitmap& srcBitmap = iCacheSource->Bitmap();
- User::LeaveIfError( iCacheDestination->Create( iDestinationSize, srcBitmap.DisplayMode() ) );
- TRect processSourceRect( CalculateProcessSourceRect( iCacheSource->Bitmap().SizeInPixels() ) );
- TRect destinationRect( CalculateProcessDestinationRect() );
-
- User::LeaveIfError( iProcessor->Process( iStatus, *iCacheSource, processSourceRect,
- *iCacheDestination, destinationRect ) );
-
- iViewerState = EProcess;
- SetActive();
- }
- else
- {
- User::LeaveIfError( Finish() );
- iObserver.ViewerBitmapChangedL();
- }
- break;
- }
- case EProcess:
- {
- User::LeaveIfError( Finish() );
- iObserver.ViewerBitmapChangedL();
- break;
- }
- default:
- {
- // Internal state error, debug panic only
- #ifdef _DEBUG
- Panic( KErrGeneral );
- #endif
- }
- }
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::RunError
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewerExtJpg::RunError( TInt aError )
- {
- switch( iViewerState )
- {
- case ELoad:
- {
- // Cleanup cached source if load has been failed
- iCacheSource->Reset();
- break;
- }
- case EProcess:
- {
- // Cleanup cached destination if process has been failed
- iCacheDestination->Reset();
- break;
- }
- default:
- {
- break;
- }
- }
-
- iViewerState = EInactive;
- iObserver.ViewerError( aError );
- return KErrNone;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::ApplySettings
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewerExtJpg::ApplySettings()
- {
- // Assert source rect and destination, debug build only
-#ifdef _DEBUG
- AssertSourceRectAndDestinationSize();
-#endif
-
- // Cancel current process if any
- Cancel();
-
- // Perform processing if supported by codec
- if( !iInternalProcessingNeeded )
- {
- TRAPD( err, iSource.SetRotationL( iRotationAngle ) );
- if( !err && iHorizontalMirroring )
- {
- TRAP( err, iSource.SetFlippingL() );
- }
- if( !err && iVerticalMirroring )
- {
- TRAP( err, iSource.SetMirroringL() );
- }
- if( err )
- {
- return err;
- }
- }
-
- // Start async load/process.
- TInt err( KErrNone );
-
- err = AsyncLoad();
- if( !err )
- {
- iViewerState = ELoad;
- SetActive();
- }
-
- return err;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::AsyncLoad
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewerExtJpg::AsyncLoad()
- {
- // Internal state check, debug panic only
- __ASSERT_DEBUG( !iCacheDestination->Bitmap().Handle(), Panic( KErrGeneral ) );
-
- TInt err( KErrNone );
-
- // Load source bitmap
-
- iCacheSource->Reset();
-
- err = iCacheSource->Create( iDestinationSize, iSource.DisplayMode() );
-
- if( !err )
- {
- err = iSource.Load( iSourceRect, iStatus, *iCacheSource );
- }
-
- // Error cleanup if needed
- if( err )
- {
- iCacheSource->Reset();
- }
- return err;
- }
-
-
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::Finish
-// -----------------------------------------------------------------------------
-TInt CIHLImageViewerExtJpg::Finish()
- {
- // Internal state check, debug panic only
- __ASSERT_DEBUG( iCacheSource->Bitmap().Handle(), Panic( KErrGeneral ) );
-
- TInt err( KErrNone );
-
- // Check if internal processor was used
- if( iInternalProcessingNeeded )
- {
- err = iDestination.Copy( *iCacheDestination, ETrue );
- iCacheDestination->Reset();
- }
- else
- {
- err = iDestination.Copy( *iCacheSource, ETrue );
- iCacheSource->Reset();
- }
-
- // Error cleanup if needed
- if( err )
- {
- iDestination.Reset();
- }
-
- return err;
- }
-
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::SelfComplete
-// -----------------------------------------------------------------------------
-void CIHLImageViewerExtJpg::SelfComplete()
- {
- SetActive();
- iStatus = KRequestPending;
- TRequestStatus* status = &iStatus;
- User::RequestComplete( status, KErrNone );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::CalculateProcessSourceRect
-// -----------------------------------------------------------------------------
-TRect CIHLImageViewerExtJpg::CalculateProcessSourceRect( const TSize& aSourceCacheSize )
- {
-
- TRect loadRect( aSourceCacheSize );
-
- switch( iRotationAngle )
- {
- case ERotationAngle0:
- {
- break;
- }
- case ERotationAngle90:
- {
- TInt tmp( loadRect.iTl.iY );
- loadRect.iTl.iY = loadRect.iBr.iY;
- loadRect.iBr.iY = tmp;
- break;
- }
- case ERotationAngle180:
- {
- TPoint tmp( loadRect.iTl );
- loadRect.iTl = loadRect.iBr;
- loadRect.iBr = tmp;
- break;
- }
- case ERotationAngle270:
- {
- TInt tmp( loadRect.iTl.iX );
- loadRect.iTl.iX = loadRect.iBr.iX;
- loadRect.iBr.iX = tmp;
- break;
- }
- default:
- {
- // Internal state error, debug panic only
- #ifdef _DEBUG
- Panic( KErrGeneral );
- #endif
- }
- }
-
- return loadRect;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::CalculateProcessDestinationRect
-// -----------------------------------------------------------------------------
-TRect CIHLImageViewerExtJpg::CalculateProcessDestinationRect()
- {
- TRect dstRect( iDestinationSize );
- switch( iRotationAngle )
- {
- case ERotationAngle0:
- case ERotationAngle180:
- {
- if( iHorizontalMirroring )
- {
- TInt tmp( dstRect.iTl.iX );
- dstRect.iTl.iX = dstRect.iBr.iX;
- dstRect.iBr.iX = tmp;
- }
- if( iVerticalMirroring )
- {
- TInt tmp( dstRect.iTl.iY );
- dstRect.iTl.iY = dstRect.iBr.iY;
- dstRect.iBr.iY = tmp;
- }
- break;
- }
- case ERotationAngle90:
- case ERotationAngle270:
- {
- if( iHorizontalMirroring )
- {
- TInt tmp( dstRect.iTl.iY );
- dstRect.iTl.iY = dstRect.iBr.iY;
- dstRect.iBr.iY = tmp;
- }
- if( iVerticalMirroring )
- {
- TInt tmp( dstRect.iTl.iX );
- dstRect.iTl.iX = dstRect.iBr.iX;
- dstRect.iBr.iX = tmp;
- }
- break;
- }
- default:
- {
- // Internal state error, debug panic only
- #ifdef _DEBUG
- Panic( KErrGeneral );
- #endif
- }
- }
- return dstRect;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::CalculateZoomToFitRatio
-// -----------------------------------------------------------------------------
-void CIHLImageViewerExtJpg::CalculateZoomToFitRatio()
- {
- TSize sourceSize( SourceSize() );
- TReal widthRatio( TReal( iViewerSize.iWidth ) / TReal( sourceSize.iWidth ) );
- TReal heightRatio( TReal( iViewerSize.iHeight ) / TReal( sourceSize.iHeight ) );
-
- if( iOptions & MIHLImageViewer::EOptionIgnoreAspectRatio )
- {
- iZoomToFitRatio = ( widthRatio > heightRatio ) ? widthRatio : heightRatio;
- }
- else
- {
- iZoomToFitRatio = ( widthRatio < heightRatio ) ? widthRatio : heightRatio;
- }
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::CalculateSourceRectAndDestinationSize
-// -----------------------------------------------------------------------------
-void CIHLImageViewerExtJpg::CalculateSourceRectAndDestinationSize()
- {
- // Calculate new source rect
- TSize oldSourceRectSize( iSourceRect.Size() );
-
- TReal newSourceRectWidth;
- TReal newSourceRectHeight;
- TReal widthZoomRatio( iZoomRatio );
- TReal heightZoomRatio( iZoomRatio );
-
- if( iOptions & MIHLImageViewer::EOptionIgnoreAspectRatio )
- {
- TReal widthRatio( TReal( iViewerSize.iWidth ) / TReal( iSourceSize.iWidth ) );
- TReal heightRatio( TReal( iViewerSize.iHeight ) / TReal( iSourceSize.iHeight ) );
- if( widthRatio < heightRatio )
- {
- widthZoomRatio = widthZoomRatio * widthRatio / heightRatio;
- }
- else
- {
- heightZoomRatio = heightZoomRatio * heightRatio / widthRatio;
- }
- }
-
- if( iRotationAngle == ERotationAngle90 ||
- iRotationAngle == ERotationAngle270 )
- {
- newSourceRectWidth = iSrcBitmapScaleFactor * iViewerSize.iHeight / heightZoomRatio; //widthZoomRatio
- newSourceRectHeight = iSrcBitmapScaleFactor * iViewerSize.iWidth / widthZoomRatio; //heightZoomRatio
- }
- else
- {
- newSourceRectWidth = iSrcBitmapScaleFactor * iViewerSize.iWidth / widthZoomRatio;
- newSourceRectHeight = iSrcBitmapScaleFactor * iViewerSize.iHeight / heightZoomRatio;
- }
-
- // Check if source rect is not larger than source area
- if( newSourceRectWidth > iSourceSize.iWidth )
- {
- newSourceRectWidth = iSourceSize.iWidth;
- }
- if( newSourceRectHeight > iSourceSize.iHeight )
- {
- newSourceRectHeight = iSourceSize.iHeight;
- }
- iSourceRect.SetWidth( (TInt)newSourceRectWidth );
- iSourceRect.SetHeight( (TInt)newSourceRectHeight );
-
- // Calculate actual destination size (always same or smaller than iViewerSize !)
- if( iRotationAngle == ERotationAngle90 ||
- iRotationAngle == ERotationAngle270 )
- {
- iDestinationSize.iWidth = (TInt)( newSourceRectHeight * widthZoomRatio ); //heightZoomRatio
- iDestinationSize.iHeight = (TInt)( newSourceRectWidth * heightZoomRatio ); //widthZoomRatio
- }
- else
- {
- iDestinationSize.iWidth = (TInt)( newSourceRectWidth * widthZoomRatio );
- iDestinationSize.iHeight = (TInt)( newSourceRectHeight * heightZoomRatio );
- }
- // Check that destination size is not rounded to zero
- if( iDestinationSize.iWidth == 0 )
- {
- iDestinationSize.iWidth = 1;
- }
- if( iDestinationSize.iHeight == 0 )
- {
- iDestinationSize.iHeight = 1;
- }
-
- // Move source rect keeping center point in same location
- iSourceRect.Move( ( oldSourceRectSize.iWidth - (TInt)newSourceRectWidth ) / 2,
- ( oldSourceRectSize.iHeight - (TInt)newSourceRectHeight ) / 2 );
-
- // Move rect if partially out of source area
- TPoint moveOffset( 0, 0 );
- if( iSourceRect.iTl.iX < 0 )
- {
- moveOffset.iX = -iSourceRect.iTl.iX;
- }
- else if( iSourceRect.iBr.iX > iSourceSize.iWidth )
- {
- moveOffset.iX = iSourceSize.iWidth - iSourceRect.iBr.iX;
- }
- if( iSourceRect.iTl.iY < 0 ) //lint !e961
- {
- moveOffset.iY = -iSourceRect.iTl.iY;
- }
- else if( iSourceRect.iBr.iY > iSourceSize.iHeight )
- {
- moveOffset.iY = iSourceSize.iHeight - iSourceRect.iBr.iY;
- }
- iSourceRect.Move( moveOffset ); //lint !e961
-
- // Assert that rectangle is valid, debug build only
-#ifdef _DEBUG
- AssertSourceRectAndDestinationSize();
-#endif
- }
-
-// -----------------------------------------------------------------------------
-// CIHLImageViewerExtJpg::AssertSourceRectAndDestinationSize
-// Used in debug build only
-// -----------------------------------------------------------------------------
-#ifdef _DEBUG
-void CIHLImageViewerExtJpg::AssertSourceRectAndDestinationSize()
- {
- if( iSourceRect.iTl.iX < 0 ||
- iSourceRect.iBr.iX > iSourceSize.iWidth ||
- iSourceRect.iTl.iY < 0 ||
- iSourceRect.iBr.iY > iSourceSize.iHeight ||
- iDestinationSize.iWidth <= 0 || iDestinationSize.iHeight <= 0 )
- {
- Panic( KErrGeneral );
- }
- }
-#endif
-
-// End of File
-
-
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlinglib/Src/CIHLImageViewerExtJpg.h
--- a/imagehandlinglib/Src/CIHLImageViewerExtJpg.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,332 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of Image Viewer class.
-*
-*/
-
-
-#ifndef CIHLIMAGEVIEWEREXTJPG_H
-#define CIHLIMAGEVIEWEREXTJPG_H
-
-// INCLUDES
-#include "MIHLImageViewer.h"
-#include
-
-//FORWARD DECLARATIONS
-class MIHLFileImageExtJpg;
-class MIHLBitmap;
-class MIHLViewerObserver;
-class CIHLBitmap;
-class CIHLBitmapProcessor;
-
-// CLASS DECLARATION
-/**
-* CIHLImageViewer
-*
-* Image Viewer implementation class.
-* @lib IHL.lib
-* @since 3.0
-*/
-NONSHARABLE_CLASS( CIHLImageViewerExtJpg ) : public CTimer, public MIHLImageViewer
- {
- public: // Constructors and destructor
-
- /**
- * Two-phased constructor.
- */
- static CIHLImageViewerExtJpg* NewL( const TSize& aViewerSize,
- MIHLFileImageExtJpg& aSource,
- MIHLBitmap& aDestination,
- MIHLViewerObserver& aObserver,
- const TUint32 aOptions );
-
- /*
- * Virtual destructor.
- */
- virtual ~CIHLImageViewerExtJpg();
-
- public: // From base class MIHLViewer
-
- /*
- * From MIHLViewer, see base class header.
- */
- TIHLInterfaceType Type() const;
-
- public:
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TBool IsAnimation() const;
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- void Play();
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- void Stop();
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TBool IsPlaying() const;
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TInt AnimationFrameCount() const;
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TInt AnimationFrame() const;
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TInt SetAnimationFrame( TInt aFrameIndex );
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TInt SetViewerSize( const TSize& aViewerSize, TInt srcBitmapScaleFactor = 1 );
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TSize ViewerSize() const;
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TInt MoveSourceRect( TInt aDx, TInt aDy );
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TInt SetSourceRectPosition( const TPoint& aPosition );
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TRect SourceRect() const;
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TSize SourceSize() const;
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TInt SetZoomRatio( TReal aZoomRatio );
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TReal ZoomRatio() const;
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TReal ZoomToFitRatio() const;
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TInt RotateClockwise();
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TInt RotateCounterClockwise();
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TInt SetRotationAngle( TInt aRotationAngle );
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TInt RotationAngle() const;
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TInt SetVerticalMirroring( TBool aValue );
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TBool VerticalMirroring() const;
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TInt SetHorizontalMirroring( TBool aValue );
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- TBool HorizontalMirroring() const;
-
- /*
- * From MIHLImageViewer, see base class header.
- */
- void SetFilter( MIHLFilter* aFilter );
-
- public:
-
-
-
- public: // From base class CTimer
-
- /*
- * From CTimer, see base class header.
- */
- void DoCancel();
-
- /*
- * From CTimer, see base class header.
- */
- void RunL();
-
- /*
- * From CTimer, see base class header.
- */
- TInt RunError( TInt aError );
-
-
- private: // Private methods
-
- /*
- * Start asynchronous processing with new settings.
- * This is needed always when settings are changed.
- */
- TInt ApplySettings();
-
- /*
- * Start load process source bitmap.
- */
- TInt AsyncLoad();
-
- /*
- * Finish processing and notify client.
- */
- TInt Finish();
-
- /*
- * Complete dummy request. This causes RunL() method to be called.
- * Needed by state machine.
- */
- void SelfComplete();
-
- /*
- * Calculate source bitmap rectangle needed by processor.
- * Rectangle is affected by rotating and mirroring settings etc.
- */
- TRect CalculateProcessSourceRect( const TSize& aSourceCacheSize );
-
- /*
- * Calculate destination bitmap rectangle needed by processor.
- * Rectangle is affected by rotating and mirroring settings etc.
- */
- TRect CalculateProcessDestinationRect();
-
- /*
- * Calculate needed zoomratio for "fit-to-screen" zooming.
- */
- void CalculateZoomToFitRatio();
-
- /*
- * Calculate source bitmap rectangle and destination bitmap size.
- * These values needs to be recalculated when rectangle setting is changed.
- */
- void CalculateSourceRectAndDestinationSize();
-
- /*
- * Assert if source bitmap rectangle and destination bitmpa size are valid.
- * This method is called by CalculateSourceRectAndDestinationSize()
- */
-#ifdef _DEBUG
- void AssertSourceRectAndDestinationSize();
-#endif
-
- private: // Private constructors
-
- void ConstructL();
- CIHLImageViewerExtJpg( const TSize& aViewerSize,
- MIHLFileImageExtJpg& aSource,
- MIHLBitmap& aDestination,
- MIHLViewerObserver& aObserver,
- const TUint32 aOptions );
-
- private: // Private data types
-
- enum TViewerState
- {
- EInactive,
- ELoad,
- EProcess
- };
-
- private: // Data
-
- // Viewer state
- TViewerState iViewerState;
-
- // Ref: Observers
- MIHLViewerObserver& iObserver;
-
- // Ref: Viewer source image
- MIHLFileImageExtJpg& iSource;
- TSize iSourceSize;
- TRect iSourceRect;
-
- // Ref: Viewer destination bitmap
- MIHLBitmap& iDestination;
- TSize iDestinationSize;
-
- // Viewing settings
- const TUint32 iOptions;
- TSize iViewerSize;
- TReal iZoomRatio;
- TReal iZoomToFitRatio;
- TInt iRotationAngle;
- TBool iVerticalMirroring;
- TBool iHorizontalMirroring;
-
- // Decoder capabilities
- TInt iCapabilities;
-
- // Internal processor flag
- TBool iInternalProcessingNeeded;
-
- // Own: Bitmap caches
- CIHLBitmap* iCacheSource;
- CIHLBitmap* iCacheDestination;
- // Own: Bitmap processor
- CIHLBitmapProcessor* iProcessor;
- // src bitmap scale factor
- TInt iSrcBitmapScaleFactor;
-
- };
-
-#endif // CIHLIMAGEVIEWEREXTJPG_H
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlinglib/Src/CIHLScaler.cpp
--- a/imagehandlinglib/Src/CIHLScaler.cpp Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1315 +0,0 @@
-/*
-* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of Scaling processor
-* : using Font and Bitmap Server bitmaps.
-*
-*/
-
-// INCLUDE FILES
-#include "CIHLScaler.h"
-#include "IHLDebugPrint.h" // Debug print
-#include // MIHLImageViewer
-#include
-#include
-
-// Private namespace for constants and functions
-namespace
- {
- // Processed pixels per one activesheduler step
- const TInt KProcessPixelsPerStep = 16384;
-
- // These make the fast path scalings step out about every 5-10ms
- // no reason to cut more aggressively since it just slows down everything
- const TInt KBytesPerStepFastPath = 640*480;
- const TInt KBytesPerStepFastPathScaleOnly = 640*480*2;
-
- const TInt KStepPrecision = 16; // 16 bit = 65k subpixels
- const TInt KMaxProcessSize = KMaxTInt / 2;
- }
-
-//functions and typedefs used inside ProcessBilinear scaling
-namespace
- {
- // using our own RGB instead of TRGB as we need TInt32 for each value
- typedef struct
- {
- TInt32 r, g, b, a;
- } TColorRGB;
-
- // structure for handling data of 4 pixels
- typedef struct
- {
- TColorRGB colXY00, colXY01, colXY10, colXY11;
- TColorRGB col0, col1, col;
- } TPixelData;
-
- // functions to handle conversion between TColorRGB and colr value stored in TInt32
- inline void IntToRgb(TInt32 aIntRGB_val, TColorRGB &col)
- {
- col.r = (aIntRGB_val >> 16) & 0x00ff;
- col.g = (aIntRGB_val >> 8) & 0x00ff;
- col.b = aIntRGB_val & 0x00ff;
- col.a = (aIntRGB_val >> 24) & 0x00ff;
- }
- inline TUint32 RgbToInt(TColorRGB &col)
- {
- return 0x00000000 | ( ( col.r & 0xff) << 16 ) | ( ( col.g & 0xff) << 8 )
- | ( col.b & 0xff) | ( ( col.a & 0xff) << 24 );
- }
-
- // function which interpolates color using gathered data
- inline void ProcessColorData( TPixelData &dat, TPoint aSrcPos )
- {
- TInt32 pixel_width = 1 << KStepPrecision;
-
- //first pass (Y axis)
- dat.col0.r = (dat.colXY01.r - dat.colXY00.r)*(aSrcPos.iY % pixel_width) / pixel_width + dat.colXY00.r;
- dat.col0.g = (dat.colXY01.g - dat.colXY00.g)*(aSrcPos.iY % pixel_width) / pixel_width + dat.colXY00.g;
- dat.col0.b = (dat.colXY01.b - dat.colXY00.b)*(aSrcPos.iY % pixel_width) / pixel_width + dat.colXY00.b;
- dat.col0.a = (dat.colXY01.a - dat.colXY00.a)*(aSrcPos.iY % pixel_width) / pixel_width + dat.colXY00.a;
-
- dat.col1.r = (dat.colXY11.r - dat.colXY10.r)*(aSrcPos.iY % pixel_width) / pixel_width + dat.colXY10.r;
- dat.col1.g = (dat.colXY11.g - dat.colXY10.g)*(aSrcPos.iY % pixel_width) / pixel_width + dat.colXY10.g;
- dat.col1.b = (dat.colXY11.b - dat.colXY10.b)*(aSrcPos.iY % pixel_width) / pixel_width + dat.colXY10.b;
- dat.col1.a = (dat.colXY11.a - dat.colXY10.a)*(aSrcPos.iY % pixel_width) / pixel_width + dat.colXY10.a;
-
- //second pass (X axis)
- dat.col.r = (dat.col1.r - dat.col0.r)*(aSrcPos.iX % pixel_width) / pixel_width + dat.col0.r;
- dat.col.g = (dat.col1.g - dat.col0.g)*(aSrcPos.iX % pixel_width) / pixel_width + dat.col0.g;
- dat.col.b = (dat.col1.b - dat.col0.b)*(aSrcPos.iX % pixel_width) / pixel_width + dat.col0.b;
- dat.col.a = (dat.col1.a - dat.col0.a)*(aSrcPos.iX % pixel_width) / pixel_width + dat.col0.a;
- }
- }
-
-// ======================== STATIC FACTORY FUNCTION ============================
-// -----------------------------------------------------------------------------
-// IHLScaler::CreateL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C MIHLScaler* IHLScaler::CreateL( const TUint32 aOptions )
- {
- return CIHLScaler::NewL( aOptions );
- }
-
-// ============================ MEMBER FUNCTIONS ===============================
-// -----------------------------------------------------------------------------
-//
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-CIHLScaler::CIHLScaler( const TUint32 aOptions )
-:CActive( CActive::EPriorityStandard ), iOptions( aOptions )
- {
- CActiveScheduler::Add( this );
- }
-
-// -----------------------------------------------------------------------------
-//
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-CIHLScaler* CIHLScaler::NewL( const TUint32 aOptions )
- {
- CIHLScaler* self = new( ELeave ) CIHLScaler( aOptions );
- return self;
- }
-
-// -----------------------------------------------------------------------------
-// Destructor
-// -----------------------------------------------------------------------------
-CIHLScaler::~CIHLScaler()
- {
- Cancel();
- }
-
-// -----------------------------------------------------------------------------
-// CIHLScaler::Scale
-// -----------------------------------------------------------------------------
-TInt CIHLScaler::Scale( TRequestStatus& aStatus,
- const CFbsBitmap& aSrcBitmap, const TRect& aSrcRect,
- CFbsBitmap& aDstBitmap, const TRect& aDstRect )
- {
- if( IsBusy() )
- {
- return KErrNotReady;
- }
-
- TSize srcRectSize( aSrcRect.Size() );
- TSize dstRectSize( aDstRect.Size() );
- if( Abs( srcRectSize.iWidth ) > KMaxProcessSize ||
- Abs( srcRectSize.iHeight ) > KMaxProcessSize ||
- Abs( dstRectSize.iWidth ) > KMaxProcessSize ||
- Abs( dstRectSize.iHeight ) > KMaxProcessSize )
- {
- return KErrTooBig;
- }
-
- if( !aSrcBitmap.Handle() ||
- !IsValidRect( aSrcBitmap.SizeInPixels(), aSrcRect ) )
- {
- return KErrArgument;
- }
-
- if( aDstBitmap.Handle() )
- {
- if( !IsValidRect( aDstBitmap.SizeInPixels(), aDstRect ) )
- {
- return KErrArgument;
- }
- }
- else
- {
- // Create destination bitmap
- TSize dstSize( Abs( dstRectSize.iWidth ), Abs( dstRectSize.iHeight ) );
- TInt err = aDstBitmap.Create( dstSize, aSrcBitmap.DisplayMode() );
- if( err )
- {
- return err;
- }
- }
-
-#ifdef RD_MEASURE_THROUGHPUT
- iStartTime = User::FastCounter(); // For measuring scaler throughput
-#endif
-
- TSize srcSize( aSrcBitmap.SizeInPixels() );
- TSize dstSize( aDstBitmap.SizeInPixels() );
-
- if( srcSize.iWidth == 0 || srcSize.iHeight == 0 ||
- dstSize.iWidth == 0 || dstSize.iHeight == 0 ||
- aSrcRect.iTl.iX == aSrcRect.iBr.iX ||
- aSrcRect.iTl.iY == aSrcRect.iBr.iY ||
- aDstRect.iTl.iX == aDstRect.iBr.iX ||
- aDstRect.iTl.iY == aDstRect.iBr.iY )
- {
- // Bitmap or rect width or height is zero so there is nothing to do.
- // Complete process without error.
- iNeedProcess = EFalse;
- }
- else
- {
- iNeedProcess = ETrue;
-
- // Set parameters to member data references
- iSrcBitmap = &aSrcBitmap;
- iSrcRect = aSrcRect;
- iDstBitmap = &aDstBitmap;
- iDstRect = aDstRect;
-
- TDisplayMode srcMode(iSrcBitmap->DisplayMode());
- TDisplayMode dstMode(iDstBitmap->DisplayMode());
-
- IHL_DEBUG3( KIHLDebug1, "CIHLScaler: src bitmap size %dx%d", srcSize.iWidth, srcSize.iHeight);
- IHL_DEBUG3( KIHLDebug2, "CIHLScaler: dst bitmap size %dx%d", dstSize.iWidth, dstSize.iHeight);
- IHL_DEBUG5( KIHLDebug3, "CIHLScaler: src bitmap rect %d.%d -> %d.%d", iSrcRect.iTl.iX, iSrcRect.iTl.iY, iSrcRect.iBr.iX, iSrcRect.iBr.iY);
- IHL_DEBUG5( KIHLDebug4, "CIHLScaler: dst bitmap rect %d.%d -> %d.%d", iDstRect.iTl.iX, iDstRect.iTl.iY, iDstRect.iBr.iX, iDstRect.iBr.iY);
- IHL_DEBUG2( KIHLDebug5, "CIHLScaler: src bitmap mode %d", srcMode);
- IHL_DEBUG2( KIHLDebug6, "CIHLScaler: dst bitmap mode %d", dstMode);
- IHL_DEBUG2( KIHLDebug7, "CIHLScaler: src compressed %d", iSrcBitmap->IsCompressedInRAM());
- IHL_DEBUG2( KIHLDebug8, "CIHLScaler: dst compressed %d", iSrcBitmap->IsCompressedInRAM());
-
- // Init stepper values
- TBool onlyScaling = InitStepperValues();
-
- // Select correct code path
- InitCodePath(srcSize, srcMode, dstSize, dstMode, onlyScaling);
- }
-
- IHL_DEBUG1( KIHLDebug, "IHL - CIHLScaler - Start bitmap scaling" );
-
- // Start processing
- iScalerStatus = &aStatus;
- *iScalerStatus = KRequestPending;
-
- SelfComplete();
- return KErrNone;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLScaler::IsBusy
-// -----------------------------------------------------------------------------
-TBool CIHLScaler::IsBusy() const
- {
- return IsActive();
- }
-
-// -----------------------------------------------------------------------------
-// CIHLScaler::CancelProcess
-// -----------------------------------------------------------------------------
-void CIHLScaler::CancelProcess()
- {
- Cancel();
- }
-
-// -----------------------------------------------------------------------------
-// CIHLScaler::SetFilter
-// -----------------------------------------------------------------------------
-void CIHLScaler::SetFilter( MIHFilter* /*aFilter*/ )
- {
- // Not in use
- }
-
-// -----------------------------------------------------------------------------
-// CIHLScaler::DoCancel
-// -----------------------------------------------------------------------------
-void CIHLScaler::DoCancel()
- {
- RequestComplete( KErrCancel );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLScaler::RunL
-// -----------------------------------------------------------------------------
-void CIHLScaler::RunL()
- {
- User::LeaveIfError( iStatus.Int() );
-
- // Process bitmap (this if-else may look weird but it removes one extra triggering of the AS
- if( iNeedProcess )
- {
- // Call the selected code path directly via a function pointer
- iNeedProcess = (this->*ProcessingFunc)();
- }
-
- if(!iNeedProcess)
- {
-#ifdef RD_MEASURE_THROUGHPUT
- // Calculate throughput
- TUint32 end = User::FastCounter();
-
- TInt tickPeriod;
- HAL::Get(HALData::EFastCounterFrequency, tickPeriod);
- TReal time = TReal(end-iStartTime) / TReal(tickPeriod);
- TReal bytes = iProcessSize.iWidth*iProcessSize.iHeight*2;
-
- IHL_DEBUG3("IHL - CIHLScaler - Scaling complete, %.3f ms, %.3f MB/s", time*1000.0, (bytes/time)/1024.0/1024.0);
-#else
- IHL_DEBUG1( KIHLDebug, "IHL - CIHLScaler - Scaling complete!" );
-#endif
- // Process complete
- RequestComplete( KErrNone );
- }
- else
- {
- // Another round
- SelfComplete();
- }
- }
-
-// -----------------------------------------------------------------------------
-// CIHLScaler::RunError
-// -----------------------------------------------------------------------------
-TInt CIHLScaler::RunError( TInt aError )
- {
- IHL_DEBUG2( KIHLDebug, "IHL - CIHLScaler - Scaling error: %d", aError );
-
- RequestComplete( aError );
- return KErrNone;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLScaler::IsValidRect
-// -----------------------------------------------------------------------------
-TBool CIHLScaler::IsValidRect( const TSize& aSize, const TRect& aRect )
- {
- if( aRect.iTl.iX >= 0 &&
- aRect.iTl.iX <= aSize.iWidth &&
- aRect.iTl.iY >= 0 &&
- aRect.iTl.iY <= aSize.iHeight &&
- aRect.iBr.iX >= 0 &&
- aRect.iBr.iX <= aSize.iWidth &&
- aRect.iBr.iY >= 0 &&
- aRect.iBr.iY <= aSize.iHeight )
- {
- return ETrue;
- }
- return EFalse;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLScaler::InitStepperValues
-// -----------------------------------------------------------------------------
-TBool CIHLScaler::InitStepperValues()
- {
- TBool onlyScaling = EFalse;
-
- TSize srcRectSize( Abs( iSrcRect.Width() ), Abs( iSrcRect.Height() ) );
- TSize dstRectSize( Abs( iDstRect.Width() ), Abs( iDstRect.Height() ) );
-
- TReal srcW = srcRectSize.iWidth << KStepPrecision;
- TReal srcH = srcRectSize.iHeight << KStepPrecision;
-
- // -----------------------------------------
- // Set source start point and increment
- // -----------------------------------------
- if( iSrcRect.iTl.iX > iSrcRect.iBr.iX &&
- iSrcRect.iTl.iY < iSrcRect.iBr.iY )
- {
- TReal incrementInner( srcH / TReal(dstRectSize.iWidth) );
- TReal incrementOuter( srcW / TReal(dstRectSize.iHeight) );
-
- iSrcIncrementInner.iX = 0;
- iSrcIncrementInner.iY = incrementInner;
- iSrcIncrementOuter.iX = -incrementOuter;
- iSrcIncrementOuter.iY = 0;
-
- iSrcPos.SetXY( (iSrcRect.iTl.iX << KStepPrecision) - (incrementOuter / 2.0),
- (iSrcRect.iTl.iY << KStepPrecision) + (incrementInner / 2.0) );
- }
- else if ( iSrcRect.iTl.iX > iSrcRect.iBr.iX &&
- iSrcRect.iTl.iY > iSrcRect.iBr.iY )
- {
- TReal incrementInner( srcW / TReal(dstRectSize.iWidth) );
- TReal incrementOuter( srcH / TReal(dstRectSize.iHeight) );
-
- iSrcIncrementInner.iX = -incrementInner;
- iSrcIncrementInner.iY = 0;
- iSrcIncrementOuter.iX = 0;
- iSrcIncrementOuter.iY = -incrementOuter;
-
- iSrcPos.SetXY( (iSrcRect.iTl.iX << KStepPrecision) - (incrementInner / 2.0),
- (iSrcRect.iTl.iY << KStepPrecision) - (incrementOuter / 2.0) );
- }
- else if ( iSrcRect.iTl.iX < iSrcRect.iBr.iX &&
- iSrcRect.iTl.iY > iSrcRect.iBr.iY )
- {
- TReal incrementInner( srcH / TReal(dstRectSize.iWidth) );
- TReal incrementOuter( srcW / TReal(dstRectSize.iHeight) );
-
- iSrcIncrementInner.iX = 0;
- iSrcIncrementInner.iY = -incrementInner;
- iSrcIncrementOuter.iX = incrementOuter;
- iSrcIncrementOuter.iY = 0;
-
- iSrcPos.SetXY( (iSrcRect.iTl.iX << KStepPrecision) + (incrementOuter / 2.0),
- (iSrcRect.iTl.iY << KStepPrecision) - (incrementInner / 2.0) );
- }
- else
- {
- TReal incrementInner( srcW / TReal(dstRectSize.iWidth) );
- TReal incrementOuter( srcH / TReal(dstRectSize.iHeight) );
-
- IHL_DEBUG3(KIHLDebug, "incrementInner: %f, incrementOuter: %f", incrementInner, incrementOuter);
-
- iSrcIncrementInner.iX = incrementInner;
- iSrcIncrementInner.iY = 0;
- iSrcIncrementOuter.iX = 0;
- iSrcIncrementOuter.iY = incrementOuter;
-
- iSrcPos.SetXY( (iSrcRect.iTl.iX << KStepPrecision) + (incrementInner / 2.0),
- (iSrcRect.iTl.iY << KStepPrecision) + (incrementOuter / 2.0) );
-
- onlyScaling = ETrue;
- }
-
- // -----------------------------------------
- // Set destination start point and increment
- // -----------------------------------------
-
- iDstPos.iX = iDstRect.iTl.iX;
- iDstIncrementInner = 1;
- iDstPos.iY = iDstRect.iTl.iY;
- iDstIncrementOuter = 1;
-
- if( iDstRect.iTl.iX > iDstRect.iBr.iX )
- {
- // From right to left
- iDstPos.iX--;
- iDstIncrementInner = -1;
- onlyScaling = EFalse;
- }
-
- if( iDstRect.iTl.iY > iDstRect.iBr.iY )
- {
- // From bottom to up
- iDstPos.iY--;
- iDstIncrementOuter = -1;
- onlyScaling = EFalse;
- }
-
- // -----------------------------------------
- // Reset process counters
- // -----------------------------------------
- iProcessInner = 0;
- iProcessOuter = 0;
- iProcessSize = dstRectSize;
-
- // These are for fast code path
-
- // Init how many scanlines to process
- iScanlinesLeft = iProcessSize.iHeight;
-
- return onlyScaling;
- }
-
-
-// Optimize the fast code paths properly for ARM
-#ifdef __ARMCC__
-#pragma push
-#pragma O3
-#pragma Otime
-#pragma arm
-#endif
-
-// -----------------------------------------------------------------------------
-// CIHLScaler::ProcessNearestNeighbour64K
-// Description: Scales & rotates 64K color bitmaps
-// -----------------------------------------------------------------------------
-TBool CIHLScaler::ProcessNearestNeighbour64K()
- {
- // Lock bitmap heaps
- iSrcBitmap->LockHeap();
- iDstBitmap->LockHeap();
-
- // Pointers to start of bitmap data
- TUint16 *srcBitmapPtr = (TUint16*)iSrcBitmap->DataAddress();
- TUint16 *dstBitmapPtr = (TUint16*)iDstBitmap->DataAddress();
-
- // Get pointer to correct destination pixel (offset is updated after every round)
- register TUint16* dst = dstBitmapPtr + iDstStartOffset;
-
- TUint32 width = iProcessSize.iWidth;
-
- // Check how many scanlines we can process this round
- register TUint32 scanlinesLeft = iScanlinesLeft;
- if(scanlinesLeft>iScanlinesPerRound)
- {
- scanlinesLeft = iScanlinesPerRound;
- }
-
- // How many scanlines left for the next round
- iScanlinesLeft-=scanlinesLeft;
-
- // Faster access to variables (it's slow to use member variables)
- register TInt srcPosX(iSrcPos.iX);
- register TInt srcPosY(iSrcPos.iY);
- register TInt srcPitch = iSrcPitchInPixels;
-
- TInt incOuterSrcX = (-iSrcIncrementInner.iX * width) + iSrcIncrementOuter.iX;
- TInt incOuterSrcY = (-iSrcIncrementInner.iY * width) + iSrcIncrementOuter.iY;
-
- while(scanlinesLeft!=0)
- {
- for(register TUint32 x = width; x!=0; x--)
- {
- register TUint16* src = srcBitmapPtr + ((srcPosY >> KStepPrecision) * srcPitch) + (srcPosX>>KStepPrecision);
- *dst = *src;
-
- // Add inner counters
- srcPosX+=iSrcIncrementInner.iX;
- srcPosY+=iSrcIncrementInner.iY;
-
- dst+=iDstIncrementInner;
- }
-
- // Reset inner counters and add outer counters
- srcPosX += incOuterSrcX;
- srcPosY += incOuterSrcY;
-
- // Move destination pointer to next pixel
- dst += iDstResidualPixels;
-
- // One scanline done, n to go
- scanlinesLeft--;
- }
- // Unlock bitmap heaps
- iDstBitmap->UnlockHeap();
- iSrcBitmap->UnlockHeap();
-
- if(iScanlinesLeft)
- {
- // Not all scanlines were processed yet
-
- // Save the necessary offsets for next round
- iSrcPos.iX = srcPosX;
- iSrcPos.iY = srcPosY;
- iDstStartOffset = dst - dstBitmapPtr;
-
- return ETrue;
- }
-
- // Processing done
- return EFalse;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLScaler::ProcessNearestNeighbour64KScaleOnly
-// -----------------------------------------------------------------------------
-TBool CIHLScaler::ProcessNearestNeighbour64KScaleOnly()
- {
- // Lock bitmap heaps
- iSrcBitmap->LockHeap();
- iDstBitmap->LockHeap();
-
- // Get bitmap data start addresses
- TUint16 *srcBitmapPtr = (TUint16*)iSrcBitmap->DataAddress();
- TUint16 *dstBitmapPtr = (TUint16*)iDstBitmap->DataAddress();
-
- // Target height and width
- TInt width = iProcessSize.iWidth;
-
- // fixed point source coordinates
- TInt startX = iSrcPos.iX;
- TInt srcY = iSrcPos.iY;
-
- // How much to increase src position (in fixed point)
- TInt srcYIncrement = iSrcIncrementOuter.iY;
- register TInt srcXIncrement = iSrcIncrementInner.iX;
-
- // Set pointers to correct location (src = start of scanline, dst = start pixel)
- register TUint16* dst = dstBitmapPtr + iDstStartOffset;
-
- // Calculate how many scanlines we can process this round
- register TInt scanlinesLeft = iScanlinesLeft;
- if(scanlinesLeft>iScanlinesPerRound)
- {
- scanlinesLeft = iScanlinesPerRound;
- }
-
- iScanlinesLeft-=scanlinesLeft;
-
- while(scanlinesLeft--)
- {
- // Outer loop
-
- // Reset src X and scanline pointer
- register TInt srcX = startX;
- register TUint16* src = srcBitmapPtr + (srcY >> KStepPrecision) * iSrcPitchInPixels;
-
- // Init pixel counter
- register TUint32 pixels = width;
-
- // Unaligned pixels to the left of 8B-aligned section
- while((TUint32(dst)&0x7) && pixels)
- {
- *dst++ = (*(src + (srcX >> KStepPrecision)));
-
- srcX += srcXIncrement;
-
- pixels--;
- }
-
- // Aligned middle section
- register TUint32 middle = pixels&0xFFFFFFFC;
- pixels &= 0x3;
-
- while(middle)
- {
- // Read four pixels
- register TUint16 p1 = (*(src + (srcX >> KStepPrecision)));
- srcX += srcXIncrement;
- register TUint16 p2 = (*(src + (srcX >> KStepPrecision)));
- srcX += srcXIncrement;
- register TUint16 p3 = (*(src + (srcX >> KStepPrecision)));
- srcX += srcXIncrement;
- register TUint16 p4 = (*(src + (srcX >> KStepPrecision)));
- srcX += srcXIncrement;
-
- // Write four pixels
- *(dst++) = p1;
- *(dst++) = p2;
- *(dst++) = p3;
- *(dst++) = p4;
-
- middle-=4;
- }
-
- // Unaligned residual pixels to the right of 8-aligned section
- while(pixels)
- {
- *dst++ = (*(src + (srcX >> KStepPrecision)));
-
- srcX += srcXIncrement;
-
- pixels--;
- }
-
- // Move to next correct src scanline
- srcY += srcYIncrement;
-
- // Advance dst to start of correct pixel in the next row
- dst += iDstResidualPixels;
- }
-
- iDstBitmap->UnlockHeap();
- iSrcBitmap->UnlockHeap();
-
- if(iScanlinesLeft)
- {
- // Not all scanlines were processed yet
-
- // Save the necessary offsets for next round
- iSrcPos.iY = srcY;
- iDstStartOffset = dst - dstBitmapPtr;
-
- return ETrue;
- }
-
- return EFalse;
-
- }
-
-// -----------------------------------------------------------------------------
-// CIHLScaler::ProcessNearestNeighbour16MX
-// Description: Scales & rotates 16MU/MA color bitmaps
-// -----------------------------------------------------------------------------
-TBool CIHLScaler::ProcessNearestNeighbour16MX()
- {
- // Lock bitmap heaps
- iSrcBitmap->LockHeap();
- iDstBitmap->LockHeap();
-
- // Pointers to start of bitmap data
- TUint32 *srcBitmapPtr = (TUint32*)iSrcBitmap->DataAddress();
- TUint32 *dstBitmapPtr = (TUint32*)iDstBitmap->DataAddress();
-
- // Get pointer to correct destination pixel (offset is updated after every round)
- register TUint32* dst = dstBitmapPtr + iDstStartOffset;
-
- TUint32 width = iProcessSize.iWidth;
-
- // Check how many scanlines we can process this round
- register TUint32 scanlinesLeft = iScanlinesLeft;
- if(scanlinesLeft>iScanlinesPerRound)
- {
- scanlinesLeft = iScanlinesPerRound;
- }
-
- // How many scanlines left for the next round
- iScanlinesLeft-=scanlinesLeft;
-
- // Faster access to variables (it's slow to use member variables)
- register TInt srcPosX(iSrcPos.iX);
- register TInt srcPosY(iSrcPos.iY);
- register TInt srcPitch = iSrcPitchInPixels;
-
- TInt incOuterSrcX = (-iSrcIncrementInner.iX * width) + iSrcIncrementOuter.iX;
- TInt incOuterSrcY = (-iSrcIncrementInner.iY * width) + iSrcIncrementOuter.iY;
-
- while(scanlinesLeft!=0)
- {
- for(register TUint32 x = width; x!=0; x--)
- {
- register TUint32* src = srcBitmapPtr + ((srcPosY >> KStepPrecision) * srcPitch) + (srcPosX>>KStepPrecision);
- *dst = *src;
-
- // Add inner counters
- srcPosX+=iSrcIncrementInner.iX;
- srcPosY+=iSrcIncrementInner.iY;
-
- dst+=iDstIncrementInner;
- }
-
- // Reset inner counters and add outer counters
- srcPosX += incOuterSrcX;
- srcPosY += incOuterSrcY;
-
- // Move destination pointer to next pixel
- dst += iDstResidualPixels;
-
- // One scanline done, n to go
- scanlinesLeft--;
- }
- // Unlock bitmap heaps
- iDstBitmap->UnlockHeap();
- iSrcBitmap->UnlockHeap();
-
- if(iScanlinesLeft)
- {
- // Not all scanlines were processed yet
-
- // Save the necessary offsets for next round
- iSrcPos.iX = srcPosX;
- iSrcPos.iY = srcPosY;
- iDstStartOffset = dst - dstBitmapPtr;
-
- return ETrue;
- }
-
- // Processing done
- return EFalse;
- }
-
-// -----------------------------------------------------------------------------
-// CIHLScaler::ProcessNearestNeighbour64KScaleOnly
-// -----------------------------------------------------------------------------
-TBool CIHLScaler::ProcessNearestNeighbour16MXScaleOnly()
- {
- // Lock bitmap heaps
- iSrcBitmap->LockHeap();
- iDstBitmap->LockHeap();
-
- // Get bitmap data start addresses
- TUint32 *srcBitmapPtr = (TUint32*)iSrcBitmap->DataAddress();
- TUint32 *dstBitmapPtr = (TUint32*)iDstBitmap->DataAddress();
-
- // Target height and width
- TInt width = iProcessSize.iWidth;
-
- // fixed point source coordinates
- TInt startX = iSrcPos.iX;
- TInt srcY = iSrcPos.iY;
-
- // How much to increase src position (in fixed point)
- TInt srcYIncrement = iSrcIncrementOuter.iY;
- register TInt srcXIncrement = iSrcIncrementInner.iX;
-
- // Set pointers to correct location (src = start of scanline, dst = start pixel)
- register TUint32* dst = dstBitmapPtr + iDstStartOffset;
-
- // Calculate how many scanlines we can process this round
- register TInt scanlinesLeft = iScanlinesLeft;
- if(scanlinesLeft>iScanlinesPerRound)
- {
- scanlinesLeft = iScanlinesPerRound;
- }
-
- iScanlinesLeft-=scanlinesLeft;
-
- while(scanlinesLeft--)
- {
- // Outer loop
-
- // Reset src X and scanline pointer
- register TInt srcX = startX;
- register TUint32* src = srcBitmapPtr + (srcY >> KStepPrecision) * iSrcPitchInPixels;
-
- // Init pixel counter
- register TUint32 pixels = width;
-
- // Unaligned pixels to the left of 16B-aligned section
- while((TUint32(dst)&0xF) && pixels)
- {
- *dst++ = (*(src + (srcX >> KStepPrecision)));
-
- srcX += srcXIncrement;
-
- pixels--;
- }
-
- // Aligned middle section
- register TUint32 middle = pixels&0xFFFFFFFC;
- pixels &= 0x3;
-
- while(middle)
- {
- // Read four pixels
- register TUint32 p1 = (*(src + (srcX >> KStepPrecision)));
- srcX += srcXIncrement;
- register TUint32 p2 = (*(src + (srcX >> KStepPrecision)));
- srcX += srcXIncrement;
- register TUint32 p3 = (*(src + (srcX >> KStepPrecision)));
- srcX += srcXIncrement;
- register TUint32 p4 = (*(src + (srcX >> KStepPrecision)));
- srcX += srcXIncrement;
-
- // Write four pixels
- *(dst+0) = p1;
- *(dst+1) = p2;
- *(dst+2) = p3;
- *(dst+3) = p4;
-
- middle-=4;
- dst+=4;
- }
-
- // Unaligned residual pixels to the right of 8-aligned section
- while(pixels)
- {
- *dst++ = (*(src + (srcX >> KStepPrecision)));
-
- srcX += srcXIncrement;
-
- pixels--;
- }
-
- // Move to next correct src scanline
- srcY += srcYIncrement;
-
- // Advance dst to start of correct pixel in the next row
- dst += iDstResidualPixels;
- }
-
- iDstBitmap->UnlockHeap();
- iSrcBitmap->UnlockHeap();
-
- if(iScanlinesLeft)
- {
- // Not all scanlines were processed yet
-
- // Save the necessary offsets for next round
- iSrcPos.iY = srcY;
- iDstStartOffset = dst - dstBitmapPtr;
-
- return ETrue;
- }
-
- return EFalse;
-
- }
-
-// Restore previous pragma state
-#ifdef __ARMCC__
-#pragma pop
-#endif
-
-// -----------------------------------------------------------------------------
-// CIHLScaler::ProcessNearestNeighbour
-// -----------------------------------------------------------------------------
-TBool CIHLScaler::ProcessNearestNeighbour()
- {
- // Util needs non-const pointers even if it's only used for reading pixels
- TBitmapUtil srcBitmap( const_cast( iSrcBitmap ) );
- TBitmapUtil dstBitmap( iDstBitmap );
- srcBitmap.Begin( TPoint( iSrcPos.iX >> KStepPrecision, iSrcPos.iY >> KStepPrecision ) );
- dstBitmap.Begin( iDstPos ); // heap already locked by srcBitmap
- TInt pixelCounter( KProcessPixelsPerStep );
-
- // Start outer and inner process loops
- while( iProcessOuter < iProcessSize.iHeight && pixelCounter )
- {
- while( iProcessInner < iProcessSize.iWidth && pixelCounter )
- {
- srcBitmap.SetPos( TPoint( iSrcPos.iX >> KStepPrecision, iSrcPos.iY >> KStepPrecision ) );
- dstBitmap.SetPos( iDstPos );
- dstBitmap.SetPixel( srcBitmap );
-
- // Add inner counters
- iSrcPos += iSrcIncrementInner;
- iDstPos.iX += iDstIncrementInner;
- ++iProcessInner;
- --pixelCounter;
- }
- // Check if inner loop is finished (not just pixel counter)
- if( iProcessInner == iProcessSize.iWidth )
- {
- // Reset inner counters
- iSrcPos.iX -= iSrcIncrementInner.iX * iProcessInner;
- iSrcPos.iY -= iSrcIncrementInner.iY * iProcessInner;
-
- iDstPos.iX -= iDstIncrementInner * iProcessInner;
- iProcessInner = 0;
-
- // Add outer counters
- iSrcPos += iSrcIncrementOuter;
- iDstPos.iY += iDstIncrementOuter;
- ++iProcessOuter;
- }
- }
-
- // Release heap lock
- dstBitmap.End();
- srcBitmap.End();
-
- // ETrue if more processing is still needed
- return ( iProcessOuter < iProcessSize.iHeight );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLScaler::ProcessBilinear
-// -----------------------------------------------------------------------------
-TBool CIHLScaler::ProcessBilinear()
- {
- // Util needs non-const pointers
- //even if it's only used for reading pixels
- TBitmapUtil srcBitmap( const_cast( iSrcBitmap ) );
- TBitmapUtil dstBitmap( iDstBitmap );
-
- srcBitmap.Begin( TPoint( iSrcPos.iX >> KStepPrecision, iSrcPos.iY >> KStepPrecision ) );
- dstBitmap.Begin( iDstPos ); // heap already locked by srcBitmap
- TInt pixelCounter( KProcessPixelsPerStep );
-
- TInt incSrcX = iSrcIncrementInner.iX + iSrcIncrementOuter.iX;
- TInt incSrcY = iSrcIncrementInner.iY + iSrcIncrementOuter.iY;
-
- TPixelData pixelData;
- TUint32 color;
-
- TInt32 pixel_width = 1 << KStepPrecision;
-
- //if there is no scaling then process through loop using NearestNeighbour alghoritm
- if ( incSrcX == pixel_width || -incSrcX == pixel_width )
- {
- while( iProcessOuter < iProcessSize.iHeight && pixelCounter )
- {
- while( iProcessInner < iProcessSize.iWidth && pixelCounter )
- {
- srcBitmap.SetPos( TPoint( iSrcPos.iX >> KStepPrecision, iSrcPos.iY >> KStepPrecision ) );
- dstBitmap.SetPos( iDstPos );
- dstBitmap.SetPixel( srcBitmap );
-
- // Add inner counters
- iSrcPos += iSrcIncrementInner;
- iDstPos.iX += iDstIncrementInner;
- ++iProcessInner;
- --pixelCounter;
- }
-
- // Check if inner loop is finished (not just pixel counter)
- if( iProcessInner == iProcessSize.iWidth )
- {
- // Reset inner counters
- iSrcPos.iX -= iSrcIncrementInner.iX * iProcessInner;
- iSrcPos.iY -= iSrcIncrementInner.iY * iProcessInner;
-
- iDstPos.iX -= iDstIncrementInner * iProcessInner;
- iProcessInner = 0;
-
- // Add outer counters
- iSrcPos += iSrcIncrementOuter;
- iDstPos.iY += iDstIncrementOuter;
- ++iProcessOuter;
- }
- }
- }
- // Process using bilinear method according to
- // orientation between source and destination bitmap
- //
- // There are 4 possibilities of orientation and can be
- // determined by this if we're increasing or decreasing
- // position on source bitmap.
- else if ( ( incSrcY >= 0) && (incSrcX >= 0 ) )
- {
- while( iProcessOuter < iProcessSize.iHeight && pixelCounter )
- {
- while( iProcessInner < iProcessSize.iWidth && pixelCounter )
- {
- srcBitmap.SetPos( TPoint( iSrcPos.iX >> KStepPrecision, iSrcPos.iY >> KStepPrecision ) );
- dstBitmap.SetPos( iDstPos );
-
- // gather pixel data with step:
- // 00 > 10
- // V
- // 01 < 11
- IntToRgb(srcBitmap.GetPixel(),pixelData.colXY00);
- srcBitmap.IncXPos();
- IntToRgb(srcBitmap.GetPixel(),pixelData.colXY10);
- srcBitmap.IncYPos();
- IntToRgb(srcBitmap.GetPixel(),pixelData.colXY11);
- srcBitmap.DecXPos();
- IntToRgb(srcBitmap.GetPixel(),pixelData.colXY01);
- //return to starting position
- srcBitmap.DecYPos();
-
- // interpolate color using gathered pixel-data
- ProcessColorData(pixelData, iSrcPos);
-
- // put color in destination package
- color = RgbToInt(pixelData.col);
- dstBitmap.SetPixel(color);
-
- // Add inner counters
- iSrcPos += iSrcIncrementInner;
- iDstPos.iX += iDstIncrementInner;
- ++iProcessInner;
- --pixelCounter;
- }
-
- // Check if inner loop is finished (not just pixel counter)
- if( iProcessInner == iProcessSize.iWidth )
- {
- // Reset inner counters
- iSrcPos.iX -= iSrcIncrementInner.iX * iProcessInner;
- iSrcPos.iY -= iSrcIncrementInner.iY * iProcessInner;
-
- iDstPos.iX -= iDstIncrementInner * iProcessInner;
- iProcessInner = 0;
-
- // Add outer counters
- iSrcPos += iSrcIncrementOuter;
- iDstPos.iY += iDstIncrementOuter;
- ++iProcessOuter;
- }
- }
- }
- else if ( ( incSrcY >= 0) && (incSrcX < 0 ) )
- {
- while( iProcessOuter < iProcessSize.iHeight && pixelCounter )
- {
- while( iProcessInner < iProcessSize.iWidth && pixelCounter )
- {
- srcBitmap.SetPos( TPoint( iSrcPos.iX >> KStepPrecision, iSrcPos.iY >> KStepPrecision ) );
- dstBitmap.SetPos( iDstPos );
-
- // gather pixel data with step:
- // 00 10
- // /\ V
- // 01 < 11
- IntToRgb(srcBitmap.GetPixel(),pixelData.colXY10);
- srcBitmap.IncYPos();
- IntToRgb(srcBitmap.GetPixel(),pixelData.colXY11);
- srcBitmap.DecXPos();
- IntToRgb(srcBitmap.GetPixel(),pixelData.colXY01);
- srcBitmap.DecYPos();
- IntToRgb(srcBitmap.GetPixel(),pixelData.colXY00);
- //return to starting position
- srcBitmap.IncXPos();
-
- // interpolate color using gathered pixel-data
- ProcessColorData(pixelData, iSrcPos);
-
- // put color in destination package
- color = RgbToInt(pixelData.col);
- dstBitmap.SetPixel(color);
-
- // Add inner counters
- iSrcPos += iSrcIncrementInner;
- iDstPos.iX += iDstIncrementInner;
- ++iProcessInner;
- --pixelCounter;
- }
-
- // Check if inner loop is finished (not just pixel counter)
- if( iProcessInner == iProcessSize.iWidth )
- {
- // Reset inner counters
- iSrcPos.iX -= iSrcIncrementInner.iX * iProcessInner;
- iSrcPos.iY -= iSrcIncrementInner.iY * iProcessInner;
-
- iDstPos.iX -= iDstIncrementInner * iProcessInner;
- iProcessInner = 0;
-
- // Add outer counters
- iSrcPos += iSrcIncrementOuter;
- iDstPos.iY += iDstIncrementOuter;
- ++iProcessOuter;
- }
-
- }
- }
- else if ( ( incSrcY < 0) && (incSrcX >= 0 ) )
- {
- while( iProcessOuter < iProcessSize.iHeight && pixelCounter )
- {
- while( iProcessInner < iProcessSize.iWidth && pixelCounter )
- {
- srcBitmap.SetPos( TPoint( iSrcPos.iX >> KStepPrecision, iSrcPos.iY >> KStepPrecision ) );
- dstBitmap.SetPos( iDstPos );
-
- // gather pixel data with step:
- // 00 > 10
- // /\ V
- // 01 11
- IntToRgb(srcBitmap.GetPixel(),pixelData.colXY01);
- srcBitmap.DecYPos();
- IntToRgb(srcBitmap.GetPixel(),pixelData.colXY00);
- srcBitmap.IncXPos();
- IntToRgb(srcBitmap.GetPixel(),pixelData.colXY10);
- srcBitmap.IncYPos();
- IntToRgb(srcBitmap.GetPixel(),pixelData.colXY11);
- //return to starting position
- srcBitmap.DecXPos();
-
- // interpolate color using gathered pixel-data
- ProcessColorData(pixelData, iSrcPos);
-
- // put color in destination package
- color = RgbToInt(pixelData.col);
- dstBitmap.SetPixel(color);
-
- // Add inner counters
- iSrcPos += iSrcIncrementInner;
- iDstPos.iX += iDstIncrementInner;
- ++iProcessInner;
- --pixelCounter;
- }
-
- // Check if inner loop is finished (not just pixel counter)
- if( iProcessInner == iProcessSize.iWidth )
- {
- // Reset inner counters
- iSrcPos.iX -= iSrcIncrementInner.iX * iProcessInner;
- iSrcPos.iY -= iSrcIncrementInner.iY * iProcessInner;
-
- iDstPos.iX -= iDstIncrementInner * iProcessInner;
- iProcessInner = 0;
-
- // Add outer counters
- iSrcPos += iSrcIncrementOuter;
- iDstPos.iY += iDstIncrementOuter;
- ++iProcessOuter;
- }
- }
- }
- else
- {
- while( iProcessOuter < iProcessSize.iHeight && pixelCounter )
- {
- while( iProcessInner < iProcessSize.iWidth && pixelCounter )
- {
- srcBitmap.SetPos( TPoint( iSrcPos.iX >> KStepPrecision, iSrcPos.iY >> KStepPrecision ) );
- dstBitmap.SetPos( iDstPos );
-
- // gather pixel data with step:
- // 00 > 10
- // /\
- // 01 < 11
- IntToRgb(srcBitmap.GetPixel(),pixelData.colXY11);
- srcBitmap.DecXPos();
- IntToRgb(srcBitmap.GetPixel(),pixelData.colXY01);
- srcBitmap.DecYPos();
- IntToRgb(srcBitmap.GetPixel(),pixelData.colXY00);
- srcBitmap.IncXPos();
- IntToRgb(srcBitmap.GetPixel(),pixelData.colXY10);
- //return to starting position
- srcBitmap.IncYPos();
-
- // interpolate color using gathered pixel-data
- ProcessColorData(pixelData, iSrcPos);
-
- // put color in destination package
- color = RgbToInt(pixelData.col);
- dstBitmap.SetPixel(color);
-
- // Add inner counters
- iSrcPos += iSrcIncrementInner;
- iDstPos.iX += iDstIncrementInner;
- ++iProcessInner;
- --pixelCounter;
- }
-
- // Check if inner loop is finished (not just pixel counter)
- if( iProcessInner == iProcessSize.iWidth )
- {
- // Reset inner counters
- iSrcPos.iX -= iSrcIncrementInner.iX * iProcessInner;
- iSrcPos.iY -= iSrcIncrementInner.iY * iProcessInner;
-
- iDstPos.iX -= iDstIncrementInner * iProcessInner;
- iProcessInner = 0;
-
- // Add outer counters
- iSrcPos += iSrcIncrementOuter;
- iDstPos.iY += iDstIncrementOuter;
- ++iProcessOuter;
- }
-
- }
- }
-
- // Release heap lock
- dstBitmap.End();
- srcBitmap.End();
-
- // ETrue if more processing is still needed
- return ( iProcessOuter < iProcessSize.iHeight );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLScaler::SelfComplete
-// -----------------------------------------------------------------------------
-void CIHLScaler::SelfComplete()
- {
- SetActive();
- iStatus = KRequestPending;
- TRequestStatus* status = &iStatus;
- User::RequestComplete( status, KErrNone );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLScaler::RequestComplete
-// -----------------------------------------------------------------------------
-void CIHLScaler::RequestComplete( TInt aReason )
- {
- ASSERT( iScalerStatus );
- User::RequestComplete( iScalerStatus, aReason );
- }
-
-// -----------------------------------------------------------------------------
-// CIHLScaler::InitCodePath
-// -----------------------------------------------------------------------------
-void CIHLScaler::InitCodePath(const TSize& aSrcSize, const TDisplayMode &aSrcMode, const TSize& aDstSize, const TDisplayMode &aDstMode, TBool aOnlyScaling)
- {
- // Choose the correct processing code path
- ProcessingFunc = &CIHLScaler::ProcessNearestNeighbour;
-
- if( iOptions & MIHLImageViewer::EOptionUseBilinearInterpolation )
- {
- // TODO: optimize bilinear scaling
- IHL_DEBUG("CIHLScaler::InitCodePath: slow bilinear");
- ProcessingFunc = &CIHLScaler::ProcessBilinear;
- iScanlinesPerRound = KProcessPixelsPerStep / iProcessSize.iWidth;
- }
- else if(aSrcMode == EColor64K && aSrcMode==aDstMode && !iSrcBitmap->IsCompressedInRAM() && !iDstBitmap->IsCompressedInRAM())
- {
- // 16 bit non-compressed bitmaps
-
- // Calculate how many pixels the scanline is actually wide in the memory
- iSrcPitchInPixels = CFbsBitmap::ScanLineLength( aSrcSize.iWidth, aSrcMode ) >> 1;
- iDstPitchInPixels = CFbsBitmap::ScanLineLength( aDstSize.iWidth, aDstMode ) >> 1;
-
- // How many pixels to move destination pointer at the end of each scanline to get to next pixel
- iDstResidualPixels = iDstIncrementOuter*iDstPitchInPixels - iDstIncrementInner*iProcessSize.iWidth;
-
- // Buffer offset to the first destination pixel
- iDstStartOffset = iDstPos.iY * iDstPitchInPixels + iDstPos.iX;
-
- if(!aOnlyScaling)
- {
- IHL_DEBUG("CIHLScaler::InitCodePath: fast 64K scale&rotate");
- ProcessingFunc = &CIHLScaler::ProcessNearestNeighbour64K;
-
- // Calculate how often the process should allow AS to run
- iScanlinesPerRound = KBytesPerStepFastPath / (iProcessSize.iWidth<<1);
- }
- else
- {
- IHL_DEBUG("CIHLScaler::InitCodePath: fast 64K scale only");
- ProcessingFunc = &CIHLScaler::ProcessNearestNeighbour64KScaleOnly;
-
- // Calculate how often the process should allow AS to run
- iScanlinesPerRound = KBytesPerStepFastPathScaleOnly / (iProcessSize.iWidth<<1);
- }
- }
-
- else if((aSrcMode == EColor16MU || aSrcMode == EColor16MA) && aSrcMode==aDstMode && !iSrcBitmap->IsCompressedInRAM() && !iDstBitmap->IsCompressedInRAM())
- {
- // 32 bit non-compressed bitmaps
-
- // Calculate how many pixels the scanline is actually wide in the memory
- iSrcPitchInPixels = CFbsBitmap::ScanLineLength( aSrcSize.iWidth, aSrcMode ) >> 2;
- iDstPitchInPixels = CFbsBitmap::ScanLineLength( aDstSize.iWidth, aDstMode ) >> 2;
-
- // How many pixels to move destination pointer at the end of each scanline to get to next pixel
- iDstResidualPixels = iDstIncrementOuter*iDstPitchInPixels - iDstIncrementInner*iProcessSize.iWidth;
-
- // Buffer offset to the first destination pixel
- iDstStartOffset = iDstPos.iY * iDstPitchInPixels + iDstPos.iX;
-
- if(!aOnlyScaling)
- {
- IHL_DEBUG("CIHLScaler::InitCodePath: fast 16MX scale&rotate");
- ProcessingFunc = &CIHLScaler::ProcessNearestNeighbour16MX;
-
- // Calculate how often the process should allow AS to run
- iScanlinesPerRound = KBytesPerStepFastPath / (iProcessSize.iWidth<<2);
- }
- else
- {
- IHL_DEBUG("CIHLScaler::InitCodePath: fast 16MX scale only");
- ProcessingFunc = &CIHLScaler::ProcessNearestNeighbour16MXScaleOnly;
-
- // Calculate how often the process should allow AS to run
- iScanlinesPerRound = KBytesPerStepFastPathScaleOnly / (iProcessSize.iWidth<<2);
- }
- }
- else
- {
- IHL_DEBUG("CIHLScaler::InitCodePath: slow nearest neighbor");
- iScanlinesPerRound = KProcessPixelsPerStep / iProcessSize.iWidth;
- }
-
- IHL_DEBUG2(KIHLDebug, "CIHLScaler::InitCodePath: scanlines per round = %d", iScanlinesPerRound);
- }
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlinglib/Src/CIHLScaler.h
--- a/imagehandlinglib/Src/CIHLScaler.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,204 +0,0 @@
-/*
-* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of bitmap scaler class
-* : using Font and Bitmap Server bitmaps.
-*
-*/
-
-#ifndef CIHLSCALER_H
-#define CIHLSCALER_H
-
-// INCLUDES
-#include
-#include
-#include
-
-// Define this to show throughput measurements
-//#define RD_MEASURE_THROUGHPUT
-
-// FORWARD DECLARATIONS
-class CFbsBitmap;
-
-// CLASS DECLARATION
-/**
-* CIHLScaler
-*
-* Implementation of Scaling processor
-* using Font and Bitmap Server bitmaps.
-* @lib IHL.lib
-* @since 3.0
-*/
-NONSHARABLE_CLASS( CIHLScaler ) : public CActive, public MIHLScaler
- {
- public: // Constructors and destructor
-
- /**
- * Two-phased constructor.
- */
- static CIHLScaler* NewL( const TUint32 aOptions = 0 );
-
- /*
- * Virtual destructor.
- */
- virtual ~CIHLScaler();
-
- public: // From base class MIHLScaler
-
- /*
- * From MIHLScaler, see base class header.
- */
- TInt Scale( TRequestStatus& aStatus,
- const CFbsBitmap& aSrcBitmap,
- const TRect& aSrcRect,
- CFbsBitmap& aDstBitmap,
- const TRect& aDstRect );
-
- /*
- * From MIHLScaler, see base class header.
- */
- TBool IsBusy() const;
-
- /*
- * From MIHLScaler, see base class header.
- */
- void CancelProcess();
-
- /*
- * From MIHLScaler, see base class header.
- */
- void SetFilter( MIHFilter* aFilter );
-
- private: // From base class CActive
-
- /*
- * From CActive, see base class header.
- */
- void DoCancel();
-
- /*
- * From CActive, see base class header.
- */
- void RunL();
-
- /*
- * From CActive, see base class header.
- */
- TInt RunError( TInt aError );
-
- public: // Internal interface
-
- /**
- * Check if rectangle is inside size.
- * @since 3.0
- * @return ETrue if rectangle is fully inside given area, EFalse if not.
- */
- TBool IsValidRect( const TSize& aSize, const TRect& aRect );
-
- private: // Private methods
-
- /*
- * Initialize process parameters and stepper values.
- * @return ETrue if only doing scaling (and not rotating)
- */
- TBool InitStepperValues();
-
- /*
- * Select and initialize fastest possible code path
- */
-
- void InitCodePath(const TSize& aSrcSize, const TDisplayMode &aSrcMode, const TSize& aDstSize, const TDisplayMode &aDstMode, TBool aOnlyScaling);
-
- /*
- * Process step using nearest neighbour method.
- */
- TBool ProcessNearestNeighbour();
- TBool ProcessNearestNeighbour64K(); // For 16-bit non-compressed bitmaps
- TBool ProcessNearestNeighbour64KScaleOnly(); // For 16-bit non-compressed bitmaps (only scaling)
- TBool ProcessNearestNeighbour16MX(); // For 32-bit non-compressed bitmaps
- TBool ProcessNearestNeighbour16MXScaleOnly(); // For 32-bit non-compressed bitmaps (only scaling)
-
- /*
- * Process step using bilinear interpolation method.
- */
- TBool ProcessBilinear();
-
- /*
- * Complete dummy request. This causes RunL() method to be called.
- * Needed by state machine.
- */
- void SelfComplete();
-
- /*
- * Complete client process request.
- * This causes client RunL() method to be called.
- */
- void RequestComplete( TInt aReason );
-
- private: // Private constructors
-
- CIHLScaler( const TUint32 aOptions );
-
- private: // Data
-
- // Ref: Process status
- TRequestStatus* iScalerStatus;
- TBool iNeedProcess;
-
- // Process options
- const TUint32 iOptions;
-
- // Ref: Source bitmap
- const CFbsBitmap* iSrcBitmap;
- TRect iSrcRect;
-
- // Ref: Destination bitmaps
- CFbsBitmap* iDstBitmap;
- TRect iDstRect;
-
- // Process position and stepping
- TPoint iSrcIncrementInner;
- TPoint iSrcIncrementOuter;
- TPoint iSrcPos;
-
- TInt iDstIncrementInner;
- TInt iDstIncrementOuter;
- TPoint iDstPos;
-
- TInt iProcessInner;
- TInt iProcessOuter;
- TSize iProcessSize;
-
- // For fast code path
- TInt iSrcPitchInPixels;
- TInt iDstPitchInPixels;
- TUint32 iScanlinesLeft;
- TUint32 iScanlinesPerRound;
- TInt iDstStartOffset;
- TInt iDstResidualPixels;
-
- // Only for measuring scaler throughput
-#ifdef RD_MEASURE_THROUGHPUT
- TUint32 iStartTime;
-#endif
-
- /*
- * Forward process step event to selected processing code path
- * Called by RunL() method.
- */
- TBool (CIHLScaler::*ProcessingFunc)();
- };
-
-#endif // CIHLSCALER_H
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlinglib/Src/IHLBitmapUtil.cpp
--- a/imagehandlinglib/Src/IHLBitmapUtil.cpp Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,163 +0,0 @@
-/*
-* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Static utility class for synchronous CFbsBitmap operations.
-*
-*/
-
-
-// INCLUDE FILES
-#include
-#include
-
-// ============================ STATIC FUNCTIONS ===============================
-// -----------------------------------------------------------------------------
-// IHLBitmapUtil::DuplicateBitmapL
-// -----------------------------------------------------------------------------
-EXPORT_C CFbsBitmap* IHLBitmapUtil::DuplicateBitmapL( const CFbsBitmap& aBitmap )
- {
- CFbsBitmap* bitmap = DuplicateBitmapLC( aBitmap );
- CleanupStack::Pop(); // bitmap
- return bitmap;
- }
-
-// -----------------------------------------------------------------------------
-// IHLBitmapUtil::DuplicateBitmapLC
-// -----------------------------------------------------------------------------
-EXPORT_C CFbsBitmap* IHLBitmapUtil::DuplicateBitmapLC( const CFbsBitmap& aBitmap )
- {
- CFbsBitmap* bitmap = new(ELeave) CFbsBitmap;
- CleanupStack::PushL( bitmap );
- User::LeaveIfError( bitmap->Duplicate( aBitmap.Handle() ) );
- return bitmap;
- }
-
-// -----------------------------------------------------------------------------
-// IHLBitmapUtil::CopyBitmapL
-// -----------------------------------------------------------------------------
-EXPORT_C CFbsBitmap* IHLBitmapUtil::CopyBitmapL( const CFbsBitmap& aBitmap )
- {
- CFbsBitmap* bitmap = CopyBitmapLC( aBitmap );
- CleanupStack::Pop(); // bitmap
- return bitmap;
- }
-
-// -----------------------------------------------------------------------------
-// IHLBitmapUtil::CopyBitmapLC
-// -----------------------------------------------------------------------------
-EXPORT_C CFbsBitmap* IHLBitmapUtil::CopyBitmapLC( const CFbsBitmap& aBitmap )
- {
- CFbsBitmap* bitmap = new (ELeave) CFbsBitmap();
- CleanupStack::PushL( bitmap );
- if( !aBitmap.Handle() )
- {
- return bitmap;
- }
-
- TSize size( aBitmap.SizeInPixels() );
- TDisplayMode displayMode( aBitmap.DisplayMode() );
-
- User::LeaveIfError( bitmap->Create( size, displayMode ) );
-
- HBufC8* scanLine = HBufC8::NewLC(
- aBitmap.ScanLineLength( size.iWidth, displayMode ) );
- TPtr8 scanPtr( scanLine->Des() );
-
- TPoint pp;
- for ( TInt y( 0 ); y < size.iHeight; ++y )
- {
- pp.iY = y;
- aBitmap.GetScanLine( scanPtr, pp, size.iWidth, displayMode );
- bitmap->SetScanLine( scanPtr, y );
- }
-
- CleanupStack::PopAndDestroy(); // scanLine
-
- return bitmap;
- }
-
-// -----------------------------------------------------------------------------
-// IHLBitmapUtil::CopyBitmapL
-// -----------------------------------------------------------------------------
-EXPORT_C CFbsBitmap* IHLBitmapUtil::CopyBitmapL( const CFbsBitmap& aBitmap, const TRect& aRect )
- {
- CFbsBitmap* bitmap = CopyBitmapLC( aBitmap, aRect );
- CleanupStack::Pop(); // bitmap
- return bitmap;
- }
-
-// -----------------------------------------------------------------------------
-// IHLBitmapUtil::CopyBitmapLC
-// -----------------------------------------------------------------------------
-EXPORT_C CFbsBitmap* IHLBitmapUtil::CopyBitmapLC( const CFbsBitmap& aBitmap, const TRect& aRect )
- {
- CFbsBitmap* bitmap = new (ELeave) CFbsBitmap();
- CleanupStack::PushL( bitmap );
- if( !aBitmap.Handle() )
- {
- return bitmap;
- }
-
- TSize clipSize( aRect.Size() );
- TSize sourceSize( aBitmap.SizeInPixels() );
- if( aRect.iTl.iX == aRect.iBr.iX ||
- aRect.iTl.iY == aRect.iBr.iY ||
- aRect.iTl.iX < 0 ||
- aRect.iTl.iX > sourceSize.iWidth ||
- aRect.iTl.iY < 0 ||
- aRect.iTl.iY > sourceSize.iHeight )
- {
- User::Leave( KErrArgument );
- }
-
- TDisplayMode dispMode( aBitmap.DisplayMode() );
- User::LeaveIfError( bitmap->Create( clipSize, dispMode ) );
-
- HBufC8* scanLine = HBufC8::NewLC(
- aBitmap.ScanLineLength( clipSize.iWidth, dispMode ) );
- TPtr8 scanPtr( scanLine->Des() );
-
- TPoint pp( aRect.iTl );
- for ( TInt y( 0 ); y < clipSize.iHeight; ++y, ++pp.iY )
- {
- aBitmap.GetScanLine( scanPtr, pp, clipSize.iWidth, dispMode );
- bitmap->SetScanLine( scanPtr, y );
- }
-
- CleanupStack::PopAndDestroy(); // scanLine
- return bitmap;
- }
-
-// -----------------------------------------------------------------------------
-// IHLBitmapUtil::ScaleBitmap
-// -----------------------------------------------------------------------------
-EXPORT_C TInt IHLBitmapUtil::ScaleBitmap( const CFbsBitmap& /*aSrcBitmap*/,
- CFbsBitmap& /*aDstBitmap*/,
- TUint32 /*aOptions*/ )
- {
- return KErrNotSupported;
- }
-
-// -----------------------------------------------------------------------------
-// IHLBitmapUtil::ScaleBitmap
-// -----------------------------------------------------------------------------
-EXPORT_C TInt IHLBitmapUtil::ScaleBitmap( const CFbsBitmap& /*aSrcBitmap*/,
- const TRect& /*aSrcRect*/,
- CFbsBitmap& /*aDstBitmap*/,
- const TRect& /*aDstRect*/,
- TUint32 /*aOptions*/ )
- {
- return KErrNotSupported;
- }
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlinglib/Src/IHLDebugPrint.h
--- a/imagehandlinglib/Src/IHLDebugPrint.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,150 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: IHL debug macros
-*
-*/
-
-
-#ifndef IHLDEBUGPRINT_H
-#define IHLDEBUGPRINT_H
-
-// Debug logging is enabled, you may enable debug printing in release builds also
-#ifdef IHL_ENABLE_DEBUG_PRINT
-
- // warn if this is a release build!!
- #ifndef __WINSCW__
- #ifndef _DEBUG
- #if defined(__VC32__)
- #pragma message( "Warning: IHL debug printing is on in release build!" ) // CSI: 68 #
- #else // __GCC32__
- #warning "IHL debug printing is on in release build!"
- #endif // __VC32__
- #endif
- #endif // __WINSCW__
-
-// no include files if no debug printing --> faster compile time
-// INCLUDES
-#include
-#include
-
- /**
- * Helper macro for defining debug strings with just the debug text.
- */
- #define IHL_DEBUG_STRING(name,s) _LIT(name,s)
-
- /**
- * Output to debugger output
- */
- #define IHL_DEBUG_PRINT RDebug::Print
-
-#else // IHL_ENABLE_DEBUG_PRINT
-
- /**
- * Dummy struct for checking that all IHL_DEBUG_PRINT's define string
- * literals using space-saving IHL_DEBUG_STRING.
- */
- struct TIHLEmptyDebugString { }; // CSI: 80 #
-
- /**
- * Macro for defining debug-only literal strings (empty release version)
- */
- #define IHL_DEBUG_STRING(name, s) const TIHLEmptyDebugString name = {}
-
- /**
- * Output to debugger output (empty)
- */
- #define IHL_DEBUG_PRINT IHL_EmptyPrint
-
- namespace {
-
- /// Empty debug print function for release builds.
- inline void IHL_EmptyPrint(TIHLEmptyDebugString)
- {
- }
-
- /// Empty debug print function for release builds.
- template
- inline void IHL_EmptyPrint(TIHLEmptyDebugString,T1)
- {
- }
-
- /// Empty debug print function for release builds.
- template
- inline void IHL_EmptyPrint(TIHLEmptyDebugString,T1,T2)
- {
- }
-
- /// Empty debug print function for release builds.
- template
- inline void IHL_EmptyPrint(TIHLEmptyDebugString,T1,T2,T3)
- {
- }
-
- /// Empty debug print function for release builds.
- template
- inline void IHL_EmptyPrint(TIHLEmptyDebugString,T1,T2,T3,T4)
- {
- }
-
- /// Empty debug print function for release builds.
- template
- inline void IHL_EmptyPrint(TIHLEmptyDebugString,T1,T2,T3,T4,T5)
- {
- }
-
- /// Empty debug print function for release builds.
- template
- inline void IHL_EmptyPrint(TIHLEmptyDebugString,T1,T2,T3,T4,T5,T6)
- {
- }
-
- /// Empty debug print function for release builds.
- template
- inline void IHL_EmptyPrint(TIHLEmptyDebugString,T1,T2,T3,T4,T5,T6,T7)
- {
- }
-
- /// Empty debug print function for release builds.
- template
- inline void IHL_EmptyPrint(TIHLEmptyDebugString,T1,T2,T3,T4,T5,T6,T7,T8)
- {
- }
-
- } // unnamed namespace
-
-
-#endif // IHL_ENABLE_DEBUG_PRINT
-
-/**
- * Short variant for easier basic usage.
- */
-#define IHL_DEBUG1( name, s ) IHL_DEBUG_STRING( name, s ); IHL_DEBUG_PRINT( name );
-
-#ifdef IHL_ENABLE_DEBUG_PRINT
-#define IHL_DEBUG( s ) RDebug::Print( _L( s ) )
-#define IHL_DEBUG2( name, s, i ) IHL_DEBUG_STRING( name, s ); IHL_DEBUG_PRINT( name, i );
-#define IHL_DEBUG3( name, s, i, j ) IHL_DEBUG_STRING( name, s ); IHL_DEBUG_PRINT( name, i, j );
-#define IHL_DEBUG4( name, s, i, j, k ) IHL_DEBUG_STRING( name, s ); IHL_DEBUG_PRINT( name, i, j, k );
-#define IHL_DEBUG5( name, s, i, j, k, l ) IHL_DEBUG_STRING( name, s ); IHL_DEBUG_PRINT( name, i, j, k, l );
-#else
-// If debug printing is not enabled, strip other parameters than the string
-// away to prevent unwanted function calls in release build.
-#define IHL_DEBUG( s )
-#define IHL_DEBUG2( name, s, i ) IHL_DEBUG1( name, s )
-#define IHL_DEBUG3( name, s, i, j ) IHL_DEBUG1( name, s )
-#define IHL_DEBUG4( name, s, i, j, k ) IHL_DEBUG1( name, s )
-#define IHL_DEBUG5( name, s, i, j, k, l ) IHL_DEBUG1( name, s )
-#endif
-
-#endif // __IHLDEBUGPRINT_H__
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlinglib/Src/IHLImageFactory.cpp
--- a/imagehandlinglib/Src/IHLImageFactory.cpp Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,249 +0,0 @@
-/*
-* Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Static factory class for creating file instances.
-*
-*/
-
-
-// INCLUDE FILES
-#include
-
-#include "CIHLFileImage.h"
-#include "CIHLFileImageExtJpg.h"
-#include
-
-// Private namespace for constants and functions
-namespace
- {
- // First image index
- const TInt KIHLFirstImage = 0;
- const TInt KIHLNullOptions = 0;
-
- const TInt KMimeTypeStringLength = 255;
- _LIT( KJpgType, "image/jpeg" );
-
-
- // Helper functions
- // -----------------------------------------------------------------------------
- // OpenExtendedFileImageL
- // -----------------------------------------------------------------------------
- //
- CIHLFileImageExtJpg* OpenExtendedFileImageL( RFs& aFs, const TDesC& aFilename,
- TInt aImageIndex, const TUint32 aOptions )
- {
- CIHLFileImageExtJpg* fileImageExtJpg = NULL;
- TRAPD( err, fileImageExtJpg = CIHLFileImageExtJpg::NewL( aFs, aFilename,
- aImageIndex, aOptions ) );
- if( !err )
- {
- // Hw or Sw extended decoder found; check for cropping capability
- CleanupStack::PushL( fileImageExtJpg );
- if( !( fileImageExtJpg->CapabilitiesL() & CExtJpegDecoder::ECapCropping ) )
- {
- //Decoder does not support cropping, use the old implementation
- CleanupStack::PopAndDestroy( fileImageExtJpg );
- fileImageExtJpg = NULL;
- }
- else
- {
- CleanupStack::Pop( fileImageExtJpg );
- }
- }
-
- return fileImageExtJpg;
- }
-
- // -----------------------------------------------------------------------------
- // MimeTypeIsJpgL
- // -----------------------------------------------------------------------------
- //
- TBool MimeTypeIsJpgL( RFile& aFile )
- {
- using namespace ContentAccess;
-
- TBuf mime;
- CContent* content = CContent::NewL( aFile );
- CleanupStack::PushL( content );
- CData* data = content->OpenContentL( EPeek );
- CleanupStack::PushL( data );
- User::LeaveIfError( data->GetStringAttribute( EMimeType, mime ) );
- CleanupStack::PopAndDestroy( 2 ); //data, content
- if( mime.Compare( KJpgType ) == 0 ) return ETrue;
- return EFalse;
- }
- }
-
-// ============================ STATIC FUNCTIONS ===============================
-// -----------------------------------------------------------------------------
-// IHLImageFactory::OpenFileImageL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C MIHLFileImage* IHLImageFactory::OpenFileImageL( RFs& aFs, const TDesC& aFilename )
- {
- RFile fileHandle;
- TInt err( fileHandle.Open( aFs, aFilename, EFileShareReadersOnly ) );
- if( err )
- {
- User::LeaveIfError( fileHandle.Open( aFs, aFilename, EFileShareAny ) );
- }
- CleanupClosePushL( fileHandle );
-
- if ( MimeTypeIsJpgL( fileHandle ) )
- {
- CIHLFileImageExtJpg* fileImageExtJpg = OpenExtendedFileImageL( aFs,
- aFilename,
- KIHLFirstImage,
- KIHLNullOptions );
- if ( fileImageExtJpg )
- {
- CleanupStack::PopAndDestroy(); // fileHandle.Close()
- return fileImageExtJpg;
- }
- }
-
- CIHLFileImage* fileImage = CIHLFileImage::NewL( fileHandle, KIHLFirstImage, KIHLNullOptions );
-
- CleanupStack::PopAndDestroy(); // fileHandle.Close()
-
- return fileImage;
- }
-
-// -----------------------------------------------------------------------------
-// IHLImageFactory::OpenFileImageL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C MIHLFileImage* IHLImageFactory::OpenFileImageL( RFs& aFs, const TDesC& aFilename,
- TInt aImageIndex )
- {
- RFile fileHandle;
- TInt err( fileHandle.Open( aFs, aFilename, EFileShareReadersOnly ) );
- if( err )
- {
- User::LeaveIfError( fileHandle.Open( aFs, aFilename, EFileShareAny ) );
- }
- CleanupClosePushL( fileHandle );
-
- if ( MimeTypeIsJpgL( fileHandle ) )
- {
- CIHLFileImageExtJpg* fileImageExtJpg = OpenExtendedFileImageL( aFs,
- aFilename,
- aImageIndex,
- KIHLNullOptions );
- if ( fileImageExtJpg )
- {
- CleanupStack::PopAndDestroy(); // fileHandle.Close()
- return fileImageExtJpg;
- }
- }
-
- CIHLFileImage* fileImage = CIHLFileImage::NewL( fileHandle, aImageIndex, KIHLNullOptions );
-
- CleanupStack::PopAndDestroy(); // fileHandle.Close()
-
- return fileImage;
- }
-
-// -----------------------------------------------------------------------------
-// IHLImageFactory::OpenFileImageL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C MIHLFileImage* IHLImageFactory::OpenFileImageL( RFs& aFs, const TDesC& aFilename,
- TInt aImageIndex, const TUint32 aOptions )
- {
- RFile fileHandle;
- TInt err( fileHandle.Open( aFs, aFilename, EFileShareReadersOnly ) );
- if( err )
- {
- User::LeaveIfError( fileHandle.Open( aFs, aFilename, EFileShareAny ) );
- }
- CleanupClosePushL( fileHandle );
-
- if ( MimeTypeIsJpgL( fileHandle ) )
- {
- CIHLFileImageExtJpg* fileImageExtJpg = OpenExtendedFileImageL( aFs,
- aFilename,
- aImageIndex,
- aOptions );
- if ( fileImageExtJpg )
- {
- CleanupStack::PopAndDestroy(); // fileHandle.Close()
- return fileImageExtJpg;
- }
- }
-
- CIHLFileImage* fileImage = CIHLFileImage::NewL( fileHandle, aImageIndex, aOptions );
-
- CleanupStack::PopAndDestroy(); // fileHandle.Close()
-
- return fileImage;
- }
-
-// -----------------------------------------------------------------------------
-// IHLImageFactory::OpenFileImageL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C MIHLFileImage* IHLImageFactory::OpenFileImageL( RFile& aFile )
- {
- return CIHLFileImage::NewL( aFile, KIHLFirstImage, KIHLNullOptions );
- }
-
-// -----------------------------------------------------------------------------
-// IHLImageFactory::OpenFileImageL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C MIHLFileImage* IHLImageFactory::OpenFileImageL( RFile& aFile, TInt aImageIndex )
- {
- return CIHLFileImage::NewL( aFile, aImageIndex, KIHLNullOptions );
- }
-
-// -----------------------------------------------------------------------------
-// IHLImageFactory::OpenFileImageL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C MIHLFileImage* IHLImageFactory::OpenFileImageL( RFile& aFile, TInt aImageIndex,
- const TUint32 aOptions )
- {
- return CIHLFileImage::NewL( aFile, aImageIndex, aOptions );
- }
-
-// -----------------------------------------------------------------------------
-// IHLImageFactory::OpenBufferedFileImageL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C MIHLFileImage* IHLImageFactory::OpenBufferedFileImageL( RFs& aFs, const TDesC8& aDataBuf )
- {
- return CIHLFileImage::NewL( aFs, aDataBuf, KIHLFirstImage, KIHLNullOptions );
- }
-
-// -----------------------------------------------------------------------------
-// IHLImageFactory::OpenBufferedFileImageL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C MIHLFileImage* IHLImageFactory::OpenBufferedFileImageL( RFs& aFs,
- const TDesC8& aDataBuf, TInt aImageIndex )
- {
- return CIHLFileImage::NewL( aFs, aDataBuf, aImageIndex, KIHLNullOptions );
- }
-
-// -----------------------------------------------------------------------------
-// IHLImageFactory::OpenBufferedFileImageL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C MIHLFileImage* IHLImageFactory::OpenBufferedFileImageL( RFs& aFs,
- const TDesC8& aDataBuf, TInt aImageIndex, const TUint32 aOptions )
- {
- return CIHLFileImage::NewL( aFs, aDataBuf, aImageIndex, aOptions );
- }
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlinglib/Src/IHLImplementationIds.h
--- a/imagehandlinglib/Src/IHLImplementationIds.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
-* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation id's used in internal classes.
-*
-*/
-
-
-#ifndef IHLIMPLEMENTATIONIDS_H
-#define IHLIMPLEMENTATIONIDS_H
-
-// INCLUDES
-#include
-
-// -----------------------------------------------------------------------------
-// IMPLEMENTATION IDs
-// -----------------------------------------------------------------------------
-//
-// Images
-const TInt KIHLImplementationIdFileImage = 0x0101;
-const TInt KIHLImplementationIdFileImageExtJpg = 0x0102;
-
-// Processors
-const TInt KIHLImplementationIdBitmapProcessor = 0x0201;
-
-// Viewers
-const TInt KIHLImplementationIdImageViewer = 0x0301;
-const TInt KIHLImplementationIdImageViewerExtJpg = 0x0302;
-
-// Filters (reserved)
-// const TInt KIHLImplementationIdFilter = 0x0401; // CSI: 13 #
-
-#endif // IHLIMPLEMENTATIONIDS_H
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlinglib/Src/IHLProcessorFactory.cpp
--- a/imagehandlinglib/Src/IHLProcessorFactory.cpp Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
-* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Static factory class for creating processors.
-*
-*/
-
-
-
-// INCLUDE FILES
-#include
-#include "CIHLScaler.h"
-#include "CIHLBitmapProcessor.h"
-
-// ============================ STATIC FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// IHLProcessorFactory::CreateBitmapProcessorL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C MIHLBitmapProcessor* IHLProcessorFactory::CreateBitmapProcessorL( const TUint32 aOptions )
- {
- return CIHLBitmapProcessor::NewL( aOptions );
- }
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlinglib/Src/IHLViewerFactory.cpp
--- a/imagehandlinglib/Src/IHLViewerFactory.cpp Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
-* Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Static factory class for creating viewers.
-*
-*/
-
-
-// INCLUDE FILES
-#include
-
-#include "CIHLImageViewerExtJpg.h"
-#include "MIHLFileImageExtJpg.h"
-#include "IHLImplementationIds.h"
-
-#include "CIHLImageViewer.h"
-#include
-#include
-#include
-
-
-// ============================ STATIC FUNCTIONS ===============================
-// -----------------------------------------------------------------------------
-// IHLViewerFactory::CreateImageViewerL
-// -----------------------------------------------------------------------------
-//
-EXPORT_C MIHLImageViewer* IHLViewerFactory::CreateImageViewerL(
- const TSize& aViewerSize,
- MIHLImage& aSource,
- MIHLBitmap& aDestination,
- MIHLViewerObserver& aObserver,
- const TUint32 aOptions )
- {
- MIHLImageViewer* viewer = NULL;
- if( aSource.Type().iInterfaceId == KIHLInterfaceIdFileImage )
- {
- if( aSource.Type().iImplementationId == KIHLImplementationIdFileImageExtJpg )
- {
- viewer = CIHLImageViewerExtJpg::NewL( aViewerSize, static_cast< MIHLFileImageExtJpg& >( aSource ), // CSI: 35 #
- aDestination, aObserver, aOptions );
- }
- else
- {
- viewer = CIHLImageViewer::NewL( aViewerSize, static_cast< MIHLFileImage& >( aSource ), // CSI: 35 #
- aDestination, aObserver, aOptions );
- }
- }
- else
- {
- User::Leave( KErrArgument );
- }
- return viewer;
- }
-
-// End of File
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlinglib/Src/MIHLFileImageExtJpg.h
--- a/imagehandlinglib/Src/MIHLFileImageExtJpg.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Pure virtual interface for file based external jpg image class.
-* : This class acts as a window into single image or animation
-* : in one physical file. Note that file will be locked as long
-* : as instance of this class is present.
-*
-*/
-
-
-#ifndef MIHLFILEIMAGEEXTJPG_H
-#define MIHLFILEIMAGEEXTJPG_H
-
-// INCLUDES
-#include
-#include
-
-// FORWARD DECLARATION
-class MIHLBitmap;
-class MIHLFilter;
-class CVisualFrame;
-
-// CLASS DECLARATION
-/**
-* MIHLFileImageExtJpg
-*
-* Pure virtual interface for file based image class that uses IclExtJpegApi.
-* This class acts as a window into single image or animation
-* in one physical file. Note that file will be locked as long
-* as instance of this class is present.
-*
-* If interface needs to be pushed into CleanupStack,
-* remember to use CleanupDeletePushL() function!
-* DO NOT USE CleanupStack::PushL()!!
-*
-* @lib IHL.lib
-* @since 3.0
-*/
-class MIHLFileImageExtJpg : public MIHLFileImage
- {
- public:
-
- /**
- * Virtual destructor.
- */
- virtual ~MIHLFileImageExtJpg() {}
-
- public:
- /**
- * Load part of the image into bitmap.
- * @since 3.0
- * @param aSrcRect Part of the picture to be loaded
- * @param aStatus Load request status reference.
- * @param aDestination Destination bitmap reference.
- * @param aFrameIndex frame index for loading single frame from image
- * @return Return system wide error codes:
- * KerrArgument if given bitmap is not created or it's size is incorrect.
- * KErrBusy image has load request pending already.
- */
- virtual TInt Load( TRect aSrcRect, TRequestStatus& aStatus, MIHLBitmap& aDestination, TInt aFrameIndex = 0 ) = 0;
-
- public: //CExtJpegDecoder wrapper, see IclExtJpegApi.h
-
- virtual void SetCroppingL( TRect aCropRect ) = 0;
-
- virtual void SetStreamingL( TSize& aMacroBlockSize ) = 0;
-
- virtual void SetRotationL( TInt aDegree ) = 0;
-
- virtual void SetFlippingL() = 0;
-
- virtual void SetMirroringL() = 0;
-
- virtual void SetDctDecodingL() = 0;
-
- virtual void ConvertL(
- TRequestStatus* aRequestStatus,
- const CVisualFrame* aDestinationFrame,
- TInt& aNoOfDecodedMBlocks,
- TInt aFrameNumber = 0 ) = 0;
-
- virtual void ContinueConvertL(
- TRequestStatus* aRequestStatus,
- const CVisualFrame* aDestinationFrame,
- TInt& aNoOfDecodedMBlocks,
- TInt aFrameNumber = 0 ) = 0;
-
- virtual TInt SupportedFormatsL() = 0;
-
- virtual TInt CapabilitiesL() = 0;
-
-
- };
-#endif
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlinglib/eabi/IHLu.def
--- a/imagehandlinglib/eabi/IHLu.def Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-EXPORTS
- _ZN13IHLBitmapUtil11CopyBitmapLERK10CFbsBitmap @ 1 NONAME
- _ZN13IHLBitmapUtil11CopyBitmapLERK10CFbsBitmapRK5TRect @ 2 NONAME
- _ZN13IHLBitmapUtil11ScaleBitmapERK10CFbsBitmapRK5TRectRS0_S5_m @ 3 NONAME
- _ZN13IHLBitmapUtil11ScaleBitmapERK10CFbsBitmapRS0_m @ 4 NONAME
- _ZN13IHLBitmapUtil12CopyBitmapLCERK10CFbsBitmap @ 5 NONAME
- _ZN13IHLBitmapUtil12CopyBitmapLCERK10CFbsBitmapRK5TRect @ 6 NONAME
- _ZN13IHLBitmapUtil16DuplicateBitmapLERK10CFbsBitmap @ 7 NONAME
- _ZN13IHLBitmapUtil17DuplicateBitmapLCERK10CFbsBitmap @ 8 NONAME
- _ZN15IHLImageFactory14OpenFileImageLER3RFsRK7TDesC16 @ 9 NONAME
- _ZN15IHLImageFactory14OpenFileImageLER3RFsRK7TDesC16i @ 10 NONAME
- _ZN15IHLImageFactory14OpenFileImageLER5RFile @ 11 NONAME
- _ZN15IHLImageFactory14OpenFileImageLER5RFilei @ 12 NONAME
- _ZN16IHLViewerFactory18CreateImageViewerLERK5TSizeR9MIHLImageR10MIHLBitmapR18MIHLViewerObserverm @ 13 NONAME
- _ZN19IHLProcessorFactory22CreateBitmapProcessorLEm @ 14 NONAME
- _ZN9IHLBitmap7CreateLEv @ 15 NONAME
- _ZN9IHLScaler7CreateLEm @ 16 NONAME
- _ZN15IHLImageFactory14OpenFileImageLER3RFsRK7TDesC16im @ 17 NONAME
- _ZN15IHLImageFactory14OpenFileImageLER5RFileim @ 18 NONAME
- _ZN15IHLImageFactory22OpenBufferedFileImageLER3RFsRK6TDesC8 @ 19 NONAME
- _ZN15IHLImageFactory22OpenBufferedFileImageLER3RFsRK6TDesC8i @ 20 NONAME
- _ZN15IHLImageFactory22OpenBufferedFileImageLER3RFsRK6TDesC8im @ 21 NONAME
-
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/group/bld.inf
--- a/imagehandlingutilities/group/bld.inf Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-
-
-#include "../thumbnailmanager/group/bld.inf"
-
-
-
-// End of File
-
-
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/conf/102830B0.txt
Binary file imagehandlingutilities/thumbnailmanager/conf/102830B0.txt has changed
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/conf/thumbnailmanager.confml
Binary file imagehandlingutilities/thumbnailmanager/conf/thumbnailmanager.confml has changed
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/conf/thumbnailmanager_102830B0.crml
Binary file imagehandlingutilities/thumbnailmanager/conf/thumbnailmanager_102830B0.crml has changed
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/group/bld.inf
--- a/imagehandlingutilities/thumbnailmanager/group/bld.inf Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Build information file for project ?myapp
-*
-*/
-
-#include
-
-#ifdef RD_THUMBNAILMANAGER
-
-#include "../thumbnailclient/group/bld.inf"
-#include "../thumbnailserver/group/bld.inf"
-#include "../plugins/image/group/bld.inf"
-#include "../plugins/video/group/bld.inf"
-#include "../plugins/audio/group/bld.inf"
-#include "../tmiadrestart/group/bld.inf"
-#ifdef RD_MDS_2_5
-#include "../thumbagdaemon/group/bld.inf"
-#endif
-
-PRJ_PLATFORMS
-WINSCW ARMV5
-
-PRJ_EXPORTS
-../sis/thumbnailmanager/thumbnailmanager_stub.sis /epoc32/data/z/system/install/thumbnailmanager_stub.sis
-../conf/thumbnailmanager.confml MW_LAYER_CONFML(thumbnailmanager.confml)
-../conf/thumbnailmanager_102830B0.crml MW_LAYER_CRML(thumbnailmanager_102830b0.crml)
-../rom/thumbnailmanager.iby CORE_MW_LAYER_IBY_EXPORT_PATH(thumbnailmanager.iby)
-#ifdef RD_MDS_2_5
-../rom/thumbagdaemon.iby CORE_MW_LAYER_IBY_EXPORT_PATH(thumbagdaemon.iby)
-#endif
-
-PRJ_TESTMMPFILES
-
-PRJ_TESTEXPORTS
-../conf/102830B0.txt /epoc32/release/winscw/udeb/z/private/10202be9/102830b0.txt
-../conf/102830B0.txt /epoc32/release/winscw/urel/z/private/10202be9/102830b0.txt
-
-#endif // RD_THUMBNAILMANAGER
-
-// End of File
-
-
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/inc/thumbnaillog.h
--- a/imagehandlingutilities/thumbnailmanager/inc/thumbnaillog.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,115 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Logging functions
- *
-*/
-
-
-#ifndef THUMBNAILLOG_H
-#define THUMBNAILLOG_H
-
-#include
-#include
-
-//log to file instead of RDebug
-//#define LOG_TO_FILE
-
-//#define _DEBUG
-
-#ifdef _DEBUG
-#ifdef LOG_TO_FILE
-//
-// Log to file
-//
-#include
-_LIT( KThumbnailLogDir, "thumbnail" );
-_LIT( KThumbnailLogFile, "thumbnail.txt" );
-
-#define TN_DEBUG1( s ) \
-RFileLogger::Write( \
-KThumbnailLogDir, \
-KThumbnailLogFile, \
-EFileLoggingModeAppend, \
-_L( s ) );
-
-#define TN_DEBUG2( s, a ) \
-RFileLogger::WriteFormat( \
-KThumbnailLogDir, \
-KThumbnailLogFile, \
-EFileLoggingModeAppend, \
-_L( s ), a );
-
-#define TN_DEBUG3( s, a, b ) \
-RFileLogger::WriteFormat( \
-KThumbnailLogDir, \
-KThumbnailLogFile, \
-EFileLoggingModeAppend, \
-_L( s ), a, b );
-
-#define TN_DEBUG4( s, a, b, c ) \
-RFileLogger::WriteFormat( \
-KThumbnailLogDir, \
-KThumbnailLogFile, \
-EFileLoggingModeAppend, \
-_L( s ), a, b, c );
-
-#define TN_DEBUG5( s, a, b, c, d ) \
-RFileLogger::WriteFormat( \
-KThumbnailLogDir, \
-KThumbnailLogFile, \
-EFileLoggingModeAppend, \
-_L( s ), a, b, c, d );
-
-#define TN_DEBUG6( s, a, b, c, d, e ) \
-RFileLogger::WriteFormat( \
-KThumbnailLogDir, \
-KThumbnailLogFile, \
-EFileLoggingModeAppend, \
-_L( s ), a, b, c, d, e );
-
-#define TN_DEBUG7( s, a, b, c, d, e, f ) \
-RFileLogger::WriteFormat( \
-KThumbnailLogDir, \
-KThumbnailLogFile, \
-EFileLoggingModeAppend, \
-_L( s ), a, b, c, d, e, f );
-
-#else // LOG_TO_FILE
-//
-// Log to RDebug
-//
-#define TN_DEBUG1( s ) RDebug::Print( _L( s ) )
-#define TN_DEBUG2( s, a ) RDebug::Print( _L( s ), a )
-#define TN_DEBUG3( s, a, b ) RDebug::Print( _L( s ), a, b )
-#define TN_DEBUG4( s, a, b, c ) RDebug::Print( _L( s ), a, b, c )
-#define TN_DEBUG5( s, a, b, c, d ) RDebug::Print( _L( s ), a, b, c, d )
-#define TN_DEBUG6( s, a, b, c, d, e ) RDebug::Print( _L( s ), a, b, c, d, e )
-#define TN_DEBUG7( s, a, b, c, d, e, f ) RDebug::Print( _L( s ), a, b, c, d, e, f )
-
-#endif // LOG_TO_FILE
-
-#else // _DEBUG
-//
-// No logging
-//
-#define TN_DEBUG1( s )
-#define TN_DEBUG2( s, a )
-#define TN_DEBUG3( s, a, b )
-#define TN_DEBUG4( s, a, b, c )
-#define TN_DEBUG5( s, a, b, c, d )
-#define TN_DEBUG6( s, a, b, c, d, e )
-#define TN_DEBUG7( s, a, b, c, d, e, f )
-#endif // _DEBUG
-
-#endif // THUMBNAILLOG_H
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/inc/thumbnailmanagerconstants.h
--- a/imagehandlingutilities/thumbnailmanager/inc/thumbnailmanagerconstants.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,533 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Thumbnail manager constants
- *
-*/
-
-
-#ifndef THUMBNAILMANAGERCONSTANTS_H
-#define THUMBNAILMANAGERCONSTANTS_H
-
-#include
-#include
-#include
-#include
-#include
-
-#include "thumbnailmanager.h" // TThumbnailFlags
-
-class CThumbnailServerSession;
-
-// P&S stuff
-static _LIT_SECURITY_POLICY_PASS(KAllowAllPolicy);
-static _LIT_SECURITY_POLICY_C1(KPowerMgmtPolicy,ECapabilityPowerMgmt);
-
-const TUid KTMPSNotification = { 0x102830AB };
-const TUid KTAGDPSNotification = { 0x2001FD51 };
-const TUid KMdSPSShutdown = { 0x20022E94 };
-const TUid KServerIdle = { 0x102830AB };
-const TUid KDaemonUid = { 0x2001FD51 };
-
-const TInt KShutdown = 0x00000001;
-const TInt KMdSShutdown = 0x00000002;
-//used to signal from server side when it's idle
-const TInt KIdle = 0x00000004;
-//daemon exposes items in processing queues
-const TInt KItemsleft = 0x00000008;
-const TInt KForceBackgroundGeneration = 0x00000010;
-const TInt KMPXHarvesting = 0x00000020;
-const TInt KDaemonProcessing = 0x00000040;
-
-//insert to temp table first wo indexing and move data to main table as batch
-//actual batch size will vary and will be between min...max batch size values below
-
-//minimum batch size
-const TUint KMInBatchItems = 6;
-//maximum batch size
-const TUint KMaxBatchItems = 60;
-//Max allowed flush time ms
-const TUint KMaxFlushDelay = 3000; // 3 sec
-//Max allowed flush time on MTP/music collection refresh
-const TUint KMaxMTPFlushDelay = 15000; // 15 seconds
-
-//how many items daemon will query at once from MDS
-const TUint KMaxQueryItems = 100;
-// max items for PH & AllItems query
-const TUint KMaxQueryBatchSize = 100;
-
-// maximum number of active client side queue requests
-const TUint KMaxClientRequests = 2;
-
-#ifdef __RETRY_ON_SERVERCRASH
-// maximum number of request retry
-const TUint KMaxRequestRetryCount = 2;
-#endif
-
-// maximum number of active daemon requests
-const TUint KMaxDaemonRequests = 2;
-
-const TUint KMdEReconnect = 1*1000*1000; //1 second
-
-const TUint KUnmountTimerTimeout = 5*1000*1000; //5 seconds
-
-const TUint KClientRequestTimeout = 60000000; //60 sec
-const TUint KClientRequestStartErrorTimeout = 100000; //100 ms
-
-const TUint KThumbnailServerMajorVersionNumber = 0;
-const TUint KThumbnailServerMinorVersionNumber = 1;
-const TUint KThumbnailServerBuildVersionNumber = 1;
-
-const TInt KThumbnailErrThumbnailNotFound = -62000;
-
-//give MDS some to settle before starting generating TNs
-const TInt KHarvestingCompleteTimeout = 10000000; //10 sec
-
-//after MMC mount wait while before count is calculated
-const TInt KMountTimeout = 5*1000*1000; //5 sec
-
-const TInt KPSKeyTimeout = 10000000; //10 sec
-//Store's auto flush timeout
-const TInt KAutoFlushTimeout = 65; //65 sec
-
-// minimum background generation idle time seconds
-const TInt KBackgroundGenerationIdle = 60;
-// minimum store maintenance idle time seconds
-const TInt KStoreMaintenanceIdle = 65; // 65 sec
-// interval for store maintenance rounds
-const TInt KStoreMaintenancePeriodic = 100000; //100 ms
-
-// maximum number of rows deleted in one transaction
-const TInt KStoreMaintenanceDeleteLimit = 10;
-// maximum number of thumbs checked for source file existance
-const TInt KStoreMaintenanceExistLimit = 50;
-
-// video decoder timeout
-const TInt KVideoDecoderTimeout = 12000000; // 12 seconds
-
-const TDisplayMode KThumbnailDefaultDisplayMode = EColor64K;
-
-//default displaymode (bpp - bits per pixel) for TNs in DB
-//this makes possible to provide all colour depths up to 16M aka 24 -bit full colour
-//Symbian^4 EColor16MAP
-const TDisplayMode KStoreDisplayMode = EColor16MAP;
-
-//required amount of memory to keep bitmaps on RAM in bits
-const TInt KMemoryNeed = 5000000;
-
-const TInt64 KDiskFullThreshold = 1024*1024*10; // 10 MB
-
-_LIT( KThumbnailServerName, "ThumbnailServer" );
-_LIT( KThumbnailServerProcess, "*ThumbnailServer*" );
-_LIT( KThumbnailServerExe, "thumbnailserver.exe" );
-_LIT( KThumbnailServerShutdown, "Thumbnailserver_Shutdown" );
-
-_LIT( KTAGDaemonName, "ThumbAGDaemon" );
-_LIT( KTAGDaemonProcess, "*ThumbAGDaemon*" );
-_LIT( KTAGDaemonExe, "thumbagdaemon.exe" );
-
-// server message slots, -1 doesn't reserve fixed amount from global but uses free available amount instead
-const TInt KMessageSlots = -1;
-
-const TInt KMinPriority = KMinTInt;
-const TInt KMinPlaceholderPriority = (KMinTInt +1000);
-const TInt KLowPriority = -1000;
-const TInt KNormalPriority = 0;
-const TInt KHighPriority = 1000;
-const TInt KMaxGeneratePriority = (KMaxTInt -1000);
-const TInt KMaxPriority = KMaxTInt; // For scaling tasks
-const TInt KImeiBufferSize = CTelephony::KPhoneSerialNumberSize;
-const TInt KCheckValue = 123456;
-
-_LIT8( KJpegMime, "image/jpeg" ); _LIT( KJpegExt, ".jpeg" );
-_LIT8( KJpeg2000Mime, "image/jp2" ); _LIT( KJpeg2000Ext, ".jp2" );
-_LIT8( KJpgMime, "image/jpeg" ); _LIT( KJpgExt, ".jpg" );
-_LIT8( KGifMime, "image/gif" ); _LIT( KGifExt, ".gif" );
-_LIT8( KPngMime, "image/png" ); _LIT( KPngExt, ".png" );
-_LIT8( KSvgMime, "image/svg+xml" ); _LIT( KSvgExt, ".svg" );
-_LIT8( KMpgMime1, "video/mpeg"); _LIT( KMpgExt1, ".mpg" );
-_LIT8( KMpeg4Mime, "video/mpeg4" ); _LIT( KMpeg4Ext,".mpeg4" );
-_LIT8( KMp4Mime, "video/mp4" ); _LIT( KMp4Ext, ".mp4" ); _LIT( KM4vExt, ".m4v" );
-_LIT8( KAviMime, "video/x-msvideo" ); _LIT( KAviExt, ".avi" );
-_LIT8( KMp3Mime, "audio/mpeg" ); _LIT( KMp3Ext, ".mp3" );
-_LIT8( KNonEmbeddArtMime, "audio/mpeg" ); _LIT( KNonEmbeddArtExt, ".alb" );
-_LIT8( KM4aMime, "audio/mp4" ); _LIT( KM4aExt, ".m4a" );
-_LIT8( KAacMime, "audio/aac" ); _LIT( KAacExt, ".aac" );
-_LIT8( KWmaMime, "audio/x-ms-wma" ); _LIT( KWmaExt, ".wma" );
-_LIT8( KBmpMime, "image/bmp" ); _LIT( KBmpExt, ".bmp" );
-_LIT8( KAudio3gppMime, "audio/3gpp" );
-_LIT8( KVideo3gppMime, "video/3gpp" ); _LIT( K3gpExt, ".3gp" ); _LIT( K3gppExt, ".3gpp" );
-_LIT8( KAudioAmrMime, "audio/AMR" ); _LIT( KAmrExt, ".amr" );
-_LIT8( KVideoWmvMime, "video/x-ms-wmv" ); _LIT( KWmvExt, ".wmv" );
-_LIT8( KRealAudioMime, "audio/vnd.rn-realaudio" ); _LIT( KRealAudioExt, ".ra" );
-_LIT8( KPmRealAudioPluginMime, "audio/x-pn-realaudio-plugin" ); _LIT( KPmRealAudioPluginExt, ".rpm" );
-_LIT8( KPmRealVideoPluginMime, "video/x-pn-realvideo" ); _LIT( KPmRealVideoPluginExt, ".rm" );
-_LIT8( KPmRealVbVideoPluginMime, "video/x-pn-realvideo" ); _LIT( KPmRealVbVideoPluginExt, ".rmvb" );
-_LIT8( KPmRealAudioMime, "audio/x-pn-realaudio" ); _LIT( KPmRealAudioExt, ".ra" );
-_LIT8( KRealVideoMime, "video/vnd.rn-realvideo" ); _LIT( KRealVideoExt, ".rv" );
-_LIT8( KFlashVideoMime, "video/x-flv" ); _LIT( KFlashVideoExt, ".flv" );
-_LIT8( KMatroskaVideoMime, "video/x-matroska" ); _LIT( KMatroskaVideoExt, ".mkv" );
-_LIT8( KContactMime, "contact/x-vcard" ); _LIT( KContactExt, ".vcf" );
-
-_LIT( KNonEmbeddedArtExt, ".alb" );
-
-_LIT8( KAlbumArtMime, "audio/albumart" ); _LIT( KAlbumArtExt, ".maa" );
-
-_LIT( KImageMime, "image/*" );
-_LIT( KVideoMime, "video/*" );
-_LIT( KAudioMime, "audio/*" );
-
-_LIT( KPrivateFolder, ":\\private\\");
-_LIT( KSysFolder, ":\\sys\\");
-
-_LIT( KDrv, ":");
-_LIT( KBackSlash, "\\");
-
-const TInt KExtLength = 4;
-
-/**
- * Control flags set by the server for handling specific situations
- * (for example for distinguishing between preview thumbnails and
- * final thumbnails).
- *
- * @since S60 v5.0
- */
-enum TThumbnailControlFlags
- {
- /**
- * Default value. No flags set.
- */
- EThumbnailNoControlFlags = 0,
-
- /**
- * Set by the server when the request is completed and it is only the
- * first part of a two-phase request
- */
- EThumbnailPreviewThumbnail = 1,
-
- /**
- * Set by the client to inform server to create only missing persistent sizes thumbnails
- */
- EThumbnailGeneratePersistentSizesOnly = 2
-};
-
-
-/**
- * Thumbnail request parameters used for client-server communication.
- *
- * @since S60 v5.0
- */
-struct TThumbnailRequestParams
- {
-public:
- /**
- * Bitmap handle for completed requests
- */
- TInt iBitmapHandle;
-
- /**
- * Flags for new requests.
- */
- CThumbnailManager::TThumbnailFlags iFlags;
-
- /**
- * Quality-preference value for new requests.
- */
- CThumbnailManager::TThumbnailQualityPreference iQualityPreference;
-
- /**
- * Priority for new requests.
- */
- TInt iPriority;
-
- /**
- * Requested thumbnail size new requests.
- */
- TSize iSize;
-
- /**
- * Requested display mode new requests.
- */
- TDisplayMode iDisplayMode;
-
- /**
- * Full path to object file for new requests. Should be set even
- * when file handles are used.
- */
- TFileName iFileName;
-
- /**
- * Full path to object to which the imported thumb is to be linked.
- */
- TFileName iTargetUri;
-
- /**
- * Thumbnail ID
- */
- TThumbnailId iThumbnailId;
-
- /**
- * Relative thumbnail size
- */
- TThumbnailSize iThumbnailSize;
-
- /**
- * MIME type
- */
- TDataType iMimeType;
-
- /**
- * Image buffer used to create & set the thumbnail
- */
- TDesC8* iBuffer;
-
- /**
- * Session specific request ID allocated by the client.
- */
- TThumbnailRequestId iRequestId;
-
- /**
- * Control flags set by the server for handling specific situations
- * (for example for distinguishing between preview thumbnails and
- * final thumbnails).
- * Control flags may be modified by server to signal client side what actually was done, like preview TN
- */
- TThumbnailControlFlags iControlFlags;
-
- /**
- * Original control flags set by the server for handling specific situations
- * (for example for distinguishing between preview thumbnails and
- * final thumbnails).
- */
- TThumbnailControlFlags iOriginalControlFlags;
-
- /**
- * Thumbnail's modify timestamp
- */
- TInt64 iModified;
-
- /**
- * Thumbnail's orientation
- */
- TInt iOrientation;
-
- /**
- * Overwrite old thumbs (SetThumbnailL)
- */
- TBool iOverwrite;
-
- /**
- * URI is virtual
- */
- TBool iVirtualUri;
-
- /**
- * Target differs from source
- */
- TBool iImport;
- };
-
-
-typedef TPckg < TThumbnailRequestParams > TThumbnailRequestParamsPckg;
-typedef TPckgBuf < TThumbnailRequestParams > TThumbnailRequestParamsPckgBuf;
-
-
-/**
- * Request ID class used on the server side. Consists of a pointer to a
- * session and a session specific ID.
- *
- * @since S60 v5.0
- */
-struct TThumbnailServerRequestId
- {
- /**
- * Default C++ constructor
- *
- * @since S60 v5.0
- */
- inline TThumbnailServerRequestId(): iSession( NULL ), iRequestId( 0 ){}
-
- /**
- * C++ constructor
- *
- * @since S60 v5.0
- * @param aSession Pointer to the server-side session object, which
- * created the request.
- * @param aRequestId Session specific request ID as allocated by the
- * client.
- */
- inline TThumbnailServerRequestId( CThumbnailServerSession* aSession,
- TThumbnailRequestId aRequestId ): iSession( aSession ), iRequestId(
- aRequestId ){}
-
- /**
- * Compare request IDs. Both session and client-side request ID must
- * match.
- *
- * @param aRequestId Another TThumbnailServerRequestId to compare to
- * @since S60 v5.0
- */
- inline TBool operator == ( const TThumbnailServerRequestId& aRequestId )
- const
- {
- return aRequestId.iSession == iSession && aRequestId.iRequestId ==
- iRequestId;
- }
-
-public:
- /**
- * Pointer to the server-side session object, which created the request.
- * Not own.
- */
- CThumbnailServerSession* iSession;
-
- /**
- * Session specific request ID as allocated by the client.
- */
- TThumbnailRequestId iRequestId;
-};
-
-/**
- * Client-server message IDs
- *
- * @since S60 v5.0
- * Start from 0 so that TPolicy range matches to function count.
- */
-enum TThumbnailServerRequest
- {
- /**
- * Thumbnail request using file path. A TThumbnailRequestParams
- * struct is passed as a parameter.
- * @see TThumbnailRequestParams
- */
- ERequestThumbByPathAsync = 0,
-
- /**
- * Thumbnail request using file path. A TThumbnailRequestParams
- * struct is passed as a parameter as well as the file handle using
- * TransferToServer()/AdoptFromClient().
- * @see TThumbnailRequestParams
- */
- ERequestThumbByFileHandleAsync,
-
- /**
- * Release a bitmap after the client callback has returned. Bitmap
- * handle is passed as a parameter.
- */
- EReleaseBitmap,
-
- /**
- * Cancel a thumbnail request. Session specific request ID is passed
- * as a parameter.
- */
- ECancelRequest,
-
- /**
- * Change the priority of a thumbnail request. Session specific request
- * ID and new priority value are passed as parameters.
- */
- EChangePriority,
-
- /**
- * Deprecated
- *
- */
- ECreateThumbnails,
-
- /**
- * Delete existing thumbnails for a file. File path is passed as a
- * parameter.
- */
- EDeleteThumbnails,
-
- /**
- * Get the required size (in characters) for a buffer that contains the
- * list of supported MIME types. Size in integers is returned in the
- * first parameter.
- */
- EGetMimeTypeBufferSize,
-
- /**
- * Get the list of supported MIME types and store them as the first
- * parameter. The first parameter should be allocated by the client
- * to be large enough (using EGetMimeTypeBufferSize).
- */
- EGetMimeTypeList,
-
- /**
- * Thumbnail request using ID.
- */
- ERequestThumbByIdAsync,
-
- ERequestThumbByBufferAsync,
-
- /**
- * Request to set thumbnail created from buffered image
- */
- ERequestSetThumbnailByBuffer,
-
- /**
- * Delete existing thumbnails. Id as parameter.
- */
- EDeleteThumbnailsById,
-
- ERenameThumbnails,
-
- /**
- * Update thumbnails by given Id.
- */
- EUpdateThumbnails,
-
- /**
- * Request to set thumbnail created from given bitmap
- */
- ERequestSetThumbnailByBitmap,
-
- /**
- * Do not remove and keep as last item! Holds count of functions supported.
- */
- EThumbnailServerRequestCount
- };
-
-/**
- * Thumbnail format in storage
- *
- * @since S60 v5.0
- */
-enum TThumbnailFormat
- {
- /**
- * Symbian internal bitmap format, usually as extranlized BLOB in the db.
- */
- EThumbnailFormatFbsBitmap,
- /**
- * Stantard JPEG
- */
- EThumbnailFormatJpeg
- };
-
-
-/**
- * MDS query modes used during thumbnail generation
- *
- * @since S60 v5.0
- */
-enum TMDSQueryType
- {
- /**
- * Query Path by Id
- */
- EURI
- };
-
-#endif // THUMBNAILMANAGERCONSTANTS_H
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/inc/thumbnailmanagerprivatecrkeys.h
--- a/imagehandlingutilities/thumbnailmanager/inc/thumbnailmanagerprivatecrkeys.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Central Repository keys for Thumbnail Manager
- *
-*/
-
-
-#ifndef THUMBNAILMANAGERPRIVATECRKEYS_H
-#define THUMBNAILMANAGERPRIVATECRKEYS_H
-
-#include "thumbnailmanageruids.hrh"
-
-const TUid KThumbnailSettingsUid =
- {
- THUMBNAIL_CENREP_UID
- };
-
-const TUint32 KSizeImageGridWidth = 0x0;
-const TUint32 KSizeImageGridHeight = 0x1;
-const TUint32 KSizeImageListWidth = 0x2;
-const TUint32 KSizeImageListHeight = 0x3;
-const TUint32 KSizeImageFullscreenWidth = 0x4;
-const TUint32 KSizeImageFullscreenHeight = 0x5;
-const TUint32 KSizeVideoGridWidth = 0x6;
-const TUint32 KSizeVideoGridHeight = 0x7;
-const TUint32 KSizeVideoListWidth = 0x8;
-const TUint32 KSizeVideoListHeight = 0x9;
-const TUint32 KSizeVideoFullscreenWidth = 0x10;
-const TUint32 KSizeVideoFullscreenHeight = 0x11;
-const TUint32 KSizeAudioGridWidth = 0x12;
-const TUint32 KSizeAudioGridHeight = 0x13;
-const TUint32 KSizeAudioListWidth = 0x14;
-const TUint32 KSizeAudioListHeight = 0x15;
-const TUint32 KSizeAudioFullscreenWidth = 0x16;
-const TUint32 KSizeAudioFullscreenHeight = 0x17;
-const TUint32 KSizeContactListWidth = 0x18;
-const TUint32 KSizeContactListHeight = 0x19;
-const TUint32 KSizeContactGridWidth = 0x20;
-const TUint32 KSizeContactGridHeight = 0x21;
-const TUint32 KSizeContactFullscreenWidth = 0x22;
-const TUint32 KSizeContactFullscreenHeight = 0x23;
-
-const TUint32 KAutoCreateImageGrid = 0x100;
-const TUint32 KAutoCreateImageList = 0x101;
-const TUint32 KAutoCreateImageFullscreen = 0x102;
-const TUint32 KAutoCreateVideoGrid = 0x103;
-const TUint32 KAutoCreateVideoList = 0x104;
-const TUint32 KAutoCreateVideoFullscreen = 0x105;
-const TUint32 KAutoCreateAudioGrid = 0x106;
-const TUint32 KAutoCreateAudioList = 0x107;
-const TUint32 KAutoCreateAudioFullscreen = 0x108;
-const TUint32 KAutoCreateContactGrid = 0x109;
-const TUint32 KAutoCreateContactList = 0x110;
-const TUint32 KAutoCreateContactFullscreen = 0x111;
-
-const TUint32 KColorDepthGrid = 0x200;
-const TUint32 KColorDepthList = 0x201;
-const TUint32 KColorDepthFullscreen = 0x202;
-
-const TUint32 KEnableDaemon = 0x300;
-
-#endif // THUMBNAILMANAGERPRIVATECRKEYS_H
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/inc/thumbnailmanageruids.hrh
--- a/imagehandlingutilities/thumbnailmanager/inc/thumbnailmanageruids.hrh Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: UID values for Thumbnail Manager components
-*
-*/
-
-
-#ifndef THUMBNAILMANAGERUIDS_HRH
-#define THUMBNAILMANAGERUIDS_HRH
-
-#define THUMBNAIL_PROVIDER_IF_UID 0x102830A9
-#define THUMBNAIL_MANAGER_CLIENT_DLL_UID 0x102830AA
-#define THUMBNAIL_MANAGER_SERVER_UID 0x102830AB
-#define THUMBNAIL_IMAGE_PROVIDER_DLL_UID 0x102830AC
-#define THUMBNAIL_IMAGE_PROVIDER_IMP_UID 0x102830AD
-#define THUMBNAIL_VIDEO_PROVIDER_DLL_UID 0x102830AE
-#define THUMBNAIL_VIDEO_PROVIDER_IMP_UID 0x102830AF
-#define THUMBNAIL_CENREP_UID 0x102830B0
-#define THUMBNAIL_AUDIO_PROVIDER_DLL_UID 0x20022D5D
-#define THUMBNAIL_AUDIO_PROVIDER_IMP_UID 0x20022D5E
-
-#define THUMBAGDAEMON_UID 0x2001FD51
-#define THUMBAGDAEMON_SIS 0x102830A9
-
-#endif // THUMBNAILMANAGERUIDS_HRH
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/inc/thumbnailpanic.h
--- a/imagehandlingutilities/thumbnailmanager/inc/thumbnailpanic.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Panic codes for Thumbnail Manager
- *
-*/
-
-
-#ifndef THUMBNAILPANIC_H
-#define THUMBNAILPANIC_H
-
-#include
-
-_LIT( KThumbnailPanicCategory, "ThumbnailManager" );
-
-enum TThumbnailPanicCode
- {
- // Numerical values used to help finding the reason based on
- // panic code.
- EThumbnailNullPointer = 0, EThumbnailBadSize = 1, EThumbnailBadBitmapHandle
- = 2, EThumbnailBadPath = 3, EThumbnailUnknownMessage = 4,
- EThumbnailMessageNotCompleted = 5, EThumbnailBitmapNotReleased = 6,
- EThumbnailEmptyDescriptor = 7, EThumbnailWrongId = 8, EThumbnailAlreadyRunning =
- 9, EThumbnailDatabaseUnrecoverable = 10, EThumbnailSQLTransaction = 11
- };
-
-/**
- * Call User::Panic() with Thumbnail Manager panic category using
- * one of the panic codes above
- * @param aCode Panic code
- */
-inline void ThumbnailPanic( TThumbnailPanicCode aCode );
-
-/**
- * Panic if a pointer is NULL
- */
-#define TN_ASSERT_NOT_NULL( ptr ) \
-__ASSERT_ALWAYS( ptr, ThumbnailPanic( EThumbnailNullPointer ) );
-
-#include "thumbnailpanic.inl"
-
-
-#endif // THUMBNAILPANIC_H
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/inc/thumbnailpanic.inl
--- a/imagehandlingutilities/thumbnailmanager/inc/thumbnailpanic.inl Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Panic codes for Thumbnail Manager
-*
-*/
-
-
-// -----------------------------------------------------------------------------
-// Panic using numeric code
-// -----------------------------------------------------------------------------
-//
-inline void ThumbnailPanic( TThumbnailPanicCode aCode )
- {
- User::Panic( KThumbnailPanicCategory, static_cast( aCode ) );
- }
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/inc/thumbnailprovider.h
--- a/imagehandlingutilities/thumbnailmanager/inc/thumbnailprovider.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,232 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Base class for thumbnail provider plug-ins
- *
-*/
-
-
-#ifndef THUMBNAILPROVIDER_H
-#define THUMBNAILPROVIDER_H
-
-#include
-#include
-
-#include "thumbnailmanager.h" // TThumbnailFlags
-#include "thumbnaillog.h"
-
-/**
- * Thumbnail provider observer class
- *
- * @since S60 v5.0
- */
-class MThumbnailProviderObserver
- {
-public:
- /**
- * Thumbnail provider observer callback to notify the server when
- * thumbnail has been generated.
- *
- * @since S60 5.0
- * @param aError Error code
- * @param aBitmap Thumbnail bitmap. The observer implementation will
- * assume ownership of the bitmap.
- * @param aOriginalSize Original size of the object in pixels.
- * @param aEXIF ETrue if thumbnail origin is EXIF.
- */
- virtual void ThumbnailProviderReady( TInt aError, CFbsBitmap* aBitmap,
- const TSize& aOriginalSize, const TBool aEXIF, const TBool aPortrait ) = 0;
-};
-
-
-/**
- * Base class for thumbnail provider plug-ins.
- *
- * @since S60 v5.0
- */
-class CThumbnailProvider: public CBase
- {
-public:
- /**
- * Create a provider instance. The instance is identified
- * by the implementation UID.
- */
- static CThumbnailProvider* NewL( TUid aUid );
-
- /**
- * Get the UID of this provider.
- *
- * @since S60 5.0
- * @return Provider implementation UID
- */
- TUid Uid();
-
- /**
- * Set the observer to receive notification
- * about thumbnail generation completion.
- *
- * @since S60 5.0
- * @param aObserver Reference to the observing object. Ownership not
- * transferred.
- */
- void SetObserver( MThumbnailProviderObserver& aObserver );
-
- /**
- * Set the target size for uncropped thumbnails. The actual thumbnail
- * at least this wide or high, depending on which is the limiting
- * factor.
- *
- * @since S60 5.0
- * @param aSize Target size in pixels for uncropped thumbnails.
- */
- void SetTargetSize( const TSize& aSize );
-
- /**
- * Set the target size for cropped thumbnails. The actual thumbnail
- * at least this large and it will include the whole thumbnail,
- * not just the cropped portion.
- *
- * @since S60 5.0
- * @param aCroppedSize Target size in pixels for cropped thumbnails.
- */
- void SetCroppedTargetSize( const TSize& aCroppedSize );
-
- /**
- * Reset thumbnail parameters to defaults.
- */
- void Reset();
-
- /**
- * Get thumbnail bitmap. Must be implemented by provider plug-ins.
- *
- * @since S60 5.0
- * @param aFs File server session that can be used
- * @param aFile File handle to the object file
- * @param aMimeType MIME-type of the object file.
- * @param aFlags Thumbnail generation flags
- * @param aDisplayMode Display mode
- */
- virtual void GetThumbnailL( RFs& aFs, RFile64& aFile, const TDataType&
- aMimeType, const CThumbnailManager::TThumbnailFlags aFlags, const
- TDisplayMode aDisplayMode, const CThumbnailManager::TThumbnailQualityPreference aQualityPreference ) = 0;
-
- /**
- * Get thumbnail bitmap. Must be implemented by provider plug-ins.
- *
- * @since S60 5.0
- * @param aFs File server session that can be used
- * @param aBuffer object buffer
- * @param aMimeType MIME-type of the object file.
- * @param aFlags Thumbnail generation flags
- * @param aDisplayMode Display mode
- */
- virtual void GetThumbnailL( RFs& aFs, TDesC8* aBuffer, const
- TDataType& aMimeType, const CThumbnailManager::TThumbnailFlags aFlags,
- const TDisplayMode aDisplayMode, const CThumbnailManager::TThumbnailQualityPreference aQualityPreference ) = 0;
-
- /**
- * Get thumbnail bitmap. Must be implemented by provider plug-ins.
- *
- * @since S60 5.0
- * @param aFs File server session that can be used
- * @param aBuffer object buffer
- */
-
- virtual void GetThumbnailL( RFs& aFs, TDesC8& aBuffer) = 0;
-
- /**
- * Cancel a previous thumbnail request, if any.
- *
- * @since S60 5.0
- */
- virtual void CancelGetThumbnail() = 0;
-
- virtual ~CThumbnailProvider(){}
-
-protected:
- /**
- * Get the actual target size for the thumbnail.
- * This is the maximum of the non-cropped and cropped
- * target sizes.
- *
- * @since S60 5.0
- */
- inline void ResolveSize();
-
- /**
- * Calculate the scaled down size for the thumbnail.
- * Aspect ratio is always preserved. If cropping is disabled
- * the resulting size at most as wide or tall as requested.
- * If cropping is enabled, the result is at least as wide
- * and as tall as requested (unless original size is smaller
- * than requested).
- *
- * @since S60 5.0
- * @param aOriginalSize Original size in pixels
- * @param aTargetSize Target size in pixels
- * @param aCrop Enable cropping
- * @return Result size
- */
- inline TSize FitToSize( const TSize& aOriginalSize, const TSize&
- aTargetSize, TBool aCrop );
-
-protected:
- /**
- * Provider observer. Implemented by thumbnail generation task.
- * Not own.
- */
- MThumbnailProviderObserver* iObserver;
-
- /**
- * Thumbnail generation flags.
- */
- CThumbnailManager::TThumbnailFlags iFlags;
-
- /**
- * Thumbnail generation flags.
- */
- CThumbnailManager::TThumbnailQualityPreference iQualityPreference;
-
- /**
- * Size of the original object.
- */
- TSize iOriginalSize;
-
- /**
- * Target size for uncropped thumbnails.
- */
- TSize iTargetSize;
-
- /**
- * Target size for cropped thumbnails.
- */
- TSize iCroppedTargetSize;
-
- /**
- * Display mode for thumbnail bitmap
- */
- TDisplayMode iDisplayMode;
-
- /**
- * ECOM plug-in destructor key.
- */
- TUid iDtor_ID_Key;
-
- /**
- * UID of this implementation.
- */
- TUid iUid;
-};
-
-
-#endif // THUMBNAILPROVIDER_H
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/inc/thumbnailprovider.inl
--- a/imagehandlingutilities/thumbnailmanager/inc/thumbnailprovider.inl Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Thumbnail provider class inline functions
-*
-*/
-
-
-#include
-
-
-inline TSize CThumbnailProvider::FitToSize( const TSize& aOrigSize,
- const TSize& aTargetSize,
- TBool aCrop )
- {
- TSize res;
- TReal32 srcAspect =
- static_cast( aOrigSize.iWidth ) / aOrigSize.iHeight;
- TReal32 reqAspect =
- static_cast( aTargetSize.iWidth ) / aTargetSize.iHeight;
-
- res = aTargetSize;
-
- // Check whether the width or the height is the limiting factor for
- // the size
- TBool widthLimited = srcAspect > reqAspect;
- if ( aCrop )
- {
- // When cropping, this works exactly the opposite way
- widthLimited = srcAspect < reqAspect;
- }
-
- if ( res.iWidth >= aOrigSize.iWidth &&
- res.iHeight >= aOrigSize.iHeight )
- {
- // Original is smaller than requested. No scaling needed.
- res = aOrigSize;
- }
- else if ( widthLimited )
- {
- // Width is the limiting factor, ie. the thumbnail is
- // wide compared to requested size.
- TReal trg;
- TReal src( aTargetSize.iWidth / srcAspect );
- Math::Round( trg, src, 1 );
- res.SetSize(
- aTargetSize.iWidth,
- trg );
- }
- else
- {
- // Height is the limiting factor, ie. the thumbnail is
- // taller compared to requested size.
- TReal trg;
- TReal src( aTargetSize.iHeight * srcAspect );
- Math::Round( trg, src, 1 );
- res.SetSize(
- trg,
- aTargetSize.iHeight );
- }
- return res;
- }
-
-
-inline void CThumbnailProvider::ResolveSize()
- {
- // Get the actual target size for the thumbnail.
- // This is the maximum of the non-cropped and cropped
- // target sizes.
-
- TSize scaledSize = FitToSize( iOriginalSize, iTargetSize, EFalse );
- if ( iCroppedTargetSize.iHeight && iCroppedTargetSize.iWidth )
- {
- TSize croppedSize = FitToSize(
- iOriginalSize, iCroppedTargetSize, ETrue );
- scaledSize.iWidth = Max( scaledSize.iWidth, croppedSize.iWidth );
- scaledSize.iHeight = Max( scaledSize.iHeight, croppedSize.iHeight );
- }
- iTargetSize = scaledSize;
- TN_DEBUG3("CThumbnailProvider::ResolveSize() - iTargetSize=(%d, %d)",
- iTargetSize.iWidth, iTargetSize.iHeight);
- }
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/plugins/audio/group/bld.inf
--- a/imagehandlingutilities/thumbnailmanager/plugins/audio/group/bld.inf Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Build information file for project ?myapp
-*
-*/
-
-
-#include
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_MMPFILES
-thumbnailaudioprovider.mmp
-
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/plugins/audio/group/thumbnailaudioprovider.mmp
--- a/imagehandlingutilities/thumbnailmanager/plugins/audio/group/thumbnailaudioprovider.mmp Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Thumbnail image provider plugin definition file
-*
-*/
-
-
-// To get the MW_LAYER_SYSTEMINCLUDE-definition
-#include
-
-#include "../../../inc/thumbnailmanageruids.hrh"
-
-TARGET thumbnailaudioprovider.dll
-CAPABILITY CAP_ECOM_PLUGIN
-TARGETTYPE PLUGIN
-
-UID 0x10009D8D THUMBNAIL_AUDIO_PROVIDER_DLL_UID
-VENDORID VID_DEFAULT
-
-SOURCEPATH ../src
-SOURCE thumbnailaudioprovider.cpp
-SOURCE thumbnailimagedecoderv3.cpp
-
-// Default system include paths for middleware layer modules.
-MW_LAYER_SYSTEMINCLUDE
-
-USERINCLUDE ../inc
-USERINCLUDE ../../../inc ../traces
-
-SYSTEMINCLUDE /epoc32/include/ecom
-SYSTEMINCLUDE /epoc32/include/icl
-
-START RESOURCE thumbnailaudioprovider.rss
-END
-
-LIBRARY euser.lib
-LIBRARY ecom.lib
-LIBRARY efsrv.lib
-LIBRARY imageconversion.lib
-LIBRARY fbscli.lib
-LIBRARY exiflib.lib
-LIBRARY iclextjpegapi.lib
-LIBRARY apmime.lib
-LIBRARY metadatautility.lib
-
-
-DEBUGLIBRARY flogger.lib
-
-OPTION ARMCC -O3 -OTime
-
-PAGED
-BYTEPAIRCOMPRESSTARGET
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/plugins/audio/inc/thumbnailaudioprovider.h
--- a/imagehandlingutilities/thumbnailmanager/plugins/audio/inc/thumbnailaudioprovider.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,127 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Image thumbnail provider plugin.
- *
-*/
-
-
-#ifndef THUMBNAILAUDIOPROVIDER_H
-#define THUMBNAILAUDIOPROVIDER_H
-
-#include "thumbnailprovider.h"
-
-class CThumbnailImageDecoderv3;
-
-/**
- * Image thumbnail provider plugin.
- *
- * @since S60 v5.0
- */
-class CThumbnailAudioProvider: public CThumbnailProvider
- {
-
-public:
-
- /**
- * Two-phased constructor.
- *
- * @since S60 v5.0
- * @return New image thumbnail provider instance.
- */
- static CThumbnailAudioProvider* NewL();
-
- /**
- * Destructor
- *
- * @since S60 v5.0
- */
- virtual ~CThumbnailAudioProvider();
-
- /**
- * Function that will provide thumbnail from given parameters.
- *
- * @since S60 v5.0
- * @param aFs File server session
- * @param aFile Source image file.
- * @param aMimeType MIME-type of the image file.
- * @param aFlags Flags for thumbnail creation.
- * @param aDisplayMode Used display mode.
- */
- void GetThumbnailL( RFs& aFs, RFile64& aFile, const TDataType& aMimeType,
- const CThumbnailManager::TThumbnailFlags aFlags, const TDisplayMode
- aDisplayMode, const CThumbnailManager::TThumbnailQualityPreference aQualityPreference );
-
- /**
- * Function that will provide thumbnail from given parameters.
- *
- * @since S60 v5.0
- * @param aFs File server session
- * @param aBuffer Source image buffer.
- * @param aMimeType MIME-type of the image file.
- * @param aFlags Flags for thumbnail creation.
- * @param aDisplayMode Used display mode.
- */
- void GetThumbnailL( RFs& aFs, TDesC8* aBuffer, const
- TDataType& aMimeType, const CThumbnailManager::TThumbnailFlags aFlags,
- const TDisplayMode aDisplayMode, const CThumbnailManager::TThumbnailQualityPreference aQualityPreference );
-
- /**
- * Function that will provide thumbnail from given parameters.
- *
- * @since S60 v5.0
- * @param aFs File server session
- * @param aBuffer Source image buffer.
- */
- void GetThumbnailL( RFs& aFs, TDesC8& aBuffer);
-
- /**
- * Cancel a previous thumbnail request, if any.
- *
- * @since S60 5.0
- */
- void CancelGetThumbnail();
-
-private:
-
- /**
- * C++ default constructor
- *
- * @since S60 v5.0
- * @return New image thumbnail provider instance.
- */
- CThumbnailAudioProvider();
-
-private:
-
- /**
- * Thumbnail decoder.
- */
- CThumbnailImageDecoderv3* iImageDecoderv3;
-
-
- /**
- * File server session.
- * Not own.
- */
- RFs iFs;
-
- /**
- * Mime-type of image
- */
- TDataType iMimeType;
-};
-
-#include "thumbnailprovider.inl"
-
-#endif // THUMBNAILIMAGEPROVIDER_H
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/plugins/audio/inc/thumbnailimagedecoderv3.h
--- a/imagehandlingutilities/thumbnailmanager/plugins/audio/inc/thumbnailimagedecoderv3.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,180 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Image thumbnail decoder.
- *
-*/
-
-
-#ifndef THUMBNAILIMAGEDECODERV3_H
-#define THUMBNAILIMAGEDECODERV3_H
-
-#include "thumbnailprovider.h"
-
-class CImageDecoder;
-class CFbsBitmap;
-
-// Size of buffer to load from file start to get EXIF thumbnail
-const TInt KJpegLoadBufferSize = 64 * 1024;
-
-
-/**
- * Image thumbnail decoder.
- *
- * @since S60 v5.0
- */
-class CThumbnailImageDecoderv3: public CActive
- {
-public:
-
- /**
- * C++ default constructor
- *
- * @since S60 v5.0
- * @param aFs File server session
- * @return New image thumbnail decoder instance.
- */
- CThumbnailImageDecoderv3( RFs& aFs );
-
- /**
- * Destructor
- *
- * @since S60 v5.0
- */
- virtual ~CThumbnailImageDecoderv3();
-
-
- /**
- * Creates a decoder from the given image buffer and gets image
- * information
- *
- * @since S60 v5.0
- * @param aBuffer Source image buffer.
- * @param aObserver Observer to relay notifications about completed
- * operations.
- * @param aFlags Decoding option flags.
- * @param aMimeType Mime-type of image to be decoded.
- * @param aSize desired size of thumbnail.
- */
- void CreateL( const TDesC8* aBuffer, MThumbnailProviderObserver&
- aObserver, const CThumbnailManager::TThumbnailFlags aFlags, const
- TDataType& aMimeType, const TSize& aSize );
-
- /**
- * Decode image.
- *
- * @since S60 v5.0
- * @param aDisplayMode Preferred display mode.
- */
- void DecodeL( const TDisplayMode aDisplayMode );
-
- /**
- * Returns the size of original image.
- *
- * @since S60 v5.0
- * @return Size of original image.
- */
- const TSize& OriginalSize()const;
-
- /**
- * Leave if image is corrupt
- *
- * @since S60 v5.0
- */
- void LeaveIfCorruptL(const TInt aError );
-
-private:
- /**
- * Used to release reserved resources.
- *
- * @since S60 v5.0
- */
- void Release();
-
- /**
- * Implements cancellation of an outstanding request.
- *
- * @since S60 v5.0
- */
- void DoCancel();
-
- /**
- * Handles an active object's request completion event.
- *
- * @since S60 v5.0
- */
- void RunL();
-
-
- /**
- * Creates image decoder to be used.
- *
- * @since S60 v5.0
- */
- void CreateDecoderL();
-
-
-
-private:
- // data
-
- /**
- * Requested size.
- */
- TSize iSize;
-
- /**
- * Image decoder.
- * Own.
- */
- CImageDecoder* iDecoder;
-
- /**
- * Decoded bitmap.
- * Own.
- */
- CFbsBitmap* iBitmap;
-
- /**
- * Image info flags (from TFrameInfo)
- */
- TUint32 iFrameInfoFlags;
-
- /**
- * Original size of the image in pixels.
- */
- TSize iOriginalSize;
-
- /**
- * Used fileserver.
- */
- RFs& iFs;
-
-
- /**
- * Buffer from which thumbnail is to be created.
- */
- const TDesC8* iBuffer;
-
- /**
- * Observer.
- */
- MThumbnailProviderObserver* iObserver; // not own
-
- /**
- * Mime-type.
- */
- TDataType iMimeType;
-};
-
-#endif // THUMBNAILIMAGEDECODERV3_H
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/plugins/audio/src/thumbnailaudioprovider.cpp
--- a/imagehandlingutilities/thumbnailmanager/plugins/audio/src/thumbnailaudioprovider.cpp Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,209 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Audio thumbnail provider plugin
- *
-*/
-
-
-#include
-#include
-
-#include "thumbnailaudioprovider.h"
-#include "thumbnailimagedecoderv3.h"
-#include "thumbnailmanageruids.hrh"
-#include "thumbnaillog.h"
-#include
-#include
-#include "thumbnailmanagerconstants.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "thumbnailaudioproviderTraces.h"
-#endif
-
-
-
-#ifndef IMPLEMENTATION_PROXY_ENTRY
-typedef TAny* TProxyNewLPtr;
-#define IMPLEMENTATION_PROXY_ENTRY(aUid, aFuncPtr) \
-{ {aUid}, static_cast(aFuncPtr) }
-#endif
-
-
-// ======== MEMBER FUNCTIONS ========
-
-// ---------------------------------------------------------------------------
-// CThumbnailImageProvider::NewL()
-// Two-phased constructor.
-// ---------------------------------------------------------------------------
-//
-CThumbnailAudioProvider* CThumbnailAudioProvider::NewL()
- {
- CThumbnailAudioProvider* self = new( ELeave )CThumbnailAudioProvider();
- return self;
- }
-
-
-// ---------------------------------------------------------------------------
-// CThumbnailAudioProvider::CThumbnailAudioProvider()
-// C++ default constructor can NOT contain any code, that might leave.
-// ---------------------------------------------------------------------------
-//
-CThumbnailAudioProvider::CThumbnailAudioProvider()
- {
- TN_DEBUG1( "CThumbnailAudioProvider::CThumbnailAudioProvider()" );
- OstTrace0( TRACE_NORMAL, CTHUMBNAILAUDIOPROVIDER_CTHUMBNAILAUDIOPROVIDER, "CThumbnailAudioProvider::CThumbnailAudioProvider" );
- }
-
-
-// ---------------------------------------------------------------------------
-// CThumbnailAudioProvider::~CThumbnailAudioProvider()
-// Destructor.
-// ---------------------------------------------------------------------------
-//
-CThumbnailAudioProvider::~CThumbnailAudioProvider()
- {
- TN_DEBUG1( "CThumbnailAudioProvider::~CThumbnailAudioProvider()" );
- OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILAUDIOPROVIDER_CTHUMBNAILAUDIOPROVIDER, "CThumbnailAudioProvider::~CThumbnailAudioProvider" );
-
- delete iImageDecoderv3;
- iImageDecoderv3 = NULL;
- REComSession::DestroyedImplementation( iDtor_ID_Key );
- }
-
-
-// ---------------------------------------------------------------------------
-// CThumbnailAudioProvider::GetThumbnailL()
-// Provides the thumbnail image
-// ---------------------------------------------------------------------------
-//
-void CThumbnailAudioProvider::GetThumbnailL( RFs& aFs, RFile64& aFile, const
- TDataType& aMimeType , const CThumbnailManager::TThumbnailFlags aFlags,
- const TDisplayMode /*aDisplayMode*/, const CThumbnailManager::TThumbnailQualityPreference /*aQualityPreference*/ )
- {
- TN_DEBUG1( "CThumbnailAudioProvider::GetThumbnailL() - rfile " );
- OstTrace0( TRACE_NORMAL, CTHUMBNAILAUDIOPROVIDER_GETTHUMBNAILL, "CThumbnailAudioProvider::GetThumbnailL - rfile" );
- CMetaDataUtility* metaDataUtil = CMetaDataUtility::NewL();
- CleanupStack::PushL( metaDataUtil );
-
- RArray wantedFields;
- CleanupClosePushL(wantedFields);
- wantedFields.AppendL(EMetaDataJpeg);
-
- metaDataUtil->OpenFileL(aFile, wantedFields, aMimeType.Des8());
- const CMetaDataFieldContainer& metaCont = metaDataUtil->MetaDataFieldsL();
- TPtrC8 ptr = metaCont.Field8( EMetaDataJpeg );
- HBufC8* data = ptr.AllocL();
-
- CleanupStack::PopAndDestroy(&wantedFields);
- CleanupStack::PopAndDestroy(metaDataUtil);
- CleanupStack::PushL( data );
-
- if(data->Length() == 0)
- {
- User::Leave( KErrNotFound );
- }
-
- if ( !iImageDecoderv3 )
- {
- iImageDecoderv3 = new( ELeave )CThumbnailImageDecoderv3( aFs );
- }
-
- iMimeType = TDataType(KJpegMime);
- iFlags = aFlags;
- //set default mode displaymode from global constants
- iDisplayMode = KStoreDisplayMode;
- TRAPD( err, iImageDecoderv3->CreateL( data, *iObserver, iFlags, iMimeType, iTargetSize ) );
- if (err == KErrNone)
- {
- CleanupStack::Pop( data );
- }
- else
- {
- // this is because data buffer is already released in CreateDecoderL
- // and we must prevent automatic PopAndDestroy
- CleanupStack::Pop( data );
- User::Leave(err);
- }
-
- iOriginalSize = iImageDecoderv3->OriginalSize();
- iImageDecoderv3->DecodeL( iDisplayMode );
- }
-
-// ---------------------------------------------------------------------------
-// CThumbnailAudioProvider::GetThumbnailL()
-// Provides the thumbnail image
-// ---------------------------------------------------------------------------
-//
-void CThumbnailAudioProvider::GetThumbnailL( RFs& /* aFs */, TDesC8* /* aBuffer */, const
- TDataType& /*aMimeType */, const CThumbnailManager::TThumbnailFlags /* aFlags */,
- const TDisplayMode /* aDisplayMode */, const CThumbnailManager::TThumbnailQualityPreference /*aQualityPreference*/ )
- {
- TN_DEBUG1( "CThumbnailAudioProvider::GetThumbnailL() - buffer" );
- OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILAUDIOPROVIDER_GETTHUMBNAILL, "CThumbnailAudioProvider::GetThumbnailL - buffer" );
- __ASSERT_DEBUG((EFalse), User::Panic(_L("CThumbnailAudioProvider::GetThumbnailL"), KErrNotSupported));
- }
-
-// ---------------------------------------------------------------------------
-// CThumbnailAudioProvider::GetThumbnailL()
-// Provides the thumbnail image
-// ---------------------------------------------------------------------------
-//
-void CThumbnailAudioProvider::GetThumbnailL( RFs& /* aFs */, TDesC8& /*aBuffer */)
- {
- TN_DEBUG1( "CThumbnailAudioProvider::GetThumbnailL() - buffer no mime" );
- OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILAUDIOPROVIDER_GETTHUMBNAILL, "CThumbnailAudioProvider::GetThumbnailL - buffer no mime" );
- __ASSERT_DEBUG((EFalse), User::Panic(_L("CThumbnailAudioProvider::GetThumbnailL"), KErrNotSupported));
- User::Leave( KErrNotSupported );
- }
-
-// ---------------------------------------------------------------------------
-// Cancel thumbnail request
-// ---------------------------------------------------------------------------
-//
-void CThumbnailAudioProvider::CancelGetThumbnail()
- {
- if ( iImageDecoderv3)
- {
- iImageDecoderv3->Cancel();
- }
-
- }
-
-// ======== GLOBAL FUNCTIONS ========
-
-// -----------------------------------------------------------------------------
-// ImplementationTable
-// Define the interface UIDs
-// -----------------------------------------------------------------------------
-//
-const TImplementationProxy ImplementationTable[] =
- {
- IMPLEMENTATION_PROXY_ENTRY( THUMBNAIL_AUDIO_PROVIDER_IMP_UID,
- CThumbnailAudioProvider::NewL )
-};
-
-
-// -----------------------------------------------------------------------------
-// ImplementationGroupProxy
-// The one and only exported function that is the ECom entry point
-// -----------------------------------------------------------------------------
-//
-EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt&
- aTableCount )
- {
- aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy );
- return ImplementationTable;
- }
-
-//End of file
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/plugins/audio/src/thumbnailaudioprovider.rss
--- a/imagehandlingutilities/thumbnailmanager/plugins/audio/src/thumbnailaudioprovider.rss Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Image thumbnail provider plugin resource file
-*
-*/
-
-
-#include "registryinfov2.rh"
-#include "thumbnailmanageruids.hrh"
-
-RESOURCE REGISTRY_INFO theInfo
-{
-// resource_format_version must always be set as follows
-resource_format_version = RESOURCE_FORMAT_VERSION_2;
-
-// Normal plug-in parameters
-dll_uid = THUMBNAIL_AUDIO_PROVIDER_DLL_UID;
-interfaces =
- {
- INTERFACE_INFO
- {
- interface_uid = THUMBNAIL_PROVIDER_IF_UID;
- implementations =
- {
- IMPLEMENTATION_INFO
- {
- implementation_uid = THUMBNAIL_AUDIO_PROVIDER_IMP_UID;
- version_no = 1;
- display_name = "";
- default_data = "";
- opaque_data = "audio/*";
- rom_only = 0;
- }
- };
- }
- };
-}
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/plugins/audio/src/thumbnailimagedecoderv3.cpp
--- a/imagehandlingutilities/thumbnailmanager/plugins/audio/src/thumbnailimagedecoderv3.cpp Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,302 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Image thumbnail decoder
- *
-*/
-
-
-//INCLUDE FILES
-#include
-#include
-#include
-
-#include
-#include "thumbnailimagedecoderv3.h"
-#include "thumbnaillog.h"
-#include "thumbnailpanic.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "thumbnailimagedecoderv3Traces.h"
-#endif
-
-
-
-// CImageDecoder supports up to 1/8 size reduction if EFullyScaleable is
-// not set.
-const TInt KMaximumReductionFactor = 8;
-
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// ---------------------------------------------------------------------------
-// CThumbnailImageDecoder::CThumbnailImageDecoder()
-// C++ default constructor can NOT contain any code, that might leave.
-// ---------------------------------------------------------------------------
-//
-CThumbnailImageDecoderv3::CThumbnailImageDecoderv3( RFs& aFs ):
- CActive(EPriorityStandard ), iBitmap( NULL ), iFs( aFs ), iBuffer( NULL )
- {
- CActiveScheduler::Add( this );
- }
-
-
-// ---------------------------------------------------------------------------
-// CThumbnailImageDecoderv3::~CThumbnailImageDecoderv3()
-// Destructor.
-// ---------------------------------------------------------------------------
-//
-CThumbnailImageDecoderv3::~CThumbnailImageDecoderv3()
- {
- Release();
- }
-
-
-// -----------------------------------------------------------------------------
-// CThumbnailImageDecoderv3::CreateL()
-// Creates thumbnail of image
-// -----------------------------------------------------------------------------
-//
-void CThumbnailImageDecoderv3::CreateL( const TDesC8* aBuffer, MThumbnailProviderObserver&
- aObserver, const CThumbnailManager::TThumbnailFlags /*aFlags*/, const
- TDataType& aMimeType, const TSize& aSize )
- {
-
- TN_DEBUG1( "CCThumbnailImageDecoderv3::CreateL() called" );
- OstTrace0( TRACE_NORMAL, CTHUMBNAILIMAGEDECODERV3_CREATEL, "CThumbnailImageDecoderv3::CreateL" );
-
- iSize = aSize;
- iMimeType = aMimeType;
- iObserver = &aObserver;
- iBuffer = aBuffer;
-
- CreateDecoderL();
-
- const TFrameInfo info( iDecoder->FrameInfo());
- if (( info.iOverallSizeInPixels.iWidth < 1 ) || (
- info.iOverallSizeInPixels.iHeight < 1 ))
- {
- User::Leave( KErrCorrupt );
- }
- iFrameInfoFlags = info.iFlags;
- iOriginalSize = info.iOverallSizeInPixels;
- }
-
-// -----------------------------------------------------------------------------
-// CThumbnailImageDecoderv3::DecodeL()
-// Decode the thumbnail image
-// -----------------------------------------------------------------------------
-//
-void CThumbnailImageDecoderv3::DecodeL( const TDisplayMode aDisplayMode )
- {
- TN_DEBUG1( "CThumbnailImageDecoderv3::DecodeL() start" );
- OstTrace0( TRACE_NORMAL, CTHUMBNAILIMAGEDECODERV3_DECODEL, "CThumbnailImageDecoderv3::DecodeL - start" );
-
- // Create the bitmap
- if ( !iBitmap )
- {
- iBitmap = new( ELeave )CFbsBitmap();
- }
-
- //Size in both x and y dimension must be non-zero, positive value
- TSize loadSize( iOriginalSize) ;
-
- // If EFullyScaleable flag is not set, we need to figure out a size
- // reduction factor. 1/1, 1/2, 1/4, and 1/8 are possible values for all
- // plug-ins. SVG graphics can be rendered at any size even though
- // EFullyScaleable is not set.
- if ( !( iFrameInfoFlags& TFrameInfo::EFullyScaleable ) )
- {
- loadSize = iOriginalSize;
- TInt reductionFactor = 1;
- while ( reductionFactor < KMaximumReductionFactor && ( iSize.iWidth <
- loadSize.iWidth / 2 ) && ( iSize.iHeight < loadSize.iHeight / 2 ))
- {
- // magic: use loadSize that is half of previous size
- loadSize.iWidth /= 2;
- loadSize.iHeight /= 2;
- reductionFactor *= 2;
- }
- // If original size is not an exact multiple of reduction factor,
- // we need to round loadSize up
- if ( reductionFactor && iOriginalSize.iWidth % reductionFactor )
- {
- loadSize.iWidth++;
- }
- if ( reductionFactor && iOriginalSize.iHeight % reductionFactor )
- {
- loadSize.iHeight++;
- }
- TN_DEBUG4(
- "EFullyScaleable not set for image - loadSize=(%d,%d) reduction=1/%d ", loadSize.iWidth, loadSize.iHeight, reductionFactor );
- OstTraceExt3( TRACE_NORMAL, DUP1_CTHUMBNAILIMAGEDECODERV3_DECODEL, "CThumbnailImageDecoderv3::DecodeL;loadSize.iWidth=%d;loadSize.iHeight=%d;reductionFactor=%d", loadSize.iWidth, loadSize.iHeight, reductionFactor );
- }
-
- TInt err = iBitmap->Create( loadSize, aDisplayMode );
- if (err != KErrNone)
- {
- Release();
- User::Leave(err);
- }
-
- iDecoder->Convert( &iStatus, * iBitmap );
-
- SetActive();
-
- TN_DEBUG1( "CThumbnailImageDecoderv3::DecodeL() end" );
- OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILIMAGEDECODERV3_DECODEL, "CThumbnailImageDecoderv3::DecodeL - end" );
- }
-
-
-// -----------------------------------------------------------------------------
-// CThumbnailImageDecoderv3::Release()
-// Releases resources
-// -----------------------------------------------------------------------------
-//
-void CThumbnailImageDecoderv3::Release()
- {
- Cancel();
-
- delete iDecoder;
- iDecoder = NULL;
-
- delete iBitmap;
- iBitmap = NULL;
- delete iBuffer; // we own the buffer
- iBuffer = NULL;
- }
-
-
-// -----------------------------------------------------------------------------
-// CThumbnailImageDecoderv3::DoCancel()
-// -----------------------------------------------------------------------------
-//
-void CThumbnailImageDecoderv3::DoCancel()
- {
- if ( iDecoder )
- {
- iDecoder->Cancel();
- delete iDecoder;
- iDecoder = NULL;
- }
-
- delete iBitmap;
- iBitmap = NULL;
- delete iBuffer; // we own the buffer
- iBuffer = NULL;
- }
-
-
-// -----------------------------------------------------------------------------
-// CThumbnailImageDecoderv3::RunL()
-// -----------------------------------------------------------------------------
-//
-void CThumbnailImageDecoderv3::RunL()
- {
- // This call takes ownership of iBitmap
- iObserver->ThumbnailProviderReady( iStatus.Int(), iBitmap, iOriginalSize, EFalse, EFalse );
-
- iBitmap = NULL; // owned by server now
- delete iBuffer; // we own the buffer
- iBuffer = NULL;
-
- Release();
- }
-
-
-// -----------------------------------------------------------------------------
-// CThumbnailImageDecoderv3::CreateDecoderL
-// Creates image decoder
-// -----------------------------------------------------------------------------
-//
-void CThumbnailImageDecoderv3::CreateDecoderL()
- {
- delete iDecoder;
- iDecoder = NULL;
-
- CImageDecoder::TOptions options = ( CImageDecoder::TOptions )(
- CImageDecoder::EOptionNoDither );
-
- TRAPD( decErr, iDecoder = CExtJpegDecoder::DataNewL(
- CExtJpegDecoder::EHwImplementation, iFs, *iBuffer, options ));
-
- if ( decErr != KErrNone )
- {
- TN_DEBUG2( "CThumbnailImageDecoderv3::CreateDecoderL() - HW CExtJpegDecoder failed %d", decErr);
- OstTrace1( TRACE_NORMAL, CTHUMBNAILIMAGEDECODERV3_CREATEDECODERL, "CThumbnailImageDecoderv3::CreateDecoderL - HW CExtJpegDecoder failed;decErr=%d", decErr );
-
- LeaveIfCorruptL( decErr );
-
- TRAP( decErr, iDecoder = CExtJpegDecoder::DataNewL(
- CExtJpegDecoder::ESwImplementation, iFs, *iBuffer, options ));
-
- if ( decErr != KErrNone )
- {
- TN_DEBUG2( "CThumbnailImageDecoderv3::CreateDecoderL() - SW CExtJpegDecoder failed %d", decErr);
- OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILIMAGEDECODERV3_CREATEDECODERL, "CThumbnailImageDecoderv3::CreateDecoderL - SW CExtJpegDecoder failed;decErr=%d", decErr );
-
- LeaveIfCorruptL( decErr );
- // don't force any mime type
- TRAPD( decErr, iDecoder = CImageDecoder::DataNewL( iFs, *iBuffer, options ) );
- if ( decErr != KErrNone )
- {
- Release();
- TN_DEBUG2( "CThumbnailImageDecoderv3::CreateDecoderL() - CImageDecoder error %d", decErr );
- OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILIMAGEDECODERV3_CREATEDECODERL, "CThumbnailImageDecoderv3::CreateDecoderL - CImageDecoder error;decErr=%d", decErr );
-
- User::Leave( decErr );
- }
-
- TN_DEBUG1( "CThumbnailImageDecoderv3::CreateDecoderL() - CImageDecoder created" );
- OstTrace0( TRACE_NORMAL, DUP3_CTHUMBNAILIMAGEDECODERV3_CREATEDECODERL, "CThumbnailImageDecoderv3::CreateDecoderL - CImageDecoder created" );
- }
- else
- {
- TN_DEBUG1( "CThumbnailImageDecoderv3::CreateDecoderL() - SW CExtJpegDecoder created" );
- OstTrace0( TRACE_NORMAL, DUP4_CTHUMBNAILIMAGEDECODERV3_CREATEDECODERL, "CThumbnailImageDecoderv3::CreateDecoderL - SW CExtJpegDecoder created" );
- }
- }
- else
- {
- TN_DEBUG1( "CThumbnailImageDecoderv3::CreateDecoderL() - HW CExtJpegDecoder created" );
- OstTrace0( TRACE_NORMAL, DUP5_CTHUMBNAILIMAGEDECODERV3_CREATEDECODERL, "CThumbnailImageDecoderv3::CreateDecoderL - HW CExtJpegDecoder created" );
- }
- }
-
-
-// -----------------------------------------------------------------------------
-// CThumbnailImageDecoderv3::CreateExifDecoderL()
-// Returns size of original image
-// -----------------------------------------------------------------------------
-//
-const TSize& CThumbnailImageDecoderv3::OriginalSize()const
- {
- return iOriginalSize;
- }
-
-// -----------------------------------------------------------------------------
-// CThumbnailImageDecoder3::LeaveIfCorruptL()
-// Leave is image is corrupted
-// -----------------------------------------------------------------------------
-//
-void CThumbnailImageDecoderv3::LeaveIfCorruptL(const TInt aError )
- {
- //no sense to try other codecs if image is corrupted
- if( aError == KErrCorrupt || aError == KErrUnderflow)
- {
- Release();
- User::Leave( aError );
- }
- }
-
-//End of file
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/plugins/image/group/bld.inf
--- a/imagehandlingutilities/thumbnailmanager/plugins/image/group/bld.inf Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Build information file for project ?myapp
-*
-*/
-
-
-#include
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_MMPFILES
-thumbnailimageprovider.mmp
-
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/plugins/image/group/thumbnailimageprovider.mmp
--- a/imagehandlingutilities/thumbnailmanager/plugins/image/group/thumbnailimageprovider.mmp Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Thumbnail image provider plugin definition file
-*
-*/
-
-
-// To get the MW_LAYER_SYSTEMINCLUDE-definition
-#include
-
-#include "../../../inc/thumbnailmanageruids.hrh"
-
-TARGET thumbnailimageprovider.dll
-CAPABILITY CAP_ECOM_PLUGIN
-TARGETTYPE PLUGIN
-
-UID 0x10009D8D THUMBNAIL_IMAGE_PROVIDER_DLL_UID
-VENDORID VID_DEFAULT
-
-SOURCEPATH ../src
-SOURCE thumbnailimageprovider.cpp
-SOURCE thumbnailimagedecoder.cpp
-SOURCE thumbnailimagedecoderv2.cpp
-
-// Default system include paths for middleware layer modules.
-MW_LAYER_SYSTEMINCLUDE
-
-USERINCLUDE ../inc
-USERINCLUDE ../../../inc ../traces
-
-SYSTEMINCLUDE /epoc32/include/ecom
-SYSTEMINCLUDE /epoc32/include/icl
-
-START RESOURCE ../src/thumbnailimageprovider.rss
-END
-
-LIBRARY euser.lib
-LIBRARY ecom.lib
-LIBRARY efsrv.lib
-LIBRARY imageconversion.lib
-LIBRARY fbscli.lib
-LIBRARY exiflib.lib
-LIBRARY iclextjpegapi.lib
-LIBRARY apmime.lib
-
-DEBUGLIBRARY flogger.lib
-
-OPTION ARMCC -O3 -OTime
-
-PAGED
-BYTEPAIRCOMPRESSTARGET
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/plugins/image/inc/thumbnailimagedecoder.h
--- a/imagehandlingutilities/thumbnailmanager/plugins/image/inc/thumbnailimagedecoder.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,242 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Image thumbnail decoder.
- *
-*/
-
-
-#ifndef THUMBNAILIMAGEDECODER_H
-#define THUMBNAILIMAGEDECODER_H
-
-#include "thumbnailprovider.h"
-
-class CImageDecoder;
-class CFbsBitmap;
-
-// Size of buffer to load from file start to get EXIF thumbnail
-const TInt KJpegLoadBufferSize = 64 * 1024;
-
-
-/**
- * Image thumbnail decoder.
- *
- * @since S60 v5.0
- */
-class CThumbnailImageDecoder: public CActive
- {
-public:
-
- /**
- * C++ default constructor
- *
- * @since S60 v5.0
- * @param aFs File server session
- * @return New image thumbnail decoder instance.
- */
- CThumbnailImageDecoder( RFs& aFs );
-
- /**
- * Destructor
- *
- * @since S60 v5.0
- */
- virtual ~CThumbnailImageDecoder();
-
- /**
- * Creates a decoder from the given image file and gets image
- * information
- *
- * @since S60 v5.0
- * @param aFile Source image file.
- * @param aObserver Observer to relay notifications about completed
- * operations.
- * @param aFlags Decoding option flags.
- * @param aMimeType Mime-type of image to be decoded.
- * @param aSize desired size of thumbnail.
- * @param aRotateIfNeeded If ETrue rectangle is rotated to maximize the decoded size (full screen images only)
- */
- void CreateL( RFile64& aFile, MThumbnailProviderObserver& aObserver, const
- CThumbnailManager::TThumbnailQualityPreference aFlags, const TDataType& aMimeType,
- const TSize& aSize );
-
- /**
- * Creates a decoder from the given image buffer and gets image
- * information
- *
- * @since S60 v5.0
- * @param aBuffer Source image buffer.
- * @param aObserver Observer to relay notifications about completed
- * operations.
- * @param aFlags Decoding option flags.
- * @param aMimeType Mime-type of image to be decoded.
- * @param aSize desired size of thumbnail.
- * @param aRotateIfNeeded If ETrue rectangle is rotated to maximize the decoded size (full screen images only)
- */
- void CreateL( const TDesC8* aBuffer, MThumbnailProviderObserver&
- aObserver, const CThumbnailManager::TThumbnailQualityPreference aFlags, const
- TDataType& aMimeType, const TSize& aSize);
-
- /**
- * Decode image.
- *
- * @since S60 v5.0
- * @param aDisplayMode Preferred display mode.
- */
- void DecodeL( const TDisplayMode aDisplayMode, const CThumbnailManager::TThumbnailFlags aFlags );
-
- /**
- * Returns the size of original image.
- *
- * @since S60 v5.0
- * @return Size of original image.
- */
- const TSize& OriginalSize()const;
-
- /**
- * Leave if image is corrupt
- *
- * @since S60 v5.0
- */
- void LeaveIfCorruptL(const TInt aError );
-
-private:
- /**
- * Used to release reserved resources.
- *
- * @since S60 v5.0
- */
- void Release();
-
- /**
- * Implements cancellation of an outstanding request.
- *
- * @since S60 v5.0
- */
- void DoCancel();
-
- /**
- * Handles an active object's request completion event.
- *
- * @since S60 v5.0
- */
- void RunL();
-
- /**
- * Used to check if source is jpg/jpeg image.
- *
- * @since S60 v5.0
- * @return ETrue if image was jpg/jpeg format, otherwise EFalse
- */
- TBool IsJpeg();
-
- /**
- * Used to check if source is svg image.
- *
- * @since S60 v5.0
- * @return ETrue if image was in svg format, otherwise EFalse
- */
- TBool IsSvg();
-
- /**
- * Creates image decoder to be used.
- *
- * @since S60 v5.0
- */
- void CreateDecoderL( CThumbnailManager::TThumbnailQualityPreference aFlags );
-
- /**
- * Creates ExifDecoder.
- *
- * @since S60 v5.0
- */
- void CreateExifDecoderL( CThumbnailManager::TThumbnailQualityPreference aFlags );
-
-private:
- // data
-
- /**
- * Requested size.
- */
- TSize iSize;
-
- /**
- * Image decoder.
- * Own.
- */
- CImageDecoder* iDecoder;
-
- /**
- * Decoded bitmap.
- * Own.
- */
- CFbsBitmap* iBitmap;
-
- /**
- * Image info flags (from TFrameInfo)
- */
- TUint32 iFrameInfoFlags;
-
- /**
- * Original size of the image in pixels.
- */
- TSize iOriginalSize;
-
- /**
- * Buffer for reading the beginning of a JPEG file to get the
- * EXIF thumbnail data.
- */
- HBufC8* iJpegReadBuffer;
-
- /**
- * EXIF thumbnail image compressed as JPEG
- */
- HBufC8* iExifThumbImage;
-
- /**
- * Used fileserver.
- */
- RFs& iFs;
-
- /**
- * File from which thumbnail is to be created.
- */
- RFile64 iFile;
-
- /**
- * Buffer from which thumbnail is to be created.
- */
- const TDesC8* iBuffer;
-
- /**
- * Observer.
- */
- MThumbnailProviderObserver* iObserver; // not own
-
- /**
- * Mime-type.
- */
- TDataType iMimeType;
-
- /**
- * Is origin EXIF
- */
- TBool iEXIF;
-
- /**
- * Portrait image
- */
- TBool iPortrait;
-};
-
-#endif // THUMBNAILIMAGEDECODER_H
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/plugins/image/inc/thumbnailimagedecoderv2.h
--- a/imagehandlingutilities/thumbnailmanager/plugins/image/inc/thumbnailimagedecoderv2.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,143 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Image thumbnail decoderv2.
- *
-*/
-
-
-#ifndef THUMBNAILIMAGEDECODERV2_H
-#define THUMBNAILIMAGEDECODERV2_H
-
-#include "thumbnailprovider.h"
-
-class CImageDecoder;
-class CFbsBitmap;
-
-/**
- * Image thumbnail decoder.
- *
- * @since S60 v5.0
- */
-class CThumbnailImageDecoderv2: public CActive
- {
-public:
-
- /**
- * C++ default constructor
- *
- * @since S60 v5.0
- * @param aFs File server session
- * @return New image thumbnail decoder instance.
- */
- CThumbnailImageDecoderv2( RFs& aFs);
-
- /**
- * Destructor
- *
- * @since S60 v5.0
- */
- virtual ~CThumbnailImageDecoderv2();
-
- /**
- * Creates a decoder from the given image buffer and gets image
- * information
- *
- * @since S60 v5.0
- * @param aBuffer Source image buffer.
- * @param aObserver Observer to relay notifications about completed
- * operations.
- */
- void CreateL(TDesC8& aBuffer, MThumbnailProviderObserver& aObserver);
-
- /**
- * Decode image.
- *
- * @since S60 v5.0
- * @param aDisplayMode Preferred display mode.
- */
- void DecodeL();
-
-private:
- /**
- * Used to release reserved resources.
- *
- * @since S60 v5.0
- */
- void Release();
-
- /**
- * Implements cancellation of an outstanding request.
- *
- * @since S60 v5.0
- */
- void DoCancel();
-
- /**
- * Handles an active object's request completion event.
- *
- * @since S60 v5.0
- */
- void RunL();
-
- /**
- * Creates image decoder to be used.
- *
- * @since S60 v5.0
- */
- void CreateDecoderL();
-
- /**
- * Leave if image is corrupt
- *
- * @since S60 v5.0
- */
- void LeaveIfCorruptL(const TInt aError );
-
-private:
- // data
-
- /**
- * Image decoder.
- * Own.
- */
- CImageDecoder* iDecoder;
-
- /**
- * Original size of the image in pixels.
- */
- TSize iOriginalSize;
-
- /**
- * Decoded bitmap.
- * Own.
- */
- CFbsBitmap* iBitmap;
-
- /**
- * Used fileserver.
- */
- RFs& iFs;
-
- /**
- * Buffer from which thumbnail is to be created.
- */
- TDesC8* iBuffer;
-
- /**
- * Observer.
- */
- MThumbnailProviderObserver* iObserver; // not own
-};
-
-#endif // THUMBNAILIMAGEDECODERV2_H
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/plugins/image/inc/thumbnailimageprovider.h
--- a/imagehandlingutilities/thumbnailmanager/plugins/image/inc/thumbnailimageprovider.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Image thumbnail provider plugin.
- *
-*/
-
-
-#ifndef THUMBNAILIMAGEPROVIDER_H
-#define THUMBNAILIMAGEPROVIDER_H
-
-#include "thumbnailprovider.h"
-
-class CThumbnailImageDecoder;
-class CThumbnailImageDecoderv2;
-
-/**
- * Image thumbnail provider plugin.
- *
- * @since S60 v5.0
- */
-class CThumbnailImageProvider: public CThumbnailProvider
- {
-
-public:
-
- /**
- * Two-phased constructor.
- *
- * @since S60 v5.0
- * @return New image thumbnail provider instance.
- */
- static CThumbnailImageProvider* NewL();
-
- /**
- * Destructor
- *
- * @since S60 v5.0
- */
- virtual ~CThumbnailImageProvider();
-
- /**
- * Function that will provide thumbnail from given parameters.
- *
- * @since S60 v5.0
- * @param aFs File server session
- * @param aFile Source image file.
- * @param aMimeType MIME-type of the image file.
- * @param aFlags Flags for thumbnail creation.
- * @param aDisplayMode Used display mode.
- */
- void GetThumbnailL( RFs& aFs, RFile64& aFile, const TDataType& aMimeType,
- const CThumbnailManager::TThumbnailFlags aFlags, const TDisplayMode
- aDisplayMode, const CThumbnailManager::TThumbnailQualityPreference aQualityPreference );
-
- /**
- * Function that will provide thumbnail from given parameters.
- *
- * @since S60 v5.0
- * @param aFs File server session
- * @param aBuffer Source image buffer.
- * @param aMimeType MIME-type of the image file.
- * @param aFlags Flags for thumbnail creation.
- * @param aDisplayMode Used display mode.
- */
- void GetThumbnailL( RFs& aFs, TDesC8* aBuffer, const
- TDataType& aMimeType, const CThumbnailManager::TThumbnailFlags aFlags,
- const TDisplayMode aDisplayMode, const CThumbnailManager::TThumbnailQualityPreference aQualityPreference );
-
- /**
- * Function that will provide thumbnail from given parameters.
- *
- * @since S60 v5.0
- * @param aFs File server session
- * @param aBuffer Source image buffer.
- */
- void GetThumbnailL( RFs& aFs, TDesC8& aBuffer);
-
- /**
- * Cancel a previous thumbnail request, if any.
- *
- * @since S60 5.0
- */
- void CancelGetThumbnail();
-
-private:
-
- /**
- * C++ default constructor
- *
- * @since S60 v5.0
- * @return New image thumbnail provider instance.
- */
- CThumbnailImageProvider();
-
-private:
-
- /**
- * Thumbnail decoder.
- */
- CThumbnailImageDecoder* iImageDecoder;
-
- /**
- * Thumbnail decoderv2.
- */
- CThumbnailImageDecoderv2* iImageDecoderv2;
-
- /**
- * File server session.
- * Not own.
- */
- RFs iFs;
-
- /**
- * Mime-type of image
- */
- TDataType iMimeType;
-};
-
-#include "thumbnailprovider.inl"
-
-#endif // THUMBNAILIMAGEPROVIDER_H
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/plugins/image/src/thumbnailimagedecoder.cpp
--- a/imagehandlingutilities/thumbnailmanager/plugins/image/src/thumbnailimagedecoder.cpp Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,674 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Image thumbnail decoder
- *
-*/
-
-
-
-//INCLUDE FILES
-#include
-#include
-#include
-#include
-
-#include
-#include "thumbnailimagedecoder.h"
-#include "thumbnaillog.h"
-#include "thumbnailpanic.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "thumbnailimagedecoderTraces.h"
-#endif
-
-
-const TUid KImageTypeSVGUid =
- {
- 0x102073E7
-};
-
-// CImageDecoder supports up to 1/8 size reduction if EFullyScaleable is
-// not set.
-const TInt KMaximumReductionFactor = 8;
-
-// Matchers for recognizing JPEG files
-_LIT( KJpegMime, "image/jpeg" );
-
-// Matcher for recognizing SVG files
-_LIT( KSvgMime, "image/svg+xml" );
-
-
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// ---------------------------------------------------------------------------
-// CThumbnailImageDecoder::CThumbnailImageDecoder()
-// C++ default constructor can NOT contain any code, that might leave.
-// ---------------------------------------------------------------------------
-//
-CThumbnailImageDecoder::CThumbnailImageDecoder( RFs& aFs ):
- CActive(EPriorityStandard ), iBitmap( NULL ), iJpegReadBuffer( NULL ),
- iExifThumbImage( NULL ), iFs( aFs ), iBuffer( NULL )
- {
- CActiveScheduler::Add( this );
- }
-
-
-// ---------------------------------------------------------------------------
-// CThumbnailImageDecoder::~CThumbnailImageDecoder()
-// Destructor.
-// ---------------------------------------------------------------------------
-//
-CThumbnailImageDecoder::~CThumbnailImageDecoder()
- {
- Release();
- }
-
-
-// -----------------------------------------------------------------------------
-// CThumbnailImageDecoder::CreateL()
-// Creates thumbnail of image
-// -----------------------------------------------------------------------------
-//
-void CThumbnailImageDecoder::CreateL( RFile64& aFile, MThumbnailProviderObserver&
- aObserver, const CThumbnailManager::TThumbnailQualityPreference aQualityPreference, const
- TDataType& aMimeType, const TSize& aSize)
- {
- TN_DEBUG1( "CThumbnailImageDecoder::CreateL() start" );
- OstTrace0( TRACE_NORMAL, CTHUMBNAILIMAGEDECODER_CREATEL, "CThumbnailImageDecoder::CreateL - start" );
-
- iBuffer = NULL;
- iSize = aSize;
- iMimeType = aMimeType;
- iObserver = &aObserver;
- iFile = aFile;
-
- CreateDecoderL( aQualityPreference );
-
- const TFrameInfo info( iDecoder->FrameInfo());
- if (( info.iOverallSizeInPixels.iWidth < 1 ) || (
- info.iOverallSizeInPixels.iHeight < 1 ))
- {
- User::Leave( KErrCorrupt );
- }
- iFrameInfoFlags = info.iFlags;
- iOriginalSize = info.iOverallSizeInPixels;
-
- TN_DEBUG1( "CThumbnailImageDecoder::CreateL() end" );
- OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILIMAGEDECODER_CREATEL, "CThumbnailImageDecoder::CreateL - end" );
- }
-
-
-// -----------------------------------------------------------------------------
-// CThumbnailImageDecoder::CreateL()
-// Creates thumbnail of image
-// -----------------------------------------------------------------------------
-//
-void CThumbnailImageDecoder::CreateL( const TDesC8* aBuffer, MThumbnailProviderObserver&
- aObserver, const CThumbnailManager::TThumbnailQualityPreference aQualityPreference, const
- TDataType& aMimeType, const TSize& aSize)
- {
- TN_DEBUG1( "CThumbnailImageDecoder::CreateL() start" );
- OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILIMAGEDECODER_CREATEL, "CThumbnailImageDecoder::CreateL - start" );
-
- iSize = aSize;
- iMimeType = aMimeType;
- iObserver = &aObserver;
- iBuffer = aBuffer;
-
- CreateDecoderL( aQualityPreference );
-
- const TFrameInfo info( iDecoder->FrameInfo());
- if (( info.iOverallSizeInPixels.iWidth < 1 ) || (
- info.iOverallSizeInPixels.iHeight < 1 ))
- {
- User::Leave( KErrCorrupt );
- }
- iFrameInfoFlags = info.iFlags;
- iOriginalSize = info.iOverallSizeInPixels;
-
- TN_DEBUG1( "CThumbnailImageDecoder::CreateL() end" );
- OstTrace0( TRACE_NORMAL, DUP3_CTHUMBNAILIMAGEDECODER_CREATEL, "CThumbnailImageDecoder::CreateL - end" );
- }
-
-// -----------------------------------------------------------------------------
-// CThumbnailImageDecoder::DecodeL()
-// Decode the thumbnail image
-// -----------------------------------------------------------------------------
-//
-void CThumbnailImageDecoder::DecodeL( const TDisplayMode aDisplayMode, const CThumbnailManager::TThumbnailFlags aFlags)
- {
- TN_DEBUG1( "CThumbnailImageDecoder::DecodeL() start" );
- OstTrace0( TRACE_NORMAL, CTHUMBNAILIMAGEDECODER_DECODEL, "CThumbnailImageDecoder::DecodeL - start" );
-
- // Create the bitmap
- if ( !iBitmap )
- {
- iBitmap = new( ELeave )CFbsBitmap();
- }
-
- TN_DEBUG3( "CThumbnailImageDecoder::DecodeL() %d x %d", iSize.iWidth, iSize.iHeight );
- OstTraceExt2( TRACE_NORMAL, DUP1_CTHUMBNAILIMAGEDECODER_DECODEL, "CThumbnailImageDecoder::DecodeL;iSize.iWidth=%d;iSize.iHeight=%d", iSize.iWidth, iSize.iHeight );
- if( iOriginalSize.iWidth < iOriginalSize.iHeight )
- {
- TInt height = iSize.iHeight;
- iSize.iHeight = iSize.iWidth;
- iSize.iWidth = height;
- iPortrait = ETrue;
- TN_DEBUG3( "CThumbnailImageDecoder::DecodeL() %d x %d", iSize.iWidth, iSize.iHeight );
- OstTraceExt2( TRACE_NORMAL, DUP2_CTHUMBNAILIMAGEDECODER_DECODEL, "CThumbnailImageDecoder::DecodeL;iSize.iWidth=%d;iSize.iHeight=%d", iSize.iWidth, iSize.iHeight );
- }
- else
- {
- iPortrait = EFalse;
- }
-
- TN_DEBUG3( "CThumbnailImageDecoder::DecodeL() iOriginalSize = %d x %d", iOriginalSize.iWidth, iOriginalSize.iHeight );
- OstTraceExt2( TRACE_NORMAL, DUP3_CTHUMBNAILIMAGEDECODER_DECODEL, "CThumbnailImageDecoder::DecodeL;iOriginalSize.iWidth=%d;iOriginalSize.iHeight=%d", iOriginalSize.iWidth, iOriginalSize.iHeight );
-
- //Size in both x and y dimension must be non-zero, positive value
- TSize loadSize( iOriginalSize) ;
-
- if(iOriginalSize.iHeight < iSize.iHeight || iOriginalSize.iWidth < iSize.iWidth )
- {
- loadSize = iOriginalSize;
- TN_DEBUG1( "CThumbnailImageDecoder::DecodeL() LoadSize is OriginalSize" );
- OstTrace0( TRACE_NORMAL, DUP4_CTHUMBNAILIMAGEDECODER_DECODEL, "CThumbnailImageDecoder::DecodeL - LoadSize is OriginalSize" );
- }
- else if((iFrameInfoFlags& TFrameInfo::EFullyScaleable || IsSvg()) && aFlags == !CThumbnailManager::ECropToAspectRatio)
- {
- loadSize = iSize;
- TN_DEBUG1( "CThumbnailImageDecoder::DecodeL() EFullyScaleable start" );
- OstTrace0( TRACE_NORMAL, DUP5_CTHUMBNAILIMAGEDECODER_DECODEL, "CThumbnailImageDecoder::DecodeL - EFullyScaleable start" );
- const TReal32 srcAspect = static_cast < TReal32 > (
- iOriginalSize.iWidth ) / iOriginalSize.iHeight;
-
- // set loadsize to maximum size within target size
- if ( (loadSize.iHeight * srcAspect) <= loadSize.iWidth )
- {
- TReal trg = 0;
- TReal src( loadSize.iHeight * srcAspect );
- Math::Round( trg, src, 0 );
- loadSize.SetSize( trg, loadSize.iHeight );
- }
- else
- {
- TReal trg;
- TReal src( loadSize.iWidth / srcAspect );
- Math::Round( trg, src, 0 );
- loadSize.SetSize( loadSize.iWidth, trg );
- }
-
- TN_DEBUG3( "CThumbnailImageDecoder::DecodeL() EFullyScaleable loadSize = %d x %d", loadSize.iWidth, loadSize.iHeight );
- OstTraceExt2( TRACE_NORMAL, DUP6_CTHUMBNAILIMAGEDECODER_DECODEL, "CThumbnailImageDecoder::DecodeL - EFullyScaleable;loadSize.iWidth=%d;loadSize.iHeight=%d", loadSize.iWidth, loadSize.iHeight );
- }
- else
- {
-
- // Size reduction factor. 1/1, 1/2, 1/4, and 1/8 are possible values for all
- // plug-ins. SVG graphics can be rendered at any size.
- TInt reductionFactor = 1;
- while ( reductionFactor < KMaximumReductionFactor && ( iSize.iWidth <
- loadSize.iWidth / 2 ) && ( iSize.iHeight < loadSize.iHeight / 2 ))
- {
- // magic: use loadSize that is half of previous size
- loadSize.iWidth /= 2;
- loadSize.iHeight /= 2;
- reductionFactor *= 2;
- }
- // If original size is not an exact multiple of reduction factor,
- // we need to round loadSize up
- if ( reductionFactor && iOriginalSize.iWidth % reductionFactor )
- {
- loadSize.iWidth++;
- }
- if ( reductionFactor && iOriginalSize.iHeight % reductionFactor )
- {
- loadSize.iHeight++;
- }
- TN_DEBUG4(
- "CThumbnailImageDecoder::DecodeL() - loadSize = (%d,%d) reduction = 1/%d ", loadSize.iWidth, loadSize.iHeight, reductionFactor );
- OstTraceExt3( TRACE_NORMAL, DUP7_CTHUMBNAILIMAGEDECODER_DECODEL, "CThumbnailImageDecoder::DecodeL;loadSize.iWidth=%d;loadSize.iHeight=%d;reductionFactor=%d", loadSize.iWidth, loadSize.iHeight, reductionFactor );
- }
-
- TInt err = iBitmap->Create( loadSize, aDisplayMode );
- if (err != KErrNone)
- {
- delete iBitmap;
- iBitmap = NULL;
- User::Leave(err);
- }
-
- iDecoder->Convert( &iStatus, * iBitmap );
-
- SetActive();
-
- TN_DEBUG1( "CThumbnailImageDecoder::DecodeL() end" );
- OstTrace0( TRACE_NORMAL, DUP8_CTHUMBNAILIMAGEDECODER_DECODEL, "CThumbnailImageDecoder::DecodeL - end" );
- }
-
-
-// -----------------------------------------------------------------------------
-// CThumbnailImageDecoder::Release()
-// Releases resources
-// -----------------------------------------------------------------------------
-//
-void CThumbnailImageDecoder::Release()
- {
- Cancel();
-
- delete iDecoder;
- iDecoder = NULL;
-
- delete iBitmap;
- iBitmap = NULL;
- delete iJpegReadBuffer;
- iJpegReadBuffer = NULL;
- delete iExifThumbImage;
- iExifThumbImage = NULL;
-
- iBuffer = NULL; // we don't own the buffer
- }
-
-
-// -----------------------------------------------------------------------------
-// CThumbnailImageDecoder::DoCancel()
-// -----------------------------------------------------------------------------
-//
-void CThumbnailImageDecoder::DoCancel()
- {
- if ( iDecoder )
- {
- iDecoder->Cancel();
- delete iDecoder;
- iDecoder = NULL;
- }
-
- delete iBitmap;
- iBitmap = NULL;
- delete iJpegReadBuffer;
- iJpegReadBuffer = NULL;
- delete iExifThumbImage;
- iExifThumbImage = NULL;
-
- iBuffer = NULL; // we don't own the buffer
- }
-
-
-// -----------------------------------------------------------------------------
-// CThumbnailImageDecoder::RunL()
-// -----------------------------------------------------------------------------
-//
-void CThumbnailImageDecoder::RunL()
- {
- // This call takes ownership of iBitmap
- iObserver->ThumbnailProviderReady( iStatus.Int(), iBitmap, iOriginalSize, iEXIF, iPortrait );
-
- iBitmap = NULL; // owned by server now
- iBuffer = NULL; // we don't own the buffer
-
- Release();
- }
-
-
-// -----------------------------------------------------------------------------
-// CThumbnailImageDecoder::IsJpeg()
-// -----------------------------------------------------------------------------
-//
-TBool CThumbnailImageDecoder::IsJpeg()
- {
- __ASSERT_DEBUG(( iMimeType.Des() != KNullDesC ), ThumbnailPanic(
- EThumbnailEmptyDescriptor ));
-
- if ( KJpegMime() == iMimeType.Des())
- {
- return ETrue;
- }
- return EFalse;
- }
-
-
-// -----------------------------------------------------------------------------
-// CThumbnailImageDecoder::IsSvg()
-// -----------------------------------------------------------------------------
-//
-TBool CThumbnailImageDecoder::IsSvg()
- {
- __ASSERT_DEBUG(( iMimeType.Des() != KNullDesC ), ThumbnailPanic(
- EThumbnailEmptyDescriptor ));
-
- if ( KSvgMime() == iMimeType.Des())
- {
- return ETrue;
- }
- return EFalse;
- }
-
-
-// -----------------------------------------------------------------------------
-// CThumbnailImageDecoder::CreateDecoderL
-// Creates image decoder
-// -----------------------------------------------------------------------------
-//
-void CThumbnailImageDecoder::CreateDecoderL( CThumbnailManager::TThumbnailQualityPreference
- aFlags )
- {
- TN_DEBUG1( "CThumbnailImageDecoder::CreateDecoderL() start" );
- OstTrace0( TRACE_NORMAL, CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - start" );
-
- TBool thumbFound( EFalse );
-
- // If the image is in jpeg format, try to get thumbnail from EXIF data (if EOptimizeForQuality not set)
- if ( IsJpeg() && !( aFlags == CThumbnailManager::EOptimizeForQuality ))
- {
- TN_DEBUG1( "CThumbnailImageDecoder::CreateDecoderL() create exif decoder" );
- OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - create exif decoder" );
- TRAPD( err, CreateExifDecoderL( aFlags ));
- thumbFound = ( err == KErrNone );
- iEXIF = ETrue;
- }
-
- if ( !thumbFound )
- {
- iEXIF = EFalse;
- TN_DEBUG1( "CThumbnailImageDecoder::CreateDecoderL() create normal decoder" );
- OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - create normal decoder" );
-
- delete iDecoder;
- iDecoder = NULL;
-
- TFileName fullName;
- if ( !iBuffer )
- {
- iFile.FullName( fullName );
- }
-
- CImageDecoder::TOptions options;
- if ( aFlags == CThumbnailManager::EOptimizeForQuality )
- {
- options = ( CImageDecoder::TOptions )( CImageDecoder
- ::EOptionNoDither );
- }
- else
- {
- options = ( CImageDecoder::TOptions )( CImageDecoder
- ::EOptionNoDither | CImageDecoder::EPreferFastDecode );
- }
-
- if ( IsSvg())
- {
- if ( !iBuffer )
- {
- iDecoder = CImageDecoder::FileNewL( iFile, ContentAccess::EPeek,
- options, KImageTypeSVGUid, KNullUid, KNullUid );
-
- TN_DEBUG1( "CThumbnailImageDecoder::CreateDecoderL() - CImageDecoder created" );
- OstTrace0( TRACE_NORMAL, DUP3_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - CImageDecoder created" );
- }
- else
- {
- TRAPD( decErr, iDecoder = CImageDecoder::DataNewL( iFs, *iBuffer, options, KImageTypeSVGUid ) );
-
- if ( decErr != KErrNone )
- {
- TN_DEBUG1( "CThumbnailImageDecoder::CreateDecoderL() - error 1" );
- OstTrace0( TRACE_NORMAL, DUP4_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - error 1" );
-
- User::Leave( decErr );
- }
-
- TN_DEBUG1( "CThumbnailImageDecoder::CreateDecoderL() - CImageDecoder created" );
- OstTrace0( TRACE_NORMAL, DUP5_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - CImageDecoder created" );
- }
- }
- else if ( !IsJpeg())
- {
- if ( !iBuffer )
- {
- iDecoder = CImageDecoder::FileNewL( iFile, ContentAccess::EPeek, options );
-
- TN_DEBUG1( "CThumbnailImageDecoder::CreateDecoderL() - CImageDecoder created" );
- OstTrace0( TRACE_NORMAL, DUP6_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - CImageDecoder created" );
- }
- else
- {
- TRAPD( decErr, iDecoder = CImageDecoder::DataNewL( iFs, *iBuffer, iMimeType.Des8(), options) );
-
- if ( decErr != KErrNone )
- {
- TN_DEBUG2( "CThumbnailImageDecoder::CreateDecoderL() - CImageDecoder error %d", decErr );
- OstTrace1( TRACE_NORMAL, DUP7_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - CImageDecoder error;decErr=%d", decErr );
- LeaveIfCorruptL(decErr);
-
- // don't force any mime type
- TRAPD( decErr, iDecoder = CImageDecoder::DataNewL( iFs, *iBuffer, options ) );
-
- if ( decErr != KErrNone )
- {
- TN_DEBUG2( "CThumbnailImageDecoder::CreateDecoderL() - CImageDecoder no mime error %d", decErr );
- OstTrace1( TRACE_NORMAL, DUP8_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - CImageDecoder no mime error;decErr=%d", decErr );
-
- User::Leave( decErr );
- }
- }
-
- TN_DEBUG1( "CThumbnailImageDecoder::CreateDecoderL() - CImageDecoder created" );
- OstTrace0( TRACE_NORMAL, DUP9_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - CImageDecoder created" );
- }
- }
- else
- {
- if ( !iBuffer )
- {
- TRAPD( decErr, iDecoder = CExtJpegDecoder::FileNewL(
- CExtJpegDecoder::EHwImplementation, iFs, fullName, options) );
-
- if ( decErr != KErrNone )
- {
- TN_DEBUG2( "CThumbnailImageDecoder::CreateDecoderL() - HW CExtJpegDecoder failed %d", decErr);
- OstTrace1( TRACE_NORMAL, DUP10_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL;decErr=%d - HW CExtJpegDecoder failed ", decErr );
- LeaveIfCorruptL(decErr);
-
- TRAP( decErr, iDecoder = CExtJpegDecoder::FileNewL(
- CExtJpegDecoder::ESwImplementation, iFs, fullName, options) );
-
- if ( decErr != KErrNone )
- {
- TN_DEBUG2( "CThumbnailImageDecoder::CreateDecoderL() - SW CExtJpegDecoder failed %d", decErr);
- OstTrace1( TRACE_NORMAL, DUP11_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - SW CExtJpegDecoder failed;decErr=%d", decErr );
- LeaveIfCorruptL(decErr);
-
- TRAP( decErr, iDecoder = CImageDecoder::FileNewL( iFile, ContentAccess::EPeek, options ));
-
- if( decErr != KErrNone)
- {
- TN_DEBUG2( "CThumbnailImageDecoder::CreateDecoderL() - CImageDecoder failed %d", decErr);
- OstTrace1( TRACE_NORMAL, DUP12_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - CImageDecoder failed ;decErr=%d", decErr );
- User::Leave( decErr );
- }
-
- TN_DEBUG1( "CThumbnailImageDecoder::CreateDecoderL() - CImageDecoder created" );
- OstTrace0( TRACE_NORMAL, DUP13_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - CImageDecoder created" );
- }
- else
- {
- TN_DEBUG1( "CThumbnailImageDecoder::CreateDecoderL() - SW CExtJpegDecoder created" );
- OstTrace0( TRACE_NORMAL, DUP14_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - SW CExtJpegDecoder created" );
- }
- }
- else
- {
- TN_DEBUG1( "CThumbnailImageDecoder::CreateDecoderL() - HW CExtJpegDecoder created" );
- OstTrace0( TRACE_NORMAL, DUP15_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL" );
- }
- }
- else
- {
- TRAPD( decErr, iDecoder = CExtJpegDecoder::DataNewL(
- CExtJpegDecoder::EHwImplementation, iFs, *iBuffer, options ));
-
- if ( decErr != KErrNone )
- {
- TN_DEBUG2( "CThumbnailImageDecoder::CreateDecoderL() - HW CExtJpegDecoder failed %d", decErr);
- OstTrace1( TRACE_NORMAL, DUP16_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - HW CExtJpegDecoder failed;decErr=%d", decErr );
- LeaveIfCorruptL(decErr);
-
- TRAP( decErr, iDecoder = CExtJpegDecoder::DataNewL(
- CExtJpegDecoder::ESwImplementation, iFs, *iBuffer, options ));
-
- if ( decErr != KErrNone )
- {
- TN_DEBUG2( "CThumbnailImageDecoder::CreateDecoderL() - SW CExtJpegDecoder failed %d", decErr);
- OstTrace1( TRACE_NORMAL, DUP17_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - SW CExtJpegDecoder failed;decErr=%d", decErr );
- LeaveIfCorruptL(decErr);
- TRAPD( decErr, iDecoder = CImageDecoder::DataNewL( iFs, *iBuffer, iMimeType.Des8(), options) );
-
- if ( decErr != KErrNone )
- {
- TN_DEBUG2( "CThumbnailImageDecoder::CreateDecoderL() - CImageDecoder failed %d", decErr);
- OstTrace1( TRACE_NORMAL, DUP18_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - CImageDecoder failed;decErr=%d", decErr );
- LeaveIfCorruptL(decErr);
- // don't force any mime type
- TRAPD( decErr, iDecoder = CImageDecoder::DataNewL( iFs, *iBuffer, options ) );
-
- if ( decErr != KErrNone )
- {
- TN_DEBUG2( "CThumbnailImageDecoder::CreateDecoderL() - CImageDecoder no mime failed %d", decErr);
- OstTrace1( TRACE_NORMAL, DUP19_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - CImageDecoder no mime failed;decErr=%d", decErr );
- User::Leave( decErr );
- }
- }
-
- TN_DEBUG1( "CThumbnailImageDecoder::CreateDecoderL() - CImageDecoder created" );
- OstTrace0( TRACE_NORMAL, DUP20_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - CImageDecoder created" );
- }
- else
- {
- TN_DEBUG1( "CThumbnailImageDecoder::CreateDecoderL() - SW CExtJpegDecoder created" );
- OstTrace0( TRACE_NORMAL, DUP21_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - SW CExtJpegDecoder created" );
- }
- }
- else
- {
- TN_DEBUG1( "CThumbnailImageDecoder::CreateDecoderL() - HW CExtJpegDecoder created" );
- OstTrace0( TRACE_NORMAL, DUP22_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - HW CExtJpegDecoder created" );
- }
- }
- }
- }
-
- TN_DEBUG1( "CThumbnailImageDecoder::CreateDecoderL() end" );
- OstTrace0( TRACE_NORMAL, DUP23_CTHUMBNAILIMAGEDECODER_CREATEDECODERL, "CThumbnailImageDecoder::CreateDecoderL - end" );
- }
-
-
-// -----------------------------------------------------------------------------
-// CThumbnailImageDecoder::CreateExifDecoderL()
-// -----------------------------------------------------------------------------
-//
-void CThumbnailImageDecoder::CreateExifDecoderL( CThumbnailManager
- ::TThumbnailQualityPreference aFlags )
- {
- TN_DEBUG1( "CThumbnailImageDecoder::CreateExifDecoderL() start" );
- OstTrace0( TRACE_NORMAL, CTHUMBNAILIMAGEDECODER_CREATEEXIFDECODERL, "CThumbnailImageDecoder::CreateExifDecoderL - start" );
-
- // If the image is in jpeg format, try to get thumbnail from EXIF data.
- CExifRead* reader = NULL;
-
- if ( !iBuffer )
- {
- TInt64 size( 0 );
- User::LeaveIfError( iFile.Size( size ));
-
- TInt readSize = Min( size, KJpegLoadBufferSize );
-
- delete iJpegReadBuffer;
- iJpegReadBuffer = NULL;
- iJpegReadBuffer = HBufC8::NewL( readSize );
- TPtr8 localBuffer = iJpegReadBuffer->Des();
-
- User::LeaveIfError( iFile.Read( localBuffer, readSize ));
- reader = CExifRead::NewL( localBuffer, CExifRead::ENoJpeg );
- }
- else
- {
- reader = CExifRead::NewL( *iBuffer, CExifRead::ENoJpeg );
- }
-
- CleanupStack::PushL( reader );
-
- iExifThumbImage = reader->GetThumbnailL();
- CleanupStack::PopAndDestroy( reader );
-
- User::LeaveIfNull( iExifThumbImage );
-
- delete iDecoder;
- iDecoder = NULL;
-
- CImageDecoder::TOptions options;
- if ( aFlags == CThumbnailManager::EOptimizeForQuality )
- {
- options = ( CImageDecoder::TOptions )( CImageDecoder::EOptionNoDither );
- }
- else
- {
- options = ( CImageDecoder::TOptions )( CImageDecoder::EOptionNoDither |
- CImageDecoder::EPreferFastDecode );
- }
-
- TRAPD( err, iDecoder = CExtJpegDecoder::DataNewL( iFs, * iExifThumbImage, options ));
-
- if ( err == KErrNotFound || err == KErrNotSupported )
- {
- delete iDecoder;
- iDecoder = NULL;
-
- iDecoder = CImageDecoder::DataNewL( iFs, * iExifThumbImage, options );
- }
- else
- {
- TN_DEBUG2( "CThumbnailImageDecoder::CreateExifDecoderL() - CExtJpegDecoder err == %d", err );
- User::LeaveIfError( err );
- }
-
- TN_DEBUG1( "CThumbnailImageDecoder::CreateExifDecoderL() end" );
- OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILIMAGEDECODER_CREATEEXIFDECODERL, "CThumbnailImageDecoder::CreateExifDecoderL - end" );
- }
-
-
-// -----------------------------------------------------------------------------
-// CThumbnailImageDecoder::CreateExifDecoderL()
-// Returns size of original image
-// -----------------------------------------------------------------------------
-//
-const TSize& CThumbnailImageDecoder::OriginalSize()const
- {
- return iOriginalSize;
- }
-
-// -----------------------------------------------------------------------------
-// CThumbnailImageDecoder::LeaveIfCorruptL()
-// Leave is image is corrupted
-// -----------------------------------------------------------------------------
-//
-void CThumbnailImageDecoder::LeaveIfCorruptL(const TInt aError )
- {
- //no sense to try other codecs if image is corrupted
- if( aError == KErrCorrupt || aError == KErrUnderflow)
- {
- User::Leave( aError );
- }
- }
-
-//End of file
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/plugins/image/src/thumbnailimagedecoderv2.cpp
--- a/imagehandlingutilities/thumbnailmanager/plugins/image/src/thumbnailimagedecoderv2.cpp Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,252 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Image thumbnail decoder
- *
-*/
-
-
-//INCLUDE FILES
-#include
-#include
-#include
-
-#include
-#include "thumbnailimagedecoderv2.h"
-#include "thumbnaillog.h"
-#include "thumbnailpanic.h"
-#include "thumbnailmanagerconstants.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "thumbnailimagedecoderv2Traces.h"
-#endif
-
-
-// ============================ MEMBER FUNCTIONS ===============================
-//------------------------------------------------------------------------
-// CThumbnailImageDecoder::CThumbnailImageDecoder()
-// C++ default constructor can NOT contain any code, that might leave.
-// ---------------------------------------------------------------------------
-//
-CThumbnailImageDecoderv2::CThumbnailImageDecoderv2( RFs& aFs):
- CActive(EPriorityStandard ), iBitmap( NULL ), iFs( aFs ), iBuffer( NULL )
- {
- CActiveScheduler::Add( this );
- }
-
-
-// ---------------------------------------------------------------------------
-// CThumbnailImageDecoder::~CThumbnailImageDecoder()
-// Destructor.
-// ---------------------------------------------------------------------------
-//
-CThumbnailImageDecoderv2::~CThumbnailImageDecoderv2()
- {
- Release();
- }
-
-
-// -----------------------------------------------------------------------------
-// CThumbnailImageDecoder::CreateL()
-// Creates thumbnail of image
-// -----------------------------------------------------------------------------
-//
-void CThumbnailImageDecoderv2::CreateL(TDesC8& aBuffer, MThumbnailProviderObserver& aObserver)
- {
- TN_DEBUG1( "CThumbnailImageDecoderv2::CreateL() start" );
- OstTrace0( TRACE_NORMAL, CTHUMBNAILIMAGEDECODERV2_CREATEL, "CThumbnailImageDecoderv2::CreateL - start" );
-
- iBuffer = &aBuffer;
- iObserver = &aObserver;
-
- CreateDecoderL();
-
- TN_DEBUG1( "CThumbnailImageDecoderv2::CreateL() end" );
- OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILIMAGEDECODERV2_CREATEL, "CThumbnailImageDecoderv2::CreateL - end" );
- }
-
-// -----------------------------------------------------------------------------
-// CThumbnailImageDecoder::DecodeL()
-// Decode the thumbnail image
-// -----------------------------------------------------------------------------
-//
-void CThumbnailImageDecoderv2::DecodeL( )
- {
- TN_DEBUG1( "CThumbnailImageDecoderv2::DecodeL() start" );
- OstTrace0( TRACE_NORMAL, CTHUMBNAILIMAGEDECODERV2_DECODEL, "CThumbnailImageDecoderv2::DecodeL - start" );
-
- // Create the bitmap
- if ( !iBitmap )
- {
- iBitmap = new( ELeave )CFbsBitmap();
- }
-
- //set displaymode from global constants
- TInt err = iBitmap->Create( iDecoder->FrameInfo().iOverallSizeInPixels, iDecoder->FrameInfo().iFrameDisplayMode);
- if (err != KErrNone)
- {
- delete iBitmap;
- iBitmap = NULL;
- User::Leave(err);
- }
-
- iDecoder->Convert( &iStatus, * iBitmap );
-
- SetActive();
-
- TN_DEBUG1( "CThumbnailImageDecoderv2::DecodeL() end" );
- OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILIMAGEDECODERV2_DECODEL, "CThumbnailImageDecoderv2::DecodeL - end" );
- }
-
-
-// -----------------------------------------------------------------------------
-// CThumbnailImageDecoder::Release()
-// Releases resources
-// -----------------------------------------------------------------------------
-//
-void CThumbnailImageDecoderv2::Release()
- {
- Cancel();
-
- delete iDecoder;
- iDecoder = NULL;
-
- delete iBitmap;
- iBitmap = NULL;
-
- iBuffer = NULL; // we don't own the buffer
- }
-
-
-// -----------------------------------------------------------------------------
-// CThumbnailImageDecoder::DoCancel()
-// -----------------------------------------------------------------------------
-//
-void CThumbnailImageDecoderv2::DoCancel()
- {
- if ( iDecoder )
- {
- iDecoder->Cancel();
- delete iDecoder;
- iDecoder = NULL;
- }
-
- delete iBitmap;
- iBitmap = NULL;
-
- iBuffer = NULL; // we don't own the buffer
- }
-
-
-// -----------------------------------------------------------------------------
-// CThumbnailImageDecoder::RunL()
-// -----------------------------------------------------------------------------
-//
-void CThumbnailImageDecoderv2::RunL()
- {
- // This call takes ownership of iBitmap
- // EXIF always false
- // Rotated always false
- iObserver->ThumbnailProviderReady( iStatus.Int(), iBitmap, iOriginalSize, EFalse, EFalse);
-
- iBitmap = NULL; // owned by server now
- iBuffer = NULL; // we don't own the buffer
-
- Release();
- }
-
-
-// -----------------------------------------------------------------------------
-// CThumbnailImageDecoder::CreateDecoderL
-// Creates image decoder
-// -----------------------------------------------------------------------------
-//
-void CThumbnailImageDecoderv2::CreateDecoderL()
- {
- TN_DEBUG1( "CThumbnailImageDecoderv2::CreateDecoderL() start" );
- OstTrace0( TRACE_NORMAL, CTHUMBNAILIMAGEDECODERV2_CREATEDECODERL, "CThumbnailImageDecoderv2::CreateDecoderL - start" );
-
- delete iDecoder;
- iDecoder = NULL;
-
- CImageDecoder::TOptions options = ( CImageDecoder::TOptions )(
- CImageDecoder::EOptionNoDither );
-
- TRAPD( decErr, iDecoder = CExtJpegDecoder::DataNewL(
- CExtJpegDecoder::EHwImplementation, iFs, *iBuffer, options ));
-
- if ( decErr != KErrNone )
- {
- TN_DEBUG2( "CThumbnailImageDecoderv2::CreateDecoderL() - HW CExtJpegDecoder failed = %d", decErr );
- OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILIMAGEDECODERV2_CREATEDECODERL, "CThumbnailImageDecoderv2::CreateDecoderL - HW CExtJpegDecoder failed;decErr=%d", decErr );
- TRAP( decErr, iDecoder = CExtJpegDecoder::DataNewL(
- CExtJpegDecoder::ESwImplementation, iFs, *iBuffer, options ));
-
- if ( decErr != KErrNone )
- {
- TN_DEBUG2( "CThumbnailImageDecoderv2::CreateDecoderL() - SW CExtJpegDecoder failed %d", decErr);
- OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILIMAGEDECODERV2_CREATEDECODERL, "CThumbnailImageDecoderv2::CreateDecoderL - SW CExtJpegDecoder failed;decErr=%d", decErr );
- LeaveIfCorruptL( decErr );
-
- TRAP( decErr, iDecoder = CImageDecoder::DataNewL( iFs, *iBuffer, KJpegMime(), options ) );
-
- if ( decErr != KErrNone )
- {
- TN_DEBUG2( "CThumbnailImageDecoderv2::CreateDecoderL() - CImageDecoder failed %d", decErr);
- OstTrace1( TRACE_NORMAL, DUP3_CTHUMBNAILIMAGEDECODERV2_CREATEDECODERL, "CThumbnailImageDecoderv2::CreateDecoderL - CImageDecoder failed;decErr=%d", decErr );
- LeaveIfCorruptL( decErr );
-
- // don't force any mime type
- TRAPD( decErr, iDecoder = CImageDecoder::DataNewL( iFs, *iBuffer, options ) );
- if ( decErr != KErrNone )
- {
- TN_DEBUG2( "CThumbnailImageDecoderv2::CImageDecoder() - CImageDecoder no mime error %d", decErr );
- OstTrace1( TRACE_NORMAL, DUP4_CTHUMBNAILIMAGEDECODERV2_CREATEDECODERL, "CThumbnailImageDecoderv2::CreateDecoderL - CImageDecoder no mime error;decErr=%d", decErr );
- User::Leave( decErr );
- }
- }
-
- TN_DEBUG1( "CThumbnailImageDecoderv2::CreateDecoderL() - CImageDecoder created" );
- OstTrace0( TRACE_NORMAL, DUP5_CTHUMBNAILIMAGEDECODERV2_CREATEDECODERL, "CThumbnailImageDecoderv2::CreateDecoderL - CImageDecoder created" );
- }
- else
- {
- TN_DEBUG1( "CThumbnailImageDecoderv2:CreateDecoderL() - SW CExtJpegDecoder created" );
- OstTrace0( TRACE_NORMAL, DUP6_CTHUMBNAILIMAGEDECODERV2_CREATEDECODERL, "CThumbnailImageDecoderv2::CreateDecoderL - SW CExtJpegDecoder created" );
- }
- }
- else
- {
- TN_DEBUG1( "CThumbnailImageDecoderv2::CreateDecoderL() - HW CExtJpegDecoder created" );
- OstTrace0( TRACE_NORMAL, DUP7_CTHUMBNAILIMAGEDECODERV2_CREATEDECODERL, "CThumbnailImageDecoderv2::CreateDecoderL - HW CExtJpegDecoder created" );
- }
-
- TN_DEBUG1( "CThumbnailImageDecoderv2::CreateDecoderL() end" );
- OstTrace0( TRACE_NORMAL, DUP8_CTHUMBNAILIMAGEDECODERV2_CREATEDECODERL, "CThumbnailImageDecoderv2::CreateDecoderL - end" );
- }
-
-// -----------------------------------------------------------------------------
-// CThumbnailImageDecoderv2::LeaveIfCorruptL()
-// Leave if image is corrupted
-// -----------------------------------------------------------------------------
-//
-void CThumbnailImageDecoderv2::LeaveIfCorruptL(const TInt aError )
- {
- //no sense to try other codecs if image is corrupted
- if( aError == KErrCorrupt || aError == KErrUnderflow)
- {
- User::Leave( aError );
- }
- }
-
-//End of file
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/plugins/image/src/thumbnailimageprovider.cpp
--- a/imagehandlingutilities/thumbnailmanager/plugins/image/src/thumbnailimageprovider.cpp Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,233 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Image thumbnail provider plugin
- *
-*/
-
-
-#include
-#include
-
-#include "thumbnailimageprovider.h"
-#include "thumbnailimagedecoder.h"
-#include "thumbnailimagedecoderv2.h"
-#include "thumbnailmanageruids.hrh"
-#include "thumbnaillog.h"
-#include "thumbnailmanagerconstants.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "thumbnailimageproviderTraces.h"
-#endif
-
-
-#ifndef IMPLEMENTATION_PROXY_ENTRY
-typedef TAny* TProxyNewLPtr;
-#define IMPLEMENTATION_PROXY_ENTRY(aUid, aFuncPtr) \
-{ {aUid}, static_cast(aFuncPtr) }
-#endif
-
-
-// ======== MEMBER FUNCTIONS ========
-
-// ---------------------------------------------------------------------------
-// CThumbnailImageProvider::NewL()
-// Two-phased constructor.
-// ---------------------------------------------------------------------------
-//
-CThumbnailImageProvider* CThumbnailImageProvider::NewL()
- {
- CThumbnailImageProvider* self = new( ELeave )CThumbnailImageProvider();
- return self;
- }
-
-
-// ---------------------------------------------------------------------------
-// CThumbnailImageProvider::CThumbnailImageProvider()
-// C++ default constructor can NOT contain any code, that might leave.
-// ---------------------------------------------------------------------------
-//
-CThumbnailImageProvider::CThumbnailImageProvider()
- {
- TN_DEBUG1( "CThumbnailImageProvider::CThumbnailImageProvider()" );
- OstTrace0( TRACE_NORMAL, CTHUMBNAILIMAGEPROVIDER_CTHUMBNAILIMAGEPROVIDER, "CThumbnailImageProvider::CThumbnailImageProvider" );
- }
-
-
-// ---------------------------------------------------------------------------
-// CThumbnailImageProvider::~CThumbnailImageProvider()
-// Destructor.
-// ---------------------------------------------------------------------------
-//
-CThumbnailImageProvider::~CThumbnailImageProvider()
- {
- TN_DEBUG1( "CThumbnailImageProvider::~CThumbnailImageProvider()" );
- OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILIMAGEPROVIDER_CTHUMBNAILIMAGEPROVIDER, "CThumbnailImageProvider::~CThumbnailImageProvider" );
- delete iImageDecoder;
- iImageDecoder = NULL;
- delete iImageDecoderv2;
- iImageDecoderv2 = NULL;
- REComSession::DestroyedImplementation( iDtor_ID_Key );
- }
-
-
-// ---------------------------------------------------------------------------
-// CThumbnailImageProvider::GetThumbnailL()
-// Provides the thumbnail image
-// ---------------------------------------------------------------------------
-//
-void CThumbnailImageProvider::GetThumbnailL( RFs& aFs, RFile64& aFile, const
- TDataType& aMimeType, const CThumbnailManager::TThumbnailFlags aFlags,
- const TDisplayMode /*aDisplayMode*/, const CThumbnailManager::TThumbnailQualityPreference aQualityPreference )
- {
- TN_DEBUG1( "CThumbnailImageProvider::GetThumbnailL() start" );
- OstTrace0( TRACE_NORMAL, CTHUMBNAILIMAGEPROVIDER_GETTHUMBNAILL, "CThumbnailImageProvider::GetThumbnailL - start" );
-
- if ( !iImageDecoder )
- {
- iImageDecoder = new( ELeave )CThumbnailImageDecoder( aFs );
- }
-
- iMimeType = aMimeType;
- iFlags = aFlags;
- iQualityPreference = aQualityPreference;
- //set default mode displaymode from global constants
- iDisplayMode = KStoreDisplayMode;
-
-//Symbian^4 specific
- if ( KJpegMime() != iMimeType.Des8() )
- {
- iDisplayMode = EColor16M;
- }
-
-//TODO currently only ARM platforms supports MAP mode
-#if !(defined(__CC_ARM) || defined(__ARMCC__))
- iDisplayMode = EColor16M;
-#endif
-
- iImageDecoder->CreateL( aFile, *iObserver, iQualityPreference, iMimeType, iTargetSize );
- iOriginalSize = iImageDecoder->OriginalSize();
- iImageDecoder->DecodeL( iDisplayMode, iFlags );
-
- TN_DEBUG1( "CThumbnailImageProvider::GetThumbnailL() end" );
- OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILIMAGEPROVIDER_GETTHUMBNAILL, "CThumbnailImageProvider::GetThumbnailL - end" );
- }
-
-// ---------------------------------------------------------------------------
-// CThumbnailImageProvider::GetThumbnailL()
-// Provides the thumbnail image
-// ---------------------------------------------------------------------------
-//
-void CThumbnailImageProvider::GetThumbnailL( RFs& aFs, TDesC8* aBuffer, const
- TDataType& aMimeType, const CThumbnailManager::TThumbnailFlags aFlags,
- const TDisplayMode /*aDisplayMode*/, const CThumbnailManager::TThumbnailQualityPreference aQualityPreference )
- {
- TN_DEBUG1( "CThumbnailImageProvider::GetThumbnailL() start" );
- OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILIMAGEPROVIDER_GETTHUMBNAILL, "CThumbnailImageProvider::GetThumbnailL - start" );
-
- if ( !iImageDecoder )
- {
- iImageDecoder = new( ELeave )CThumbnailImageDecoder( aFs );
- }
-
- iMimeType = aMimeType;
- iFlags = aFlags;
- iQualityPreference = aQualityPreference;
- //set default mode displaymode from global constants
- iDisplayMode = KStoreDisplayMode;
-
-//Symbian^4 specific
- if ( KJpegMime() != iMimeType.Des8() )
- {
- iDisplayMode = EColor16M;
- }
-
-//TODO currently only ARM platforms supports MAP mode
-#if !(defined(__CC_ARM) || defined(__ARMCC__))
- iDisplayMode = EColor16M;
-#endif
-
- iImageDecoder->CreateL( aBuffer, *iObserver, iQualityPreference, iMimeType, iTargetSize );
- iOriginalSize = iImageDecoder->OriginalSize();
- iImageDecoder->DecodeL( iDisplayMode, iFlags );
-
- TN_DEBUG1( "CThumbnailImageProvider::GetThumbnailL() end" );
- OstTrace0( TRACE_NORMAL, DUP3_CTHUMBNAILIMAGEPROVIDER_GETTHUMBNAILL, "CThumbnailImageProvider::GetThumbnailL - end" );
- }
-
-// ---------------------------------------------------------------------------
-// CThumbnailImageProvider::GetThumbnailL()
-// Provides the thumbnail image
-// ---------------------------------------------------------------------------
-//
-void CThumbnailImageProvider::GetThumbnailL( RFs& aFs, TDesC8& aBuffer)
- {
- TN_DEBUG1( "CThumbnailImageProvider::GetThumbnailL() start" );
- OstTrace0( TRACE_NORMAL, DUP4_CTHUMBNAILIMAGEPROVIDER_GETTHUMBNAILL, "CThumbnailImageProvider::GetThumbnailL - start" );
-
- if ( !iImageDecoderv2 )
- {
- iImageDecoderv2 = new( ELeave )CThumbnailImageDecoderv2( aFs);
- }
-
- iImageDecoderv2->CreateL(aBuffer, *iObserver);
-
- iImageDecoderv2->DecodeL();
-
- TN_DEBUG1( "CThumbnailImageProvider::GetThumbnailL() end" );
- OstTrace0( TRACE_NORMAL, DUP5_CTHUMBNAILIMAGEPROVIDER_GETTHUMBNAILL, "CThumbnailImageProvider::GetThumbnailL - end" );
- }
-
-// ---------------------------------------------------------------------------
-// Cancel thumbnail request
-// ---------------------------------------------------------------------------
-//
-void CThumbnailImageProvider::CancelGetThumbnail()
- {
- if ( iImageDecoder )
- {
- iImageDecoder->Cancel();
- }
- if ( iImageDecoderv2)
- {
- iImageDecoderv2->Cancel();
- }
- }
-
-// ======== GLOBAL FUNCTIONS ========
-
-// -----------------------------------------------------------------------------
-// ImplementationTable
-// Define the interface UIDs
-// -----------------------------------------------------------------------------
-//
-const TImplementationProxy ImplementationTable[] =
- {
- IMPLEMENTATION_PROXY_ENTRY( THUMBNAIL_IMAGE_PROVIDER_IMP_UID,
- CThumbnailImageProvider::NewL )
-};
-
-
-// -----------------------------------------------------------------------------
-// ImplementationGroupProxy
-// The one and only exported function that is the ECom entry point
-// -----------------------------------------------------------------------------
-//
-EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt&
- aTableCount )
- {
- aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy );
- return ImplementationTable;
- }
-
-//End of file
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/plugins/image/src/thumbnailimageprovider.rss
--- a/imagehandlingutilities/thumbnailmanager/plugins/image/src/thumbnailimageprovider.rss Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Image thumbnail provider plugin resource file
-*
-*/
-
-
-#include "registryinfov2.rh"
-#include "thumbnailmanageruids.hrh"
-
-RESOURCE REGISTRY_INFO theInfo
-{
-// resource_format_version must always be set as follows
-resource_format_version = RESOURCE_FORMAT_VERSION_2;
-
-// Normal plug-in parameters
-dll_uid = THUMBNAIL_IMAGE_PROVIDER_DLL_UID;
-interfaces =
- {
- INTERFACE_INFO
- {
- interface_uid = THUMBNAIL_PROVIDER_IF_UID;
- implementations =
- {
- IMPLEMENTATION_INFO
- {
- implementation_uid = THUMBNAIL_IMAGE_PROVIDER_IMP_UID;
- version_no = 1;
- display_name = "";
- default_data = "";
- opaque_data = "image/*";
- rom_only = 0;
- }
- };
- }
- };
-}
-
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/plugins/video/group/bld.inf
--- a/imagehandlingutilities/thumbnailmanager/plugins/video/group/bld.inf Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Build information file for project ?myapp
-*
-*/
-
-
-#include
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_MMPFILES
-thumbnailvideoprovider.mmp
-
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/plugins/video/group/thumbnailvideoprovider.mmp
--- a/imagehandlingutilities/thumbnailmanager/plugins/video/group/thumbnailvideoprovider.mmp Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Video thumbnail provider plugin
-*
-*/
-
-
-// To get the MW_LAYER_SYSTEMINCLUDE-definition
-#include
-
-#include "../../../inc/thumbnailmanageruids.hrh"
-
-TARGET thumbnailvideoprovider.dll
-CAPABILITY CAP_ECOM_PLUGIN
-TARGETTYPE PLUGIN
-
-UID 0x10009D8D THUMBNAIL_VIDEO_PROVIDER_DLL_UID
-VENDORID VID_DEFAULT
-
-SOURCEPATH ../src
-SOURCE thumbnailvideoprovider.cpp
-
-// Default system include paths for middleware layer modules.
-MW_LAYER_SYSTEMINCLUDE
-
-USERINCLUDE ../inc
-USERINCLUDE ../../../inc ../traces
-
-SYSTEMINCLUDE /epoc32/include/ecom
-
-START RESOURCE ../src/thumbnailvideoprovider.rss
-END
-
-LIBRARY euser.lib
-LIBRARY ecom.lib
-LIBRARY tneengine.lib
-LIBRARY efsrv.lib
-LIBRARY fbscli.lib
-
-DEBUGLIBRARY flogger.lib
-
-OPTION ARMCC -O3 -OTime
-
-PAGED
-BYTEPAIRCOMPRESSTARGET
-
-// End of File
-
-
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/plugins/video/inc/thumbnailvideoprovider.h
--- a/imagehandlingutilities/thumbnailmanager/plugins/video/inc/thumbnailvideoprovider.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,155 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Video thumbnail provider.
- *
-*/
-
-
-#ifndef THUMBNAILVIDEOPROVIDER_H
-#define THUMBNAILVIDEOPROVIDER_H
-
-#include
-#include
-
-#include "thumbnailprovider.h"
-
-/**
- * Video thumbnail provider plugin.
- *
- * @since S60 v5.0
- */
-class CThumbnailVideoProvider: public CThumbnailProvider, public CActive,
- public MTNEVideoClipThumbObserver, public MTNEVideoClipInfoObserver
- {
-public:
-
- /**
- * Two-phased constructor.
- *
- * @since S60 v5.0
- * @return New video thumbnail provider instance.
- */
- static CThumbnailVideoProvider* NewL();
-
- /**
- * Destructor
- *
- * @since S60 v5.0
- */
- virtual ~CThumbnailVideoProvider();
-
- /**
- * Function that will provide thumbnail from given parameters.
- *
- * @since S60 v5.0
- * @param aFs File server session
- * @param aFile Source image file.
- * @param aMimeType Mime-type of the clip to be processed.
- * @param aFlags Flags for thumbnail creation.
- * @param aDisplayMode Used display mode.
- */
- void GetThumbnailL( RFs& aFs, RFile64& aFile, const TDataType& aMimeType,
- const CThumbnailManager::TThumbnailFlags aFlags, const TDisplayMode
- aDisplayMode, const CThumbnailManager::TThumbnailQualityPreference aQualityPreference );
-
- /**
- * Function that will provide thumbnail from given parameters.
- *
- * @since S60 v5.0
- * @param aFs File server session
- * @param aBuffer Source image buffer.
- * @param aMimeType Mime-type of the clip to be processed.
- * @param aFlags Flags for thumbnail creation.
- * @param aDisplayMode Used display mode.
- */
- void GetThumbnailL( RFs& aFs, TDesC8* aBuffer, const
- TDataType& aMimeType, const CThumbnailManager::TThumbnailFlags aFlags,
- const TDisplayMode aDisplayMode, const CThumbnailManager::TThumbnailQualityPreference aQualityPreference );
-
- /**
- * Function that will provide thumbnail from given parameters.
- *
- * @since S60 v5.0
- * @param aFs File server session
- * @param aBuffer Source image buffer.
- */
-
- void GetThumbnailL( RFs& aFs, TDesC8& aBuffer);
- /**
- * Cancel a previous thumbnail request, if any.
- *
- * @since S60 5.0
- */
- void CancelGetThumbnail();
-
-protected:
-
- /**
- * Notifies when video clip thumbnail is ready.
- *
- * @since S60 v5.0
- * @param aInfo Video clip info.
- * @param aError Error code.
- * @param aThumb Thumbnail image.
- */
- void NotifyVideoClipThumbCompleted( CTNEVideoClipInfo& aInfo, TInt aError,
- CFbsBitmap* aThumb );
-
- /**
- * Notifies when info about video clip is ready.
- *
- * @since S60 v5.0
- * @param aInfo Video clip info.
- * @param aError Error code.
- */
- void NotifyVideoClipInfoReady( CTNEVideoClipInfo& aInfo, TInt aError );
-
-private:
-
- /**
- * C++ default constructor
- *
- * @since S60 v5.0
- * @return New video thumbnail provider instance.
- */
- CThumbnailVideoProvider();
-
- /**
- * Implements cancellation of an outstanding request.
- *
- * @since S60 v5.0
- */
- void DoCancel();
-
- /**
- * Handles an active object's request completion event.
- *
- * @since S60 v5.0
- */
- void RunL();
-
-private:
- // data
-
- /**
- * Video clip info.
- */
- CTNEVideoClipInfo* iVideoClipInfo;
-
- RTimer iTimer;
- TBool iTimeout;
-
-};
-
-#endif // THUMBNAILVIDEOPROVIDER_H
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/plugins/video/src/thumbnailvideoprovider.cpp
--- a/imagehandlingutilities/thumbnailmanager/plugins/video/src/thumbnailvideoprovider.cpp Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,308 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Video thumbnail provider
- *
-*/
-
-
-#include
-#include
-#include
-#include
-
-#include "thumbnailvideoprovider.h"
-#include "thumbnailmanageruids.hrh"
-#include "thumbnailmanagerconstants.h"
-#include "thumbnaillog.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "thumbnailvideoproviderTraces.h"
-#endif
-
-
-#ifndef IMPLEMENTATION_PROXY_ENTRY
-typedef TAny* TProxyNewLPtr;
-#define IMPLEMENTATION_PROXY_ENTRY(aUid, aFuncPtr) \
-{ {aUid}, static_cast(aFuncPtr) }
-#endif
-
-// ======== MEMBER FUNCTIONS ========
-
-// ---------------------------------------------------------------------------
-// CThumbnailVideoProvider::NewL()
-// Two-phased constructor.
-// ---------------------------------------------------------------------------
-//
-CThumbnailVideoProvider* CThumbnailVideoProvider::NewL()
- {
- CThumbnailVideoProvider* self = new( ELeave )CThumbnailVideoProvider();
- return self;
- }
-
-
-// ---------------------------------------------------------------------------
-// CThumbnailImageProvider::CThumbnailImageProvider()
-// C++ default constructor can NOT contain any code, that might leave.
-// ---------------------------------------------------------------------------
-//
-CThumbnailVideoProvider::CThumbnailVideoProvider():CActive( EPriorityStandard )
- {
- CActiveScheduler::Add( this );
-
- iTimer.CreateLocal();
- iTimeout = EFalse;
-
- TN_DEBUG1( "CThumbnailVideoProvider::CThumbnailVideoProvider()" );
- OstTrace0( TRACE_NORMAL, CTHUMBNAILVIDEOPROVIDER_CTHUMBNAILVIDEOPROVIDER, "CThumbnailVideoProvider::CThumbnailVideoProvider" );
- }
-
-
-// ---------------------------------------------------------------------------
-// CThumbnailVideoProvider::~CThumbnailVideoProvider()
-// Destructor.
-// ---------------------------------------------------------------------------
-//
-CThumbnailVideoProvider::~CThumbnailVideoProvider()
- {
- // run DoCancel even if not active
- if ( IsActive() )
- {
- Cancel();
- }
- else
- {
- DoCancel();
- }
-
- iTimer.Close();
-
- TN_DEBUG1( "CThumbnailVideoProvider::~CThumbnailVideoProvider()" );
- OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILVIDEOPROVIDER_CTHUMBNAILVIDEOPROVIDER, "CThumbnailVideoProvider::~CThumbnailVideoProvider" );
- REComSession::DestroyedImplementation( iDtor_ID_Key );
- }
-// -----------------------------------------------------------------------------
-// CThumbnailVideoProvider::DoCancel()
-// -----------------------------------------------------------------------------
-//
-void CThumbnailVideoProvider::DoCancel()
- {
- iTimer.Cancel();
-
- if ( iVideoClipInfo )
- {
- iVideoClipInfo->CancelThumb();
-
- delete iVideoClipInfo;
- iVideoClipInfo = NULL;
- }
- }
-
-
-// -----------------------------------------------------------------------------
-// CThumbnailImageDecoder::RunL()
-// -----------------------------------------------------------------------------
-//
-void CThumbnailVideoProvider::RunL()
- {
- DoCancel();
-
- // video thumbnail engine doesn't respond
- if (iTimeout)
- {
- iObserver->ThumbnailProviderReady( KErrCompletion, NULL, TSize(), EFalse, EFalse);
- iTimeout = EFalse;
-
- TN_DEBUG1( "CThumbnailVideoProvider::RunL() - timeout" );
- OstTrace0( TRACE_NORMAL, CTHUMBNAILVIDEOPROVIDER_RUNL, "CThumbnailVideoProvider::RunL - timeout" );
- }
- }
-
-// ---------------------------------------------------------------------------
-// CThumbnailVideoProvider::GetThumbnailL()
-// Provides the thumbnail image of video clip
-// ---------------------------------------------------------------------------
-//
-void CThumbnailVideoProvider::GetThumbnailL( RFs& /*aFs*/, RFile64& aFile, const
- TDataType& /*aMimeType*/, const CThumbnailManager::TThumbnailFlags aFlags,
- const TDisplayMode /*aDisplayMode*/, const CThumbnailManager::TThumbnailQualityPreference /*aQualityPreference */)
- {
- TN_DEBUG1( "CThumbnailVideoProvider::GetThumbnailL() start" );
- OstTrace0( TRACE_NORMAL, CTHUMBNAILVIDEOPROVIDER_GETTHUMBNAILL, "CThumbnailVideoProvider::GetThumbnailL - start" );
-
- iFlags = aFlags;
- //set default mode displaymode from global constants
- iDisplayMode = KStoreDisplayMode;
-
-//Symbian^4 specific
-//TODO currently only ARM platforms supports MAP mode
-#if !(defined(__CC_ARM) || defined(__ARMCC__))
- iDisplayMode = EColor16M;
-#endif
-
- TFileName filename;
- User::LeaveIfError( aFile.FullName( filename ));
-
- TRAPD( err, iVideoClipInfo = CTNEVideoClipInfo::NewL( filename, * this ));
-
- if ( err != KErrNone )
- {
- User::Leave( KErrCorrupt );
- }
-
- TN_DEBUG1( "CThumbnailVideoProvider::GetThumbnailL() end" );
- OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILVIDEOPROVIDER_GETTHUMBNAILL, "CThumbnailVideoProvider::GetThumbnailL - end" );
- }
-
-// ---------------------------------------------------------------------------
-// CThumbnailVideoProvider::GetThumbnailL()
-// ---------------------------------------------------------------------------
-//
-void CThumbnailVideoProvider::GetThumbnailL( RFs& /*aFs*/,
- TDesC8* /* aBuffer */,
- const TDataType& /* aMimeType */,
- const CThumbnailManager::TThumbnailFlags /*aFlags*/,
- const TDisplayMode /* aDisplayMode */,
- const CThumbnailManager::TThumbnailQualityPreference /*aQualityPreference */)
- {
- TN_DEBUG1( "CThumbnailVideoProvider::GetThumbnailL() - nothing to do" );
- OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILVIDEOPROVIDER_GETTHUMBNAILL, "CThumbnailVideoProvider::GetThumbnailL - nothing to do" );
- }
-
-// ---------------------------------------------------------------------------
-// CThumbnailVideoProvider::GetThumbnailL()
-// ---------------------------------------------------------------------------
-//
-void CThumbnailVideoProvider::GetThumbnailL( RFs& /*aFs*/, TDesC8& /*aBuffer*/)
- {
- TN_DEBUG1( "CThumbnailVideoProvider::GetThumbnailL() - nothing to do" );
- OstTrace0( TRACE_NORMAL, DUP3_CTHUMBNAILVIDEOPROVIDER_GETTHUMBNAILL, "CThumbnailVideoProvider::GetThumbnailL - nothing to do" );
- User::Leave( KErrNotSupported );
- }
-
-// ---------------------------------------------------------------------------
-// Cancel thumbnail request
-// ---------------------------------------------------------------------------
-//
-void CThumbnailVideoProvider::CancelGetThumbnail()
- {
- // run DoCancel even if not active
- if ( IsActive() )
- {
- Cancel();
- }
- else
- {
- DoCancel();
- }
- }
-
-// ---------------------------------------------------------------------------
-// CThumbnailVideoProvider::NotifyVideoClipThumbCompleted()
-// Used to notify when thumbnail image of video clip is ready
-// ---------------------------------------------------------------------------
-//
-void CThumbnailVideoProvider::NotifyVideoClipThumbCompleted( CTNEVideoClipInfo&
- /*aInfo*/, TInt aError, CFbsBitmap* aThumb )
- {
- TN_DEBUG2( "CThumbnailVideoProvider::NotifyVideoClipThumbCompleted(aError=%d)", aError );
- OstTrace1( TRACE_NORMAL, CTHUMBNAILVIDEOPROVIDER_NOTIFYVIDEOCLIPTHUMBCOMPLETED, "CThumbnailVideoProvider::NotifyVideoClipThumbCompleted;aError=%d", aError );
-
- iTimer.Cancel();
- iTimeout = EFalse;
-
- if (( aError == KErrNone ) && aThumb )
- {
- iOriginalSize = aThumb->SizeInPixels();
- }
-
- iObserver->ThumbnailProviderReady( aError, aThumb, iOriginalSize, EFalse, EFalse);
- }
-
-
-// ---------------------------------------------------------------------------
-// CThumbnailVideoProvider::NotifyVideoClipInfoReady()
-// Used to notify when information of video clip is available
-// ---------------------------------------------------------------------------
-//
-void CThumbnailVideoProvider::NotifyVideoClipInfoReady( CTNEVideoClipInfo&
- aInfo, TInt aError )
- {
- TN_DEBUG2( "CThumbnailVideoProvider::NotifyVideoClipInfoReady(aError=%d)", aError );
- OstTrace1( TRACE_NORMAL, CTHUMBNAILVIDEOPROVIDER_NOTIFYVIDEOCLIPINFOREADY, "CThumbnailVideoProvider::NotifyVideoClipInfoReady;aError=%d", aError );
-
- if ( aError == KErrNone )
- {
- TInt err( KErrNone );
-
- // cannot determine target size, aspect ratio scaling fails
- TRAP( err, aInfo.GetThumbL( *this, KBestThumbIndex, NULL, iDisplayMode, ETrue ));
-
- if ( err != KErrNone )
- {
- TN_DEBUG2( "CThumbnailVideoProvider::NotifyVideoClipInfoReady() -- GetThumbL() left with %d", err );
- OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILVIDEOPROVIDER_NOTIFYVIDEOCLIPINFOREADY, "CThumbnailVideoProvider::NotifyVideoClipInfoReady - GetThumbL() left with;err=%d", err );
-
- iObserver->ThumbnailProviderReady( err, NULL, TSize(), EFalse, EFalse);
-
- SetActive();
- TRequestStatus* statusPtr = &iStatus;
- User::RequestComplete( statusPtr, KErrNone );
- }
- else
- {
- // request timeout
- iTimeout = ETrue;
- iTimer.After(iStatus, KVideoDecoderTimeout);
- SetActive();
- }
- }
- else
- {
- iObserver->ThumbnailProviderReady( aError, NULL, TSize(), EFalse, EFalse);
-
- SetActive();
- TRequestStatus* statusPtr = &iStatus;
- User::RequestComplete( statusPtr, KErrNone );
- }
- }
-
-
-// ======== GLOBAL FUNCTIONS ========
-
-// -----------------------------------------------------------------------------
-// ImplementationTable
-// Define the interface UIDs
-// -----------------------------------------------------------------------------
-//
-const TImplementationProxy ImplementationTable[] =
- {
- IMPLEMENTATION_PROXY_ENTRY( THUMBNAIL_VIDEO_PROVIDER_IMP_UID,
- CThumbnailVideoProvider::NewL )
-};
-
-
-// -----------------------------------------------------------------------------
-// ImplementationGroupProxy
-// The one and only exported function that is the ECom entry point
-// -----------------------------------------------------------------------------
-//
-EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt&
- aTableCount )
- {
- aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy );
-
- return ImplementationTable;
- }
-
-// End of file
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/plugins/video/src/thumbnailvideoprovider.rss
--- a/imagehandlingutilities/thumbnailmanager/plugins/video/src/thumbnailvideoprovider.rss Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Video thumbnail provider plugin resource file
-*
-*/
-
-
-#include "registryinfov2.rh"
-#include "thumbnailmanageruids.hrh"
-
-RESOURCE REGISTRY_INFO theInfo
-{
-// resource_format_version must always be set as follows
-resource_format_version = RESOURCE_FORMAT_VERSION_2;
-
-// Normal plug-in parameters
-dll_uid = THUMBNAIL_VIDEO_PROVIDER_DLL_UID;
-interfaces =
- {
- INTERFACE_INFO
- {
- interface_uid = THUMBNAIL_PROVIDER_IF_UID;
- implementations =
- {
- IMPLEMENTATION_INFO
- {
- implementation_uid = THUMBNAIL_VIDEO_PROVIDER_IMP_UID;
- version_no = 1;
- display_name = "";
- default_data = "";
- opaque_data = "video/*";
- rom_only = 0;
- }
- };
- }
- };
-}
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/rom/thumbagdaemon.iby
--- a/imagehandlingutilities/thumbnailmanager/rom/thumbagdaemon.iby Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Iby file
-*
-*/
-
-
-#ifdef RD_THUMBNAILMANAGER
-
-#ifndef THUMBAGDAEMON_IBY
-#define THUMBAGDAEMON_IBY
-
-file=ABI_DIR\BUILD_DIR\thumbagdaemon.exe PROGRAMS_DIR\thumbagdaemon.exe
-
-#endif // THUMBNAILMANAGER_IBY
-
-#endif // RD_THUMBNAILMANAGER
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/rom/thumbnailmanager.iby
--- a/imagehandlingutilities/thumbnailmanager/rom/thumbnailmanager.iby Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Iby file
-*
-*/
-
-
-#ifdef RD_THUMBNAILMANAGER
-
-#ifndef THUMBNAILMANAGER_IBY
-#define THUMBNAILMANAGER_IBY
-
-file=ABI_DIR\BUILD_DIR\thumbnailmanager.dll SHARED_LIB_DIR\thumbnailmanager.dll
-file=ABI_DIR\BUILD_DIR\thumbnailserver.exe PROGRAMS_DIR\thumbnailserver.exe
-
-ECOM_PLUGIN(thumbnailvideoprovider.dll, thumbnailvideoprovider.rsc)
-ECOM_PLUGIN(thumbnailimageprovider.dll, thumbnailimageprovider.rsc)
-ECOM_PLUGIN(thumbnailaudioprovider.dll, thumbnailaudioprovider.rsc)
-
-data=ZSYSTEM\install\thumbnailmanager_stub.sis system\install\thumbnailmanager_stub.sis
-
-#endif // THUMBNAILMANAGER_IBY
-
-#endif // RD_THUMBNAILMANAGER
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/sis/thumbnailmanager/depends.xml
--- a/imagehandlingutilities/thumbnailmanager/sis/thumbnailmanager/depends.xml Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-
-
-
-
- 1
- Thumbnail Manager
- Upgrade package for Thumbnail Manager
-
-
-
- S60
-
- 5
- 0
-
- 2009
- 1
-
-
-
-
-
-
-
\ No newline at end of file
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/sis/thumbnailmanager/package.pkg
--- a/imagehandlingutilities/thumbnailmanager/sis/thumbnailmanager/package.pkg Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-;
-; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-; All rights reserved.
-; This component and the accompanying materials are made available
-; under the terms of "Eclipse Public License v1.0"
-; which accompanies this distribution, and is available
-; at the URL "http://www.eclipse.org/legal/epl-v10.html".
-;
-; Initial Contributors:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description:
-;
-; Languages
-&EN
-
-; Header
-#{"Thumbnail Manager"},(0x102830AB), 10, 10, 9, TYPE=SA, RU
-
-; Localised Vendor name
-%{"Nokia"}
-
-; Unique Vendor name
-:"Nokia"
-
-;Files
-@"..\thumbnailmanagercenrep\thumbnailmanagercenrep.sisx",(0x10202BE9)
-"\epoc32\release\armv5\urel\thumbnailserver.exe"-"c:\sys\bin\thumbnailserver.exe"
-"\epoc32\release\armv5\urel\thumbagdaemon.exe"-"c:\sys\bin\thumbagdaemon.exe"
-"\epoc32\release\armv5\urel\thumbnailmanager.dll"-"c:\sys\bin\thumbnailmanager.dll"
-"\epoc32\release\armv5\urel\thumbnailimageprovider.dll"-"c:\sys\bin\thumbnailimageprovider.dll"
-"\epoc32\release\armv5\urel\thumbnailvideoprovider.dll"-"c:\sys\bin\thumbnailvideoprovider.dll"
-"\epoc32\release\armv5\urel\thumbnailaudioprovider.dll"-"c:\sys\bin\thumbnailaudioprovider.dll"
-"\epoc32\data\z\resource\plugins\thumbnailimageprovider.rsc"-"c:\resource\plugins\thumbnailimageprovider.rsc"
-"\epoc32\data\z\resource\plugins\thumbnailvideoprovider.rsc"-"c:\resource\plugins\thumbnailvideoprovider.rsc"
-"\epoc32\data\z\resource\plugins\thumbnailaudioprovider.rsc"-"c:\resource\plugins\thumbnailaudioprovider.rsc"
-"\epoc32\release\armv5\urel\tmiadrestart.exe"-"c:\sys\bin\tmiadrestart.exe",FILERUN,RB
\ No newline at end of file
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/sis/thumbnailmanager/stub.pkg
--- a/imagehandlingutilities/thumbnailmanager/sis/thumbnailmanager/stub.pkg Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-;
-; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-; All rights reserved.
-; This component and the accompanying materials are made available
-; under the terms of "Eclipse Public License v1.0"
-; which accompanies this distribution, and is available
-; at the URL "http://www.eclipse.org/legal/epl-v10.html".
-;
-; Initial Contributors:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description:
-;
-; Languages
-&EN
-
-; Header
-#{"ThumbnailManager"},(0x102830AB), 10, 10, 9, TYPE=SA
-
-; Localised Vendor name
-%{"Nokia"}
-
-; Unique Vendor name
-:"Nokia"
-
-;Files
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/sis/thumbnailmanager/thumbnailmanager_stub.sis
Binary file imagehandlingutilities/thumbnailmanager/sis/thumbnailmanager/thumbnailmanager_stub.sis has changed
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/sis/thumbnailmanagercenrep/package.pkg
--- a/imagehandlingutilities/thumbnailmanager/sis/thumbnailmanagercenrep/package.pkg Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-;
-; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-; All rights reserved.
-; This component and the accompanying materials are made available
-; under the terms of "Eclipse Public License v1.0"
-; which accompanies this distribution, and is available
-; at the URL "http://www.eclipse.org/legal/epl-v10.html".
-;
-; Initial Contributors:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description:
-;
-; Languages
-&EN
-
-; Header
-#{"Thumbnail Manager Cenrep"},(0x10202BE9), 10, 10, 9, TYPE=SP
-
-; Localised Vendor name
-%{"Symbian Software Ltd."}
-
-; Unique Vendor name
-:"Symbian Software Ltd."
-
-;Files
-"..\..\conf\102830B0.txt"-"c:\private\10202be9\102830B0.txt"
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/thumbagdaemon/group/bld.inf
--- a/imagehandlingutilities/thumbnailmanager/thumbagdaemon/group/bld.inf Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Build information file
-*
-*/
-
-
-#include
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_MMPFILES
-thumbagdaemon.mmp
-
-
-// End of File
-
-
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/thumbagdaemon/group/thumbagdaemon.mmp
--- a/imagehandlingutilities/thumbnailmanager/thumbagdaemon/group/thumbagdaemon.mmp Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Project definition file
-*
-*/
-
-
-#include
-#include
-#include "../../inc/thumbnailmanageruids.hrh"
-
-VERSION 10.0
-TARGET thumbagdaemon.exe
-TARGETTYPE EXE
-UID 0x0 THUMBAGDAEMON_UID
-
-#ifdef WINSCW
-EPOCHEAPSIZE 4096 0x200000 // heap 2MB
-#else
-EPOCHEAPSIZE 4096 0x800000 // max heap 8MB
-#endif
-
-CAPABILITY ALL -AllFiles -DRM -TCB
-VENDORID VID_DEFAULT
-
-EPOCPROCESSPRIORITY background
-
-MACRO MDS_URI_OBSERVER
-MACRO MDS_MODIFY_OBSERVER
-
-SOURCEPATH ../src
-SOURCE thumbagdaemon.cpp
-SOURCE thumbagprocessor.cpp
-
-SOURCEPATH ../../tmcommon/src
-SOURCE tmactivitymanager.cpp
-SOURCE tmshutdownobserver.cpp
-SOURCE tmformatobserver.cpp
-SOURCE tmsrproptertyobserver.cpp
-
-SOURCEPATH ../src
-SOURCE thumbagimageobserver.cpp
-SOURCE thumbagcameraobserver.cpp
-SOURCE thumbagaudioobserver.cpp
-SOURCE thumbagvideoobserver.cpp
-
-// Default system include paths for middleware layer modules.
-MW_LAYER_SYSTEMINCLUDE
-
-USERINCLUDE ../inc
-USERINCLUDE ../../inc
-USERINCLUDE ../../tmcommon/inc ../traces ../../thumbnailserver/traces
-
-LIBRARY euser.lib
-LIBRARY mdeclient.lib
-LIBRARY thumbnailmanager.lib
-LIBRARY centralrepository.lib
-LIBRARY harvesterclient.lib
-LIBRARY bafl.lib
-LIBRARY mpxcollectionhelper.lib mpxcollectionutility.lib mpxcommon.lib
-LIBRARY hwrmlightclient.lib
-
-DEBUGLIBRARY flogger.lib
-
-OPTION ARMCC -O3 -OTime
-
-PAGED
-BYTEPAIRCOMPRESSTARGET
-
-// End of File
-
-
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/thumbagdaemon/inc/thumbagaudioobserver.h
--- a/imagehandlingutilities/thumbnailmanager/thumbagdaemon/inc/thumbagaudioobserver.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,148 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Thumbnail Auto Generate Daemon
- *
-*/
-
-
-#ifndef THUMBAGAUDIOOBSERVER_H
-#define THUMBAGAUDIOOBSERVER_H
-
-#include
-#include
-
-#include
-
-#include "thumbagprocessor.h"
-#include "tmshutdownobserver.h"
-#include "thumbnaillog.h"
-
-
-/**
- * ThumbAG daemon.
- *
- * @since S60 v5.0
- */
-NONSHARABLE_CLASS( CThumbAGAudioObserver ): public CBase,
- public MMdESessionObserver,
- public MMdEObjectObserver,
- public MTMShutdownObserver
- {
-public:
-
- /**
- * Two-phased constructor
- *
- * @since S60 v5.0
- * @return New CThumbAGAudioObserver server.
- */
- static CThumbAGAudioObserver* NewLC(CThumbAGProcessor* aProcessor);
-
- /**
- * Two-phased constructor
- *
- * @since S60 v5.0
- * @return New CThumbAGAudioObserver server.
- */
- static CThumbAGAudioObserver* NewL(CThumbAGProcessor* aProcessor);
-
- /**
- * Destructor
- *
- * @since S60 v5.0
- */
- virtual ~CThumbAGAudioObserver();
-
-
-public:
-
- // from MMdESessionObserver
- void HandleSessionOpened( CMdESession& aSession, TInt aError );
- void HandleSessionError( CMdESession& aSession, TInt aError );
-
- // from MMdEObjectObserver
- void HandleObjectNotification(CMdESession& aSession,
- TObserverNotificationType aType,
- const RArray& aObjectIdArray);
-
- // from MTMShutdownObserver
- void ShutdownNotification();
-
-protected:
-
- /**
- * AddObserversL
- *
- * @since S60 v5.0
- */
- void AddObserversL();
-
-
-private:
-
- /**
- * C++ default constructor
- *
- * @since S60 v5.0
- * @return New CThumbAGAudioObserver instance.
- */
- CThumbAGAudioObserver(CThumbAGProcessor* aProcessor);
-
- /**
- * Symbian 2nd phase constructor can leave.
- *
- * @since S60 v5.0
- */
- void ConstructL();
-
- /**
- * Initilization helper
- *
- * @since S60 v5.2
- */
- void InitializeL();
-
- /**
- * Callback for reconnect timer
- *
- * @since S60 v5.0
- */
- static TInt ReconnectCallBack(TAny* aAny);
-
- void Shutdown();
-
-private:
-
- // own
- CTMShutdownObserver* iShutdownObserver;
- CTMShutdownObserver* iMDSShutdownObserver;
- CMdESession* iMdESession;
-
- //not owned
- CThumbAGProcessor* iProcessor;
-
- TBool iShutdown;
-
- // reconnect timer
- CPeriodic* iReconnect;
-
- TBool iSessionError;
-
-#ifdef _DEBUG
- TUint32 iAddCounter;
- TUint32 iModCounter;
-#endif
-};
-
-#endif // THUMBAGDAEMON_H
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/thumbagdaemon/inc/thumbagcameraobserver.h
--- a/imagehandlingutilities/thumbnailmanager/thumbagdaemon/inc/thumbagcameraobserver.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,145 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Thumbnail Auto Generate Daemon
- *
-*/
-
-
-#ifndef THUMBAGCAMERAOBSERVER_H
-#define THUMBAGCAMERAOBSERVER_H
-
-#include
-#include
-
-#include
-
-#include "thumbagprocessor.h"
-#include "tmshutdownobserver.h"
-#include "thumbnaillog.h"
-
-
-/**
- * ThumbAG daemon.
- *
- * @since S60 v5.0
- */
-NONSHARABLE_CLASS( CThumbAGCameraObserver ): public CBase,
- public MMdESessionObserver,
- public MMdEObjectObserver,
- public MTMShutdownObserver
- {
-public:
-
- /**
- * Two-phased constructor
- *
- * @since S60 v5.0
- * @return New CThumbAGCameraObserver server.
- */
- static CThumbAGCameraObserver* NewLC(CThumbAGProcessor* aProcessor);
-
- /**
- * Two-phased constructor
- *
- * @since S60 v5.0
- * @return New CThumbAGCameraObserver server.
- */
- static CThumbAGCameraObserver* NewL(CThumbAGProcessor* aProcessor);
-
- /**
- * Destructor
- *
- * @since S60 v5.0
- */
- virtual ~CThumbAGCameraObserver();
-
-
-public:
-
- // from MMdESessionObserver
- void HandleSessionOpened( CMdESession& aSession, TInt aError );
- void HandleSessionError( CMdESession& aSession, TInt aError );
-
- // from MMdEObjectObserver
- void HandleObjectNotification(CMdESession& aSession,
- TObserverNotificationType aType,
- const RArray& aObjectIdArray);
-
- // from MTMShutdownObserver
- void ShutdownNotification();
-
-protected:
-
- /**
- * AddObserversL
- *
- * @since S60 v5.0
- */
- void AddObserversL();
-
-
-private:
-
- /**
- * C++ default constructor
- *
- * @since S60 v5.0
- * @return New CThumbAGCameraObserver instance.
- */
- CThumbAGCameraObserver(CThumbAGProcessor* aProcessor);
-
- /**
- * Symbian 2nd phase constructor can leave.
- *
- * @since S60 v5.0
- */
- void ConstructL();
-
- /**
- * Initilization helper
- *
- * @since S60 v5.2
- */
- void InitializeL();
-
- /**
- * Callback for reconnect timer
- *
- * @since S60 v5.0
- */
- static TInt ReconnectCallBack(TAny* aAny);
-
-private:
-
- // own
- CTMShutdownObserver* iShutdownObserver;
- CTMShutdownObserver* iMDSShutdownObserver;
- CMdESession* iMdESession;
- //not owned
- CThumbAGProcessor* iProcessor;
-
- TBool iShutdown;
-
- // reconnect timer
- CPeriodic* iReconnect;
-
- TBool iSessionError;
-
-#ifdef _DEBUG
- TUint32 iAddCounter;
- TUint32 iModCounter;
-#endif
-};
-
-#endif // THUMBAGDAEMON_H
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/thumbagdaemon/inc/thumbagdaemon.h
--- a/imagehandlingutilities/thumbnailmanager/thumbagdaemon/inc/thumbagdaemon.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,194 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Thumbnail Auto Generate Daemon
- *
-*/
-
-
-#ifndef THUMBAGDAEMON_H
-#define THUMBAGDAEMON_H
-
-#include
-#include
-
-#include
-
-#include "thumbagprocessor.h"
-#include "tmshutdownobserver.h"
-#include "thumbnaillog.h"
-#include "thumbagimageobserver.h"
-#include "thumbagcameraobserver.h"
-#include "thumbagaudioobserver.h"
-#include "thumbagvideoobserver.h"
-
-
-/**
- * ThumbAG daemon.
- *
- * @since S60 v5.0
- */
-NONSHARABLE_CLASS( CThumbAGDaemon ): public CServer2,
- public MMdESessionObserver,
- public MMdEObjectObserver,
- public MTMShutdownObserver,
- public MMdEObjectPresentObserver
-#ifdef MDS_URI_OBSERVER
- ,public MMdEObjectObserverWithUri
-#endif
-
- {
-public:
-
- /**
- * Two-phased constructor
- *
- * @since S60 v5.0
- * @return New CThumbAGDaemon server.
- */
- static CThumbAGDaemon* NewLC();
-
- /**
- * Two-phased constructor
- *
- * @since S60 v5.0
- * @return New CThumbAGDaemon server.
- */
- static CThumbAGDaemon* NewL();
-
- /**
- * Destructor
- *
- * @since S60 v5.0
- */
- virtual ~CThumbAGDaemon();
-
-public:
-
- /**
- * Creates new server session.
- *
- * @since S60 v5.0
- * @param aVersion Version info.
- * @param aMessage Message to be passed.
- * @return New session.
- */
- CSession2* NewSessionL( const TVersion& aVersion,
- const RMessage2& aMessage ) const;
-
- /**
- * ThreadFunctionL
- *
- * @since S60 v5.0
- */
- static void ThreadFunctionL();
-
-public:
-
- // from MMdESessionObserver
- void HandleSessionOpened( CMdESession& aSession, TInt aError );
- void HandleSessionError( CMdESession& aSession, TInt aError );
-
- // from MMdEObjectObserver
- void HandleObjectNotification(CMdESession& aSession,
- TObserverNotificationType aType,
- const RArray& aObjectIdArray);
-
-#ifdef MDS_URI_OBSERVER
- void HandleUriObjectNotification(CMdESession& aSession,
- TObserverNotificationType aType,
- const RArray& aObjectIdArray,
- const RPointerArray& aObjectUriArray);
-#endif
-
- void HandleObjectPresentNotification(CMdESession& aSession,
- TBool aPresent, const RArray& aObjectIdArray);
-
- // from MTMShutdownObserver
- void ShutdownNotification();
-
-protected:
-
- /**
- * AddObserversL
- *
- * @since S60 v5.0
- */
- void AddObserversL();
-
- /**
- * Check if daemon needs to run
- *
- * @since S60 v5.0
- */
- TBool DaemonEnabledL();
-
-private:
-
- /**
- * C++ default constructor
- *
- * @since S60 v5.0
- * @return New CThumbAGDaemon instance.
- */
- CThumbAGDaemon();
-
- /**
- * Symbian 2nd phase constructor can leave.
- *
- * @since S60 v5.0
- */
- void ConstructL();
-
- /**
- * Initilization helper
- *
- * @since S60 v5.2
- */
- void InitializeL();
-
- /**
- * Callback for reconnect timer
- *
- * @since S60 v5.0
- */
- static TInt ReconnectCallBack(TAny* aAny);
-
-private:
-
- // own
- CTMShutdownObserver* iShutdownObserver;
- CTMShutdownObserver* iMDSShutdownObserver;
- CMdESession* iMdESession;
- CThumbAGProcessor* iProcessor;
-
- TBool iShutdown;
-
- // reconnect timer
- CPeriodic* iReconnect;
-
- TBool iSessionError;
-
-#ifdef _DEBUG
- TUint32 iAddCounter;
- TUint32 iDelCounter;
-#endif
-
- //observers
- CThumbAGImageObserver* iImageObserver;
- CThumbAGCameraObserver* iCameraObserver;
- CThumbAGAudioObserver* iAudioObserver;
- CThumbAGVideoObserver* iVideoObserver;
-};
-
-#endif // THUMBAGDAEMON_H
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/thumbagdaemon/inc/thumbagimageobserver.h
--- a/imagehandlingutilities/thumbnailmanager/thumbagdaemon/inc/thumbagimageobserver.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,144 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Thumbnail Auto Generate Daemon
- *
-*/
-
-
-#ifndef THUMBAGIMAGEOBSERVER_H
-#define THUMBAGIMAGEOBSERVER_H
-
-#include
-#include
-
-#include
-
-#include "thumbagprocessor.h"
-#include "thumbnaillog.h"
-#include "tmshutdownobserver.h"
-
-/**
- * ThumbAG daemon.
- *
- * @since S60 v5.0
- */
-NONSHARABLE_CLASS( CThumbAGImageObserver ): public CBase,
- public MMdESessionObserver,
- public MMdEObjectObserver,
- public MTMShutdownObserver
- {
-public:
-
- /**
- * Two-phased constructor
- *
- * @since S60 v5.0
- * @return New CThumbAGImageObserver server.
- */
- static CThumbAGImageObserver* NewLC(CThumbAGProcessor* aProcessor);
-
- /**
- * Two-phased constructor
- *
- * @since S60 v5.0
- * @return New CThumbAGImageObserver server.
- */
- static CThumbAGImageObserver* NewL(CThumbAGProcessor* aProcessor);
-
- /**
- * Destructor
- *
- * @since S60 v5.0
- */
- virtual ~CThumbAGImageObserver();
-
-
-public:
-
- // from MMdESessionObserver
- void HandleSessionOpened( CMdESession& aSession, TInt aError );
- void HandleSessionError( CMdESession& aSession, TInt aError );
-
- // from MMdEObjectObserver
- void HandleObjectNotification(CMdESession& aSession,
- TObserverNotificationType aType,
- const RArray& aObjectIdArray);
-
- // from MTMShutdownObserver
- void ShutdownNotification();
-
-protected:
-
- /**
- * AddObserversL
- *
- * @since S60 v5.0
- */
- void AddObserversL();
-
-
-private:
-
- /**
- * C++ default constructor
- *
- * @since S60 v5.0
- * @return New CThumbAGImageObserver instance.
- */
- CThumbAGImageObserver(CThumbAGProcessor* aProcessor);
-
- /**
- * Symbian 2nd phase constructor can leave.
- *
- * @since S60 v5.0
- */
- void ConstructL();
-
- /**
- * Initilization helper
- *
- * @since S60 v5.2
- */
- void InitializeL();
-
- /**
- * Callback for reconnect timer
- *
- * @since S60 v5.0
- */
- static TInt ReconnectCallBack(TAny* aAny);
-
-private:
-
- // own
- CTMShutdownObserver* iShutdownObserver;
- CTMShutdownObserver* iMDSShutdownObserver;
- CMdESession* iMdESession;
- //not owned
- CThumbAGProcessor* iProcessor;
-
- TBool iShutdown;
-
- // reconnect timer
- CPeriodic* iReconnect;
-
- TBool iSessionError;
-
-#ifdef _DEBUG
- TUint32 iAddCounter;
- TUint32 iModCounter;
-#endif
-};
-
-#endif // THUMBAGDAEMON_H
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/thumbagdaemon/inc/thumbagprocessor.h
--- a/imagehandlingutilities/thumbnailmanager/thumbagdaemon/inc/thumbagprocessor.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,482 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Processor
- *
-*/
-
-
-#ifndef THUMBAGPROCESSOR_H
-#define THUMBAGPROCESSOR_H
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include "thumbnaillog.h"
-#include
-#include
-#include
-#include "tmactivitymanager.h"
-#include "tmformatobserver.h"
-#include "tmrpropertyobserver.h"
-#include "thumbnailmanagerconstants.h"
-
-//FORWARD DECLARATIONS
-class MMPXCollectionUtility;
-
-
-enum TThumbnailGenerationItemType
- {
- EGenerationItemTypeUnknown,
- EGenerationItemTypeNotFound,
- EGenerationItemTypeCamera,
- EGenerationItemTypeAny,
- EGenerationItemTypeAudio,
- EGenerationItemTypeVideo,
- EGenerationItemTypeImage,
- EGenerationItemTypeItemCount
- };
-
- enum TThumbnailGenerationItemAction
- {
- EGenerationItemActionAdd,
- EGenerationItemActionDelete,
- EGenerationItemActionModify,
- EGenerationItemAction2ndAdd,
- EGenerationItemActionResolveType,
- EGenerationItemActionCount
- };
-
- struct TThumbnailGenerationItem
- {
- inline TThumbnailGenerationItem(): iItemId( KErrNotFound ), iItemType(EGenerationItemTypeUnknown),
- iItemAction(EGenerationItemActionAdd), iPlaceholder(EFalse), iUri(NULL){}
- inline ~TThumbnailGenerationItem(){delete iUri; iUri = NULL;}
-
- TItemId iItemId;
- TThumbnailGenerationItemType iItemType;
- TThumbnailGenerationItemAction iItemAction;
- TBool iPlaceholder;
- HBufC* iUri;
- };
-
-/**
- * Processor object for handling thumb generation
- *
- * @since S60 v5.0
- */
-class CThumbAGProcessor: public CActive,
- public MThumbnailManagerObserver,
- public MThumbnailManagerRequestObserver,
- public MMdEQueryObserver,
- public MHarvesterEventObserver,
- public MMPXCollectionObserver,
- public MTMActivityManagerObserver,
- public MTMFormatObserver,
- public MTMRPropertyObserver
- {
-public:
-
- /**
- * Two-phased constructor.
- *
- * @since S60 v5.0
- * @return Instance of CThumbAGProcessor.
- */
- static CThumbAGProcessor* NewL();
-
- /**
- * Destructor
- *
- * @since S60 v5.0
- */
- virtual ~CThumbAGProcessor();
-
-public:
-
- // From MMdEQueryObserver
- void HandleQueryNewResults( CMdEQuery& aQuery,
- TInt aFirstNewItemIndex,
- TInt aNewItemCount );
- void HandleQueryCompleted( CMdEQuery& aQuery, TInt aError );
-
- // from MThumbnailManagerObserver
- void ThumbnailPreviewReady( MThumbnailData& aThumbnail, TThumbnailRequestId aId );
- void ThumbnailReady( TInt aError, MThumbnailData& aThumbnail, TThumbnailRequestId aId );
- // from MThumbnailManagerRequestObserver
- void ThumbnailRequestReady( TInt aError, TThumbnailRequestType aRequestType, TThumbnailRequestId aId );
-
- // from MHarvesterEventObserver
- void HarvestingUpdated(
- HarvesterEventObserverType aHEObserverType,
- HarvesterEventState aHarvesterEventState,
- TInt aItemsLeft );
-
- //From MTMFormatObserver
- void FormatNotification(TBool aFormat);
-
-private:
- // From MMPXCollectionObserver
- /// See @ref MMPXCollectionObserver::HandleCollectionMessageL
- void HandleCollectionMessage( CMPXMessage* aMessage, TInt aError );
-
- /// See @ref MMPXCollectionObserver::HandleOpenL
- void HandleOpenL(const CMPXMedia& aEntries, TInt aIndex, TBool aComplete, TInt aError);
-
- /// See @ref MMPXCollectionObserver::HandleOpenL
- void HandleOpenL(const CMPXCollectionPlaylist& aPlaylist, TInt aError);
-
- /// See @ref MMPXCollectionObserver::HandleCollectionMediaL
- void HandleCollectionMediaL( const CMPXMedia& aMedia, TInt aError );
-
-private: //From MTMActivityManagerObserver
- void ActivityChanged(const TBool aActive);
-
-private: //From MTMRPropertyObserver
- void RPropertyNotification(const TInt aError, const TUid aKeyCategory, const TUint aPropertyKey, const TInt aValue);
-
-public:
-
- /**
- * Sets MdE Session
- *
- * @since S60 v5.0
- * @param aMdESession MdE Session
- */
- void SetMdESessionL( CMdESession* aMdESession );
-
- /**
- * Adds new IDs to queue
- *
- * @since S60 v5.0
- * @param aType TObserverNotificationType
- * @param TThumbnailGenerationItemType
- * @param aIDArray IDs for thumbnail creation
- * @param aForce pass ETrue if processor is forced to run without waiting harvesting complete
- */
- void AddToQueueL( TObserverNotificationType aType, TThumbnailGenerationItemType aItemType,
- const RArray& aIDArray, const RPointerArray& aObjectUriArray,
- TBool aPresent );
-
- /**
- * Calls Thumbnail Manager to create thumbnails
- *
- * @since S60 v5.0
- * @param aObject MdEObject
- */
- void CreateThumbnailsL( const CMdEObject* aObject );
-
- /**
- * Remove IDs from queue
- *
- * @since S60 v5.0
- * @param aIDArray IDs for thumbnail creation
- */
- void RemoveFromQueues( const RArray& aIDArray, const TBool aRemoveFromDelete = EFalse);
-
- void SetForceRun( const TBool aForceRun );
-
- //prepare processor for shutdown
- void Shutdown();
-
-protected:
-
- void QueryAllItemsL();
-
- /**
- * QueryL
- *
- * @since S60 v5.0
- * @param TThumbnailGenerationItemAction
- */
- void QueryL( TThumbnailGenerationItemAction aType);
-
- /**
- * QueryPlaceholdersL
- *
- * @since S60 v5.0
- * @param aPresent item should not be present item
- */
- void QueryPlaceholdersL(const TBool aPresent);
-
- /**
- * DeleteAndCancelQuery
- *
- * @since Symbian^3
- * @param aRemoveItems restore IDs back to original queue, default = ETrue
- */
- void DeleteAndCancelQuery(TBool aRestoreItems);
-
-protected:
-
- /**
- * Handles an active object's request completion event.
- *
- * @since S60 v5.0
- */
- void RunL();
-
- /**
- * Implements cancellation of an outstanding request.
- *
- * @since S60 v5.0
- */
- void DoCancel();
-
- /**
- * Implements RunL error handling.
- *
- * @since S60 v5.0
- */
- TInt RunError(TInt aError);
-
-private:
-
- /**
- * C++ default constructor
- *
- * @since S60 v5.0
- * @return Instance of CThumbAGProcessor.
- */
- CThumbAGProcessor();
-
- /**
- * Symbian 2nd phase constructor can leave.
- *
- * @since S60 v5.0
- */
- void ConstructL();
-
- /**
- * Activate AO
- *
- * @since S60 v5.0
- */
- void ActivateAO();
-
- /**
- * Callback for harvesting complete timer
- *
- * @since S60 v5.0
- */
- static TInt PeriodicTimerCallBack(TAny* aAny);
-
- /**
- * Check auto creation values from cenrep
- *
- * @since S60 v5.0
- */
- void CheckAutoCreateValuesL();
-
- /**
- * Start timeout timer
- *
- * @since S60 v5.0
- */
- void StartTimeout();
-
- /**
- * Cancel timeout timer
- *
- * @since S60 v5.0
- */
- void CancelTimeout();
-
- /**
- * Update KItemsLeft PS value
- *
- * @since S60 v5.0
- * @param aDefine (re)define PS key before setting value
- */
- void UpdatePSValues(const TBool aDefine, const TBool aForce);
-
- /**
- * Comparison function for logaritmic use of queue arrays
- *
- * @since S60 S^3
- */
- static TInt Compare(const TThumbnailGenerationItem& aLeft, const TThumbnailGenerationItem& aRight);
-
- /**
- * Comparison function for logaritmic use of queue arrays
- *
- * @since S60 S^3
- */
- static TInt CompareId(const TItemId& aLeft, const TItemId& aRight);
-
- /**
- * Recalculate item counts
- *
- * @since S60 S^3
- */
- void UpdateItemCounts();
-
- /**
- * Callback for mount timeout
- *
- * @since S60 v5.0
- */
- static TInt MountTimerCallBack(TAny* aAny);
-
- /**
- * Set item's action from type
- *
- * @since S^3
- */
- void SetGenerationItemAction( TThumbnailGenerationItem& aGenerationItem, const TThumbnailGenerationItemType aItemType );
-
- /**
- * Set item type property from TDedIf
- * @param aGenerationItem TThumbnailGenerationItem
- * @param aItemType TThumbnailGenerationItemType
- * @since S^3
- */
- void SetGenerationItemType( TThumbnailGenerationItem& aGenerationItem, const TDefId aDefId );
-
- /**
- * Append item to processing queue or update existing
- * @param aGenerationItem modified TThumbnailGenerationItem
- * @param aDefId items MDS object definition ID
- * @since S^3
- */
- void AppendProcessingQueue(TThumbnailGenerationItem& item );
-
-private:
-
- // not own
- CMdESession* iMdESession;
- CMdENamespaceDef* iDefNamespace;
-
- // own
- CThumbnailManager* iTMSession;
- CMdEObjectQuery* iQuery;
- CMdEObjectQuery* iQueryAllItems;
- CMdEObjectQuery* iQueryPlaceholders;
-
- RArray iGenerationQueue;
- //RPointerArray iRemoveQueue;
- RArray iQueryQueue;
-
- //background generation state
- // EFalse = 1st round, create only grid size thumbnail for images and videos
- // ETrue = 2nds round, create all missing sizes for all media items
- TBool i2ndRound;
-
- // query state
- // EFalse = normal mode
- // ETrue = querying unknown items
- TBool iUnknown;
-
- //MDS query issues
- TBool iQueryActive;
- //MDS query complete
- TBool iQueryReady;
-
- //Processing MDS itens which are modified
- TBool iModify;
- TUint iProcessingCount;
-
- //MDS harvester's overall state
- TBool iHarvesting;
- TBool iHarvestingTemp;
-
- //MDS Harvester's placeholder harvesting state
- TBool iPHHarvesting;
- TBool iPHHarvestingTemp;
-
- //MDS Harvester's SD card harvesting state
- TBool iMMCHarvesting;
- TBool iMMCHarvestingTemp;
-
- CPeriodic* iPeriodicTimer;
- CPeriodic* iMountTimer;
-
- //MDS Harvester client
- RHarvesterClient iHarvesterClient;
-
- //Set when running RunL() first time
- TBool iInit;
-
- //2nd phase init after MDE session is open
- TBool iInit2;
-
- // auto create values from centrep
- TBool iAutoImage;
- TBool iAutoVideo;
- TBool iAutoAudio;
-
- // in case of modified files force TN update
- TBool iForceRun;
- // controlled by Photos application to run TN generation on foreground
- TBool iForegroundRun;
- //request pending in TNM side
-
- CTMFormatObserver* iFormatObserver;
-
- //formating started
- TBool iFormatting;
- //TNM server session died
- TBool iSessionDied;
-
- //pending request count
- TUint iActiveCount;
-
- MMPXCollectionUtility* iCollectionUtility; // own
-
- //Flag is MPX harvesting or MTP synchronisation in progress
- TBool iMPXHarvesting;
-
- //overall status of device
- TBool iIdle;
-
- //monitors device activity
- CTMActivityManager* iActivityManager;
-
- //Observer foreground generation
- CTMRPropertyObserver* iForegroundGenerationObserver;
-
- //Previously notified amount of items in processing queues (add/modify)
- TInt iPreviousItemsLeft;
- TBool iPreviousDaemonProcessing;
- //set ETrue when QueryAllItems needs to be run after placeholder query
- TBool iDoQueryAllItems;
-
- TBool iShutdown;
-
- //item counts
- TUint32 iModifyItemCount;
- TUint32 iImageItemCount;
- TUint32 iVideoItemCount;
- TUint32 iAudioItemCount;
- TUint32 iDeleteItemCount;
- TUint32 iAddItemCount;
- TUint32 iCameraItemCount;
- TUint32 iUnknownItemCount;
- TUint32 i2ndAddItemCount;
- TUint32 iPlaceholderItemCount;
-
- //for book keeping previous items left count got from MDS harvester
- TUint32 iMMCHarvestingItemsLeftTemp;
- TUint32 iPHHarvestingItemsLeftTemp;
-
- //MdE object definitons used in query
- CMdEObjectDef* iImageObjectDef;
- CMdEObjectDef* iVideoObjectDef;
- CMdEObjectDef* iAudioObjectDef;
- TBool iHarvesterActivated;
- };
-
-#endif // THUMBAGPROCESSOR_H
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/thumbagdaemon/inc/thumbagvideoobserver.h
--- a/imagehandlingutilities/thumbnailmanager/thumbagdaemon/inc/thumbagvideoobserver.h Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,145 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Thumbnail Auto Generate Daemon
- *
-*/
-
-
-#ifndef THUMBAGVIDEOBSERVER_H
-#define THUMBAGVIDEOBSERVER_H
-
-#include
-#include
-
-#include
-
-#include "thumbagprocessor.h"
-#include "thumbnaillog.h"
-#include "tmshutdownobserver.h"
-
-
-/**
- * ThumbAG daemon.
- *
- * @since S60 v5.0
- */
-NONSHARABLE_CLASS( CThumbAGVideoObserver ): public CBase,
- public MMdESessionObserver,
- public MMdEObjectObserver,
- public MTMShutdownObserver
- {
-public:
-
- /**
- * Two-phased constructor
- *
- * @since S60 v5.0
- * @return New CThumbAGVideoObserver server.
- */
- static CThumbAGVideoObserver* NewLC(CThumbAGProcessor* aProcessor);
-
- /**
- * Two-phased constructor
- *
- * @since S60 v5.0
- * @return New CThumbAGVideoObserver server.
- */
- static CThumbAGVideoObserver* NewL(CThumbAGProcessor* aProcessor);
-
- /**
- * Destructor
- *
- * @since S60 v5.0
- */
- virtual ~CThumbAGVideoObserver();
-
-
-public:
-
- // from MMdESessionObserver
- void HandleSessionOpened( CMdESession& aSession, TInt aError );
- void HandleSessionError( CMdESession& aSession, TInt aError );
-
- // from MMdEObjectObserver
- void HandleObjectNotification(CMdESession& aSession,
- TObserverNotificationType aType,
- const RArray& aObjectIdArray);
-
- // from MTMShutdownObserver
- void ShutdownNotification();
-
-protected:
-
- /**
- * AddObserversL
- *
- * @since S60 v5.0
- */
- void AddObserversL();
-
-
-private:
-
- /**
- * C++ default constructor
- *
- * @since S60 v5.0
- * @return New CThumbAGVideoObserver instance.
- */
- CThumbAGVideoObserver(CThumbAGProcessor* aProcessor);
-
- /**
- * Symbian 2nd phase constructor can leave.
- *
- * @since S60 v5.0
- */
- void ConstructL();
-
- /**
- * Initilization helper
- *
- * @since S60 v5.2
- */
- void InitializeL();
-
- /**
- * Callback for reconnect timer
- *
- * @since S60 v5.0
- */
- static TInt ReconnectCallBack(TAny* aAny);
-
-private:
-
- // own
- CTMShutdownObserver* iShutdownObserver;
- CTMShutdownObserver* iMDSShutdownObserver;
- CMdESession* iMdESession;
- //not owned
- CThumbAGProcessor* iProcessor;
-
- TBool iShutdown;
-
- // reconnect timer
- CPeriodic* iReconnect;
-
- TBool iSessionError;
-
-#ifdef _DEBUG
- TUint32 iAddCounter;
- TUint32 iModCounter;
-#endif
-};
-
-#endif // THUMBAGDAEMON_H
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagaudioobserver.cpp
--- a/imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagaudioobserver.cpp Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,380 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Thumbnail Auto Generate Daemon
-*
-*/
-
-
-#include
-#include
-
-#include
-#include
-#include
-#include
-
-#include "thumbagaudioobserver.h"
-#include "thumbnaillog.h"
-#include "thumbnailmanagerconstants.h"
-#include "thumbnailmanagerprivatecrkeys.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "thumbagaudioobserverTraces.h"
-#endif
-
-
-// ---------------------------------------------------------------------------
-// NewLC
-// ---------------------------------------------------------------------------
-//
-CThumbAGAudioObserver* CThumbAGAudioObserver::NewLC(CThumbAGProcessor* aProcessor)
- {
- TN_DEBUG1( "CThumbAGAudioObserver::NewLC() - begin" );
- OstTrace0( TRACE_FATAL, CTHUMBAGAUDIOOBSERVER_NEWLC, "CThumbAGAudioObserver::NewLC" );
-
- CThumbAGAudioObserver* self = new (ELeave) CThumbAGAudioObserver(aProcessor);
- CleanupStack::PushL( self );
- self->ConstructL();
- return self;
- }
-
-// ---------------------------------------------------------------------------
-// NewL
-// ---------------------------------------------------------------------------
-//
-CThumbAGAudioObserver* CThumbAGAudioObserver::NewL(CThumbAGProcessor* aProcessor)
- {
- TN_DEBUG1( "CThumbAGAudioObserver::NewL() - begin" );
-
- CThumbAGAudioObserver* self = CThumbAGAudioObserver::NewLC(aProcessor);
- CleanupStack::Pop( self );
- return self;
- }
-
-// ---------------------------------------------------------------------------
-// CThumbAGAudioObserver
-// ---------------------------------------------------------------------------
-//
-CThumbAGAudioObserver::CThumbAGAudioObserver(CThumbAGProcessor* aProcessor)
- : iShutdownObserver(NULL), iMDSShutdownObserver(NULL), iMdESession(NULL), iProcessor(aProcessor)
- {
- // No implementation required
- }
-
-// ---------------------------------------------------------------------------
-// ConstructL
-// ---------------------------------------------------------------------------
-//
-void CThumbAGAudioObserver::ConstructL()
- {
- TN_DEBUG1( "CThumbAGAudioObserver::ConstructL() - begin" );
- OstTrace0( TRACE_FATAL, CTHUMBAGAUDIOOBSERVER_CONSTRUCTL, "CThumbAGAudioObserver::ConstructL - begin" );
-
-#ifdef _DEBUG
- iAddCounter = 0;
- iModCounter = 0;
-#endif
-
- InitializeL();
-
- TN_DEBUG1( "CThumbAGAudioObserver::ConstructL() - end" );
- OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGAUDIOOBSERVER_CONSTRUCTL, "CThumbAGAudioObserver::ConstructL - end" );
- }
-
-// ---------------------------------------------------------------------------
-// ~CThumbAGAudioObserver
-// ---------------------------------------------------------------------------
-//
-void CThumbAGAudioObserver::InitializeL()
- {
- TN_DEBUG1( "CThumbAGAudioObserver::InitializeL() - begin" );
- OstTrace0( TRACE_FATAL, CTHUMBAGAUDIOOBSERVER_INITIALIZEL, "CThumbAGAudioObserver::InitializeL - begin" );
-
- TN_DEBUG1( "CThumbAGAudioObserver::InitializeL() - create observers" );
- OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGAUDIOOBSERVER_INITIALIZEL, "CThumbAGAudioObserver::InitializeL - create observers" );
-
- // create shutdown observer
- if(iMDSShutdownObserver)
- {
- delete iMDSShutdownObserver;
- iMDSShutdownObserver = NULL;
- }
- iMDSShutdownObserver = CTMShutdownObserver::NewL( *this, KMdSPSShutdown, KMdSShutdown, EFalse );
-
- if(iShutdownObserver)
- {
- delete iShutdownObserver;
- iShutdownObserver = NULL;
- }
- iShutdownObserver = CTMShutdownObserver::NewL( *this, KTAGDPSNotification, KShutdown, ETrue );
- iShutdown = EFalse;
-
- // MDS session reconnect timer
- if (!iReconnect)
- {
- iReconnect = CPeriodic::NewL(CActive::EPriorityIdle);
- }
-
- TN_DEBUG1( "CThumbAGAudioObserver::InitializeL() - connect to MDS" );
- OstTrace0( TRACE_FATAL, DUP2_CTHUMBAGAUDIOOBSERVER_INITIALIZEL, "CThumbAGAudioObserver::InitializeL - connect to MDS" );
-
- if(iMdESession)
- {
- TRAP_IGNORE( iMdESession->RemoveObjectObserverL( *this ) );
- TRAP_IGNORE( iMdESession->RemoveObjectObserverL( *this ) );
-
- // connect to MDS
- delete iMdESession;
- iMdESession = NULL;
- }
-
- iMdESession = CMdESession::NewL( *this );
- iSessionError = EFalse;
-
- TN_DEBUG1( "CThumbAGAudioObserver::InitializeL() - end" );
- OstTrace0( TRACE_FATAL, DUP3_CTHUMBAGAUDIOOBSERVER_INITIALIZEL, "CThumbAGAudioObserver::InitializeL - end" );
- }
-
-// ---------------------------------------------------------------------------
-// ~CThumbAGAudioObserver
-// ---------------------------------------------------------------------------
-//
-CThumbAGAudioObserver::~CThumbAGAudioObserver()
- {
- TN_DEBUG1( "CThumbAGAudioObserver::~CThumbAGAudioObserver() - begin" );
- OstTrace0( TRACE_FATAL, CTHUMBAGAUDIOOBSERVER_CTHUMBAGAUDIOOBSERVER, "CThumbAGAudioObserver::~CThumbAGAudioObserver - begin" );
-
- iShutdown = ETrue;
-
- Shutdown();
-
- TN_DEBUG1( "CThumbAGAudioObserver::~CThumbAGAudioObserver() - end" );
- OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGAUDIOOBSERVER_CTHUMBAGAUDIOOBSERVER, "CThumbAGAudioObserver::~CThumbAGAudioObserver - end" );
- }
-
-void CThumbAGAudioObserver::Shutdown()
- {
- TN_DEBUG1( "CThumbAGAudioObserver::Shutdown()" );
- OstTrace0( TRACE_FATAL, CTHUMBAGAUDIOOBSERVER_SHUTDOWN, "CThumbAGAudioObserver::Shutdown" );
-
- delete iMDSShutdownObserver;
- iMDSShutdownObserver = NULL;
- delete iShutdownObserver;
- iShutdownObserver = NULL;
-
- if(iReconnect)
- {
- iReconnect->Cancel();
- delete iReconnect;
- iReconnect = NULL;
- }
-
- if (iMdESession)
- {
- // 2 observers
- TRAP_IGNORE( iMdESession->RemoveObjectObserverL( *this ) );
- TRAP_IGNORE( iMdESession->RemoveObjectObserverL( *this ) );
-
- delete iMdESession;
- iMdESession = NULL;
- }
- }
-
-// -----------------------------------------------------------------------------
-// CThumbAGAudioObserver::HandleSessionOpened
-// -----------------------------------------------------------------------------
-//
-void CThumbAGAudioObserver::HandleSessionOpened( CMdESession& /* aSession */, TInt aError )
- {
- TN_DEBUG1( "CThumbAGAudioObserver::HandleSessionOpened");
- OstTrace0( TRACE_FATAL, CTHUMBAGAUDIOOBSERVER_HANDLESESSIONOPENED, "CThumbAGAudioObserver::HandleSessionOpened" );
-
- if (aError == KErrNone)
- {
- TRAPD( err, AddObserversL() );
- if (err != KErrNone)
- {
- TN_DEBUG2( "CThumbAGAudioObserver::HandleSessionOpened, AddObserversL error == %d", err );
- OstTrace1( TRACE_FATAL, DUP1_CTHUMBAGAUDIOOBSERVER_HANDLESESSIONOPENED, "CThumbAGAudioObserver::HandleSessionOpened;err=%d", err );
- }
- }
- else
- {
- TN_DEBUG2( "CThumbAGAudioObserver::HandleSessionOpened error == %d", aError );
- OstTrace1( TRACE_FATAL, DUP2_CTHUMBAGAUDIOOBSERVER_HANDLESESSIONOPENED, "CThumbAGAudioObserver::HandleSessionOpened;aError=%d", aError );
- }
- }
-
-// -----------------------------------------------------------------------------
-// CThumbAGAudioObserver::HandleSessionError
-// -----------------------------------------------------------------------------
-//
-void CThumbAGAudioObserver::HandleSessionError( CMdESession& /*aSession*/, TInt aError )
- {
- TN_DEBUG2( "CThumbAGAudioObserver::HandleSessionError == %d", aError );
- OstTrace1( TRACE_FATAL, CTHUMBAGAUDIOOBSERVER_HANDLESESSIONERROR, "CThumbAGAudioObserver::HandleSessionError;aError=%d", aError );
- if (aError != KErrNone && !iSessionError)
- {
- iSessionError = ETrue;
-
- if (!iShutdown)
- {
- if (!iReconnect->IsActive())
- {
- iReconnect->Start( KMdEReconnect, KMdEReconnect,
- TCallBack(ReconnectCallBack, this));
-
- TN_DEBUG1( "CThumbAGAudioObserver::HandleSessionError() - reconnect timer started" );
- OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGAUDIOOBSERVER_HANDLESESSIONERROR, "CThumbAGAudioObserver::HandleSessionError - reconnect timer started" );
- }
- }
-
- }
- }
-
-// -----------------------------------------------------------------------------
-// CThumbAGAudioObserver::HandleObjectNotification
-// -----------------------------------------------------------------------------
-//
-void CThumbAGAudioObserver::HandleObjectNotification( CMdESession& /*aSession*/,
- TObserverNotificationType aType,
- const RArray& aObjectIdArray )
- {
- TN_DEBUG1( "CThumbAGAudioObserver::HandleObjectNotification() - begin" );
- OstTrace0( TRACE_FATAL, CTHUMBAGAUDIOOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGAudioObserver::HandleObjectNotification - begin" );
-
- // no processor or shutting down
- if ( iShutdown || !iProcessor)
- {
- return;
- }
-
-#ifdef _DEBUG
- if (aType == ENotifyAdd)
- {
- TN_DEBUG2( "CThumbAGAudioObserver::HandleObjectNotification() - ENotifyAdd %d", aObjectIdArray.Count() );
- OstTrace1( TRACE_FATAL, DUP1_CTHUMBAGAUDIOOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGAudioObserver::HandleObjectNotification - ENotifyAdd;aObjectIdArray.Count()=%d", aObjectIdArray.Count() );
- iAddCounter = aObjectIdArray.Count();
- }
- else if (aType == ENotifyModify)
- {
- TN_DEBUG2( "CThumbAGAudioObserver::HandleObjectNotification() - ENotifyModify %d", aObjectIdArray.Count() );
- OstTrace1( TRACE_FATAL, DUP2_CTHUMBAGAUDIOOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGAudioObserver::HandleObjectNotification - ENotifyModify;aObjectIdArray.Count()=%d", aObjectIdArray.Count() );
- iModCounter = aObjectIdArray.Count();
- }
-#endif
-
- if ( (aType == ENotifyAdd || aType == ENotifyModify ) && (aObjectIdArray.Count() > 0) )
- {
- TN_DEBUG1( "CThumbAGAudioObserver::HandleObjectNotification() - AddToQueueL" );
- OstTrace0( TRACE_FATAL, DUP3_CTHUMBAGAUDIOOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGAudioObserver::HandleObjectNotification - AddToQueueL" );
-
- // Add event to processing queue by type and enable force run
- RPointerArray dummyArray;
- TRAPD(err, iProcessor->AddToQueueL(aType, EGenerationItemTypeAudio, aObjectIdArray, dummyArray, EFalse));
- if (err != KErrNone)
- {
- TN_DEBUG1( "CThumbAGAudioObserver::HandleObjectNotification() - error adding to queue" );
- OstTrace0( TRACE_FATAL, DUP4_CTHUMBAGAUDIOOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGAudioObserver::HandleObjectNotification - error adding to queue" );
- }
- }
- else
- {
- TN_DEBUG1( "CThumbAGAudioObserver::HandleObjectNotification() - bad notification" );
- OstTrace0( TRACE_FATAL, DUP5_CTHUMBAGAUDIOOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGAudioObserver::HandleObjectNotification - bad notification" );
- }
-
-#ifdef _DEBUG
- TN_DEBUG3( "CThumbAGAudioObserver::IN-COUNTERS---------- Add = %d Modify = %d", iAddCounter, iModCounter );
- OstTraceExt2( TRACE_FATAL, DUP6_CTHUMBAGAUDIOOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGAudioObserver::HandleObjectNotification;iAddCounter=%u;iModCounter=%u", iAddCounter, iModCounter );
- iModCounter = 0;
- iAddCounter = 0;
-#endif
-
- TN_DEBUG1( "CThumbAGAudioObserver::HandleObjectNotification() - end" );
- OstTrace0( TRACE_FATAL, DUP7_CTHUMBAGAUDIOOBSERVER_HANDLEOBJECTNOTIFICATION, "CThumbAGAudioObserver::HandleObjectNotification - end" );
- }
-
-// -----------------------------------------------------------------------------
-// CThumbAGAudioObserver::ShutdownNotification
-// -----------------------------------------------------------------------------
-//
-void CThumbAGAudioObserver::ShutdownNotification()
- {
- TN_DEBUG1( "CThumbAGAudioObserver::ShutdownNotification()" );
- OstTrace0( TRACE_FATAL, CTHUMBAGAUDIOOBSERVER_SHUTDOWNNOTIFICATION, "CThumbAGAudioObserver::ShutdownNotification" );
-
- if (!iShutdown)
- {
- TN_DEBUG1( "CThumbAGAudioObserver::ShutdownNotification() shutdown" );
- OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGAUDIOOBSERVER_SHUTDOWNNOTIFICATION, "CThumbAGAudioObserver::ShutdownNotification - shutdown" );
- iShutdown = ETrue;
- }
- }
-
-// ---------------------------------------------------------------------------
-// CThumbAGAudioObserver::AddObserversL
-// ---------------------------------------------------------------------------
-//
-void CThumbAGAudioObserver::AddObserversL()
- {
- TN_DEBUG1( "CThumbAGAudioObserver::AddObserversL() - begin" );
- OstTrace0( TRACE_FATAL, CTHUMBAGAUDIOOBSERVER_ADDOBSERVERSL, "CThumbAGAudioObserver::AddObserversL - begin" );
-
- CMdENamespaceDef& defaultNamespace = iMdESession->GetDefaultNamespaceDefL();
- CMdEObjectDef& audioDef = defaultNamespace.GetObjectDefL( MdeConstants::Audio::KAudioObject );
-
- // set observing conditions
- CMdELogicCondition* addCondition = CMdELogicCondition::NewLC( ELogicConditionOperatorAnd );
- addCondition->AddObjectConditionL( audioDef );
-
- CMdELogicCondition* modifyCondition = CMdELogicCondition::NewLC( ELogicConditionOperatorAnd );
- modifyCondition->AddObjectConditionL( audioDef );
-
- // add observer
- iMdESession->AddObjectObserverL( *this, addCondition, ENotifyAdd );
-
- // modify observer
- iMdESession->AddObjectObserverL( *this, modifyCondition, ENotifyModify );
-
- CleanupStack::Pop( 2, addCondition );
-
- TN_DEBUG1( "CThumbAGAudioObserver::AddObserversL() - end" );
- OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGAUDIOOBSERVER_ADDOBSERVERSL, "CThumbAGAudioObserver::AddObserversL - end" );
- }
-
-// ---------------------------------------------------------------------------
-// CThumbAGAudioObserver::ReconnectCallBack()
-// ---------------------------------------------------------------------------
-//
-TInt CThumbAGAudioObserver::ReconnectCallBack(TAny* aAny)
- {
- TN_DEBUG1( "CThumbAGAudioObserver::ReconnectCallBack() - reinitialize");
- OstTrace0( TRACE_FATAL, CTHUMBAGAUDIOOBSERVER_RECONNECTCALLBACK, "CThumbAGAudioObserver::ReconnectCallBack - reinitialize" );
-
- CThumbAGAudioObserver* self = static_cast( aAny );
-
- self->iReconnect->Cancel();
-
- // reconnect to MDS
- TRAP_IGNORE( self->InitializeL() );
-
- TN_DEBUG1( "CThumbAGAudioObserver::ReconnectCallBack() - done");
- OstTrace0( TRACE_FATAL, DUP1_CTHUMBAGAUDIOOBSERVER_RECONNECTCALLBACK, "CThumbAGAudioObserver::ReconnectCallBack - done" );
-
- return KErrNone;
- }
-
-
-// End of file
diff -r 2e2a89493e2b -r 48dd0f169f0d imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagcameraobserver.cpp
--- a/imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagcameraobserver.cpp Fri Sep 03 10:29:37 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,376 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Thumbnail Auto Generate Daemon
-*
-*/
-
-
-#include
-#include
-
-#include
-#include
-#include