browsercore/appfw/ThumbnailEngine/TnEngineScaler.h
changeset 5 0f2326c2a325
parent 1 b0dd75e285d2
child 6 1c3b8676e58c
equal deleted inserted replaced
1:b0dd75e285d2 5:0f2326c2a325
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "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 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __TNENGINESCALER_H__
       
    20 #define __TNENGINESCALER_H__
       
    21 
       
    22 
       
    23 #include <QObject>
       
    24 #include <QPixmap>
       
    25 
       
    26 namespace WRT {
       
    27 
       
    28 class MTnEngineScalerCallback : public QObject
       
    29 {
       
    30 public:
       
    31     virtual void scalingCompleted(QPixmap& result, const QRect& targetRect) = 0;
       
    32 };
       
    33 
       
    34 
       
    35 class TnEngineScaler : public QObject
       
    36 {
       
    37 Q_OBJECT
       
    38 public:
       
    39     static TnEngineScaler* initWithCallback(MTnEngineScalerCallback& callback);
       
    40     virtual ~TnEngineScaler();
       
    41 
       
    42 public: // New functions
       
    43     void startScaling(QPixmap& source, const QRect& targetRect);
       
    44     bool isActive();
       
    45 
       
    46 public slots:
       
    47     void run();
       
    48 
       
    49 public:
       
    50     void cancel();
       
    51 
       
    52 private:
       
    53     TnEngineScaler(MTnEngineScalerCallback& callback);
       
    54     void init();
       
    55     void deleteResultBitmap();
       
    56 
       
    57 private:    // Data
       
    58     MTnEngineScalerCallback* m_callback;
       
    59     QPixmap* m_resultBitmap;
       
    60     QRect m_targetRect;
       
    61     QTimer* m_scalingTimer;
       
    62 };
       
    63 
       
    64 }
       
    65 #endif // __TNENGINESCALER_H__
       
    66 
       
    67 // End of File