imageeditor/plugins/BubblePlugin/src/BubbleScaler.cpp
changeset 1 edfc90759b9f
equal deleted inserted replaced
0:57d4cdd99204 1:edfc90759b9f
       
     1 /*
       
     2 * Copyright (c) 2010 Ixonos Plc.
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - Initial contribution
       
    11 *
       
    12 * Contributors:
       
    13 * Ixonos Plc
       
    14 *
       
    15 * Description:  
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 // INCLUDES
       
    21 #include <BitmapTransforms.h>
       
    22 
       
    23 #include "BubbleScaler.h"
       
    24 #include "ImageEditorError.h"
       
    25 
       
    26 
       
    27 //=============================================================================
       
    28 CBubbleScaler::CBubbleScaler (MBubbleScalerNotifier* aNotifier)
       
    29 : CActive(0), iNotifier(aNotifier)
       
    30     {
       
    31     }
       
    32 
       
    33 //=============================================================================
       
    34 CBubbleScaler::~CBubbleScaler ()
       
    35     {
       
    36     Cancel();
       
    37     delete iBitmapScaler;
       
    38     iBitmapScaler = 0;    
       
    39     }
       
    40 
       
    41 //=============================================================================
       
    42 void CBubbleScaler::ConstructL ()
       
    43     {
       
    44     CActiveScheduler::Add(this);
       
    45     iBitmapScaler = CBitmapScaler::NewL();
       
    46     }
       
    47 
       
    48 //=============================================================================
       
    49 void CBubbleScaler::ScaleBitmapL(CFbsBitmap* aBitmap, TSize aNewSize)
       
    50     {
       
    51     iBitmapScaler->Scale(&iStatus, *aBitmap, aNewSize);
       
    52     SetActive();
       
    53     }
       
    54 
       
    55 //=============================================================================
       
    56 void CBubbleScaler::DoCancel()
       
    57     {
       
    58     if(IsActive())
       
    59         {
       
    60         iBitmapScaler->Cancel();
       
    61         }
       
    62     }
       
    63  
       
    64 //=============================================================================
       
    65 void CBubbleScaler::RunL()
       
    66     {
       
    67     if (iStatus == KErrNone)
       
    68         {
       
    69         iNotifier->BubbleScalerOperationReadyL(KErrNone); 
       
    70         }
       
    71     else
       
    72         {
       
    73         iNotifier->BubbleScalerOperationReadyL(KSIEEInternal);        
       
    74         }
       
    75     }
       
    76 
       
    77 // End of File