imaging/imagingfws/BitmapTransform/src/BitmapRotationBody.cpp
changeset 0 5752a19fdefe
equal deleted inserted replaced
-1:000000000000 0:5752a19fdefe
       
     1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // BitmapRotation.cpp
       
    15 // 
       
    16 //
       
    17 
       
    18 #include "BitmapTransformsBody.h"
       
    19 #include "BitmapTransformsMain.h"
       
    20 #include <bitmtrans/bitmtransplugin.h>
       
    21 #include <bitmtrans/bitmtransuids.hrh>
       
    22 
       
    23 #include <ecom/ecom.h>
       
    24 #include <mm/mmpluginutils.h>
       
    25 
       
    26 /**
       
    27 The function NewL constructs a CBitmapRotatorBody
       
    28 
       
    29 @returns CBitmapRotatorBody* 
       
    30 
       
    31 
       
    32 */
       
    33 
       
    34 CBitmapRotatorBody* CBitmapRotatorBody::NewL()
       
    35 	{
       
    36 	CBitmapRotatorBody* self = new(ELeave) CBitmapRotatorBody();
       
    37 	CleanupStack::PushL(self);
       
    38 	self->ConstructL();
       
    39 	CleanupStack::Pop(self);
       
    40 	return self;
       
    41 	}
       
    42 
       
    43 /**
       
    44 Constructor for this class. 
       
    45 
       
    46 */
       
    47 
       
    48 CBitmapRotatorBody::CBitmapRotatorBody()
       
    49 	{
       
    50 	}
       
    51 
       
    52 
       
    53 /**
       
    54 Performs second phase of contruction
       
    55 *
       
    56 */
       
    57 
       
    58 void CBitmapRotatorBody::ConstructL()
       
    59 	{
       
    60 	TUid interfaceUid = {KUidBitmapRotatePlugin};
       
    61 	iPlugin = 
       
    62 		static_cast<MBitmapRotatorPlugin*>
       
    63 			(MmPluginUtils::CreateImplementationL(interfaceUid, iDestructorKey, KBitmTransPluginMatchString, KRomOnlyResolverUid));
       
    64 	}
       
    65 
       
    66 /**
       
    67 *
       
    68 * Default destructor for this class.
       
    69 *
       
    70 */
       
    71 
       
    72 CBitmapRotatorBody::~CBitmapRotatorBody()
       
    73 	{
       
    74 	delete iPlugin;
       
    75 	REComSession::DestroyedImplementation(iDestructorKey);
       
    76 	REComSession::FinalClose();
       
    77 	}
       
    78 
       
    79 
       
    80 /**
       
    81 The Rotate function schedules a rotate/mirror operation on a bitmap supplied in the srcBitmap and 
       
    82 produces the output in the tgtBitmap.
       
    83 The CBitmapRotatorBody is an active object and as such provides asynchronous operations
       
    84 
       
    85 Preconditions:
       
    86 aRequestStatus is not a NULL pointer
       
    87 aSrcBitmap     is a fully constructed bitmap of unknown size including zero dimension
       
    88 aTgtBitmap     is a fully constructed bitmap of unknown size including zero dimension
       
    89 aAngle         is a member of the enumeration TRotationAngle 
       
    90 
       
    91 Sucess Guarantee:
       
    92 aTgtBitmap      contains the rotated bitmap
       
    93 aRequestStatus  points to the value KErrNone
       
    94 
       
    95 Minimal Guarantee:
       
    96 The bitmap supplied in aSrcBitmap is unaltered
       
    97 
       
    98 
       
    99 @param "TRequestStatus* aRequestStatus"
       
   100        a pointer to the completion status of the asynchronous operation.
       
   101 @param "CFbsBitmap& aSrcBitmap"
       
   102        This bitmap should have been created
       
   103 @param "CFbsBitmap& aTgtBitmap"
       
   104        This bitmap should have been created
       
   105 @param "TRotationAngle aAngle" 
       
   106        is a member of the enumeration TRotationAngle and specifies the rotation mirror operation
       
   107 
       
   108 
       
   109 @panic This function panics with TBitmapTransformsMain::ENoSourceBitmap when the aSrcBitmap has not been constructed
       
   110        i.e. its handle is zero
       
   111 
       
   112 
       
   113 */
       
   114 
       
   115 void CBitmapRotatorBody::Rotate(TRequestStatus* aRequestStatus, CFbsBitmap& aSrcBitmap, CFbsBitmap& aTgtBitmap, TRotationAngle aAngle)
       
   116 	{
       
   117 	iPlugin->Rotate(aRequestStatus, aSrcBitmap, aTgtBitmap, aAngle);
       
   118 	}
       
   119 
       
   120 /*
       
   121 *
       
   122 * CustomCommand
       
   123 * @param aUid
       
   124 * @param aParam
       
   125 * @return 'TInt' an error code indicating success or failure of the 
       
   126 * command
       
   127 *
       
   128 */
       
   129 TInt CBitmapRotatorBody::CustomCommand(TUid aUid, TAny* aParam)
       
   130 	{
       
   131 	return iPlugin->CustomCommand(aUid, aParam);
       
   132 	}