activityfw/tsutils/tsrc/t_tsgraphicfilescalinghandler/inc/t_tsgraphicfilescalinghandler.h
author Jaakko Haukipuro (Nokia-MS/Oulu) <Jaakko.Haukipuro@nokia.com>
Thu, 16 Sep 2010 12:11:40 +0100
changeset 117 c63ee96dbe5f
permissions -rw-r--r--
Missing activityfw and taskswitcher components - fix for Bug 3670

//Copyright (c) 2010 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:

/////////////////////////////////////////////////////////////////////

#ifndef T_TSGRAPHICFILESCALINGHANDLER_H
#define T_TSGRAPHICFILESCALINGHANDLER_H

// INCLUDED FILES
#include <QObject>
 #include <QPixmap>
#include "tsgraphicfilescalinghandler.h"

class T_CTsGraphicFileScalingHandler :
    public QObject,
    public MImageReadyCallBack
{
    Q_OBJECT

private:
    static TInt CallStop(TAny *aWait);
    static void WaitActive(TInt aTime);

//From MImageReadyCallBack
private:
    virtual void ImageReadyCallBack(TInt error, const CFbsBitmap *bitmap);

public:
    explicit T_CTsGraphicFileScalingHandler(QObject *parent = 0);
    virtual ~T_CTsGraphicFileScalingHandler();

private slots:

// tests for file path and kind of graphic file as imput
    void testGraphicFileScalingIgnoreAspectRatio_LessWidth();
    void testGraphicFileScalingIgnoreAspectRatio_LessHeight();
    void testGraphicFileScalingIgnoreAspectRatio_TheSameRatio();
    void testGraphicFileScalingKeepAspectRatio_LessWidth();
    void testGraphicFileScalingKeepAspectRatio_LessHeight();
    void testGraphicFileScalingKeepAspectRatio_TheSameRatio();
    void testGraphicFileScalingKeepAspectRatioByExpanding_LessWidth();
    void testGraphicFileScalingKeepAspectRatioByExpanding_LessHeight();
    void testGraphicFileScalingKeepAspectRatioByExpanding_TheSameRatio();

// tests incorrect situation
    void testGraphicFileScalingInvalidImagePath();
    void testGraphicFileScalingEmptyImagePath();
    void testGraphicFileScalingEmptyMimeType();
    void testGraphicFileScalingScalingToIncorrectWidthSize();
    void testGraphicFileScalingScalingToIncorrectHeightSize();
    void testGraphicFileScalingScalingToZeroSize();
    void testDoCancel();

// tests for CFbsBitmap as imput
    void testCFbsBitmapScalingToCorrectSize();
    void testCFbsBitmapScalinToIncorrectWidthSize();
    void testCFbsBitmapScalinToIncorrectHeightSize();

private:
    RFs mFs;
    QPixmap mPixMapCallBack;
    TInt mErrorCallBack;
};

#endif // T_TSGRAPHICFILESCALINGHANDLER_H
// End of File