telutils/dialpad/tsrc/unit/shared/dialpadtestutil.h
branchRCL_3
changeset 20 987c9837762f
parent 19 7d48bed6ce0c
child 21 0a6dd2dc9970
equal deleted inserted replaced
19:7d48bed6ce0c 20:987c9837762f
     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: Dialpad test utility
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef DIALPADTESTUTIL_H
       
    19 #define DIALPADTESTUTIL_H
       
    20 
       
    21 #include <QObject>
       
    22 #include <QMap>
       
    23 #include <QGraphicsWidget>
       
    24 #include <QSwipeGesture>
       
    25 
       
    26 class HbMainWindow;
       
    27 
       
    28 class DialpadTestUtil : public QObject
       
    29 {
       
    30 
       
    31 public:
       
    32     enum MouseEventType
       
    33     {
       
    34         Press,
       
    35         Release,
       
    36         Click
       
    37     };
       
    38 
       
    39 public:
       
    40     explicit DialpadTestUtil(HbMainWindow& mainWindow, QObject* parent=0);
       
    41     ~DialpadTestUtil();
       
    42 
       
    43     void mouseClickDialpad(int key, MouseEventType type=Click, bool pause=true);
       
    44 
       
    45 private:
       
    46     QGraphicsWidget* getWidgetByName(const QString& name);
       
    47     QPointF keyPosition(QGraphicsWidget* widget, int key);
       
    48 
       
    49 private:
       
    50     QMap<int,QString> mKeyNames;
       
    51     HbMainWindow& mMainWindow;
       
    52 };
       
    53 
       
    54 #endif // DIALPADTESTUTIL_H