phoneplugins/infowidgetplugin/infowidgetprovider/tsrc/ut_infowidget/inc/ut_infowidget.h
branchGCC_SURGE
changeset 51 f39ed5e045e0
parent 40 bab96b7ed1a4
parent 46 bc5a64e5bc3c
equal deleted inserted replaced
40:bab96b7ed1a4 51:f39ed5e045e0
     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 #ifndef UT_INFOWIDGET_H
       
    19 #define UT_INFOWIDGET_H
       
    20 
       
    21 #include <QtTest/QtTest>
       
    22 #include <hblabel.h>
       
    23 #include <hbstyleoptionlabel.h>
       
    24 #include <mockservice.h>
       
    25 #include <QColor>
       
    26 #include <QGraphicsWidget>
       
    27 #include "infowidgetengine.h"
       
    28 
       
    29 class InfoWidget;
       
    30 
       
    31 class UT_InfoWidget : public QObject, public MockService
       
    32 {
       
    33     Q_OBJECT
       
    34 
       
    35 public:    
       
    36     
       
    37     UT_InfoWidget();
       
    38     ~UT_InfoWidget();
       
    39     
       
    40 private slots:
       
    41 
       
    42     void init();
       
    43     void cleanup();
       
    44     
       
    45     //From QGraphicsItem.
       
    46     void t_boundingRect();
       
    47     void t_shape();
       
    48     void t_sizePolicy();
       
    49     
       
    50     void t_setHomeZoneDisplay(); 
       
    51     void t_setMcnDisplay();
       
    52     void t_setActiveLineDisplay();
       
    53     void t_setSatDisplay();
       
    54 
       
    55     void t_paint(); 
       
    56     void t_mousePressEvent();
       
    57     void t_mouseReleaseEvent(); 
       
    58     void t_mouseMoveEvent(); 
       
    59     void t_updateInfoDisplay();
       
    60     void t_readPersistentPreferences();
       
    61 
       
    62     void t_onInitialize();
       
    63     void t_onUninitialize(); 
       
    64     void t_onShow(); 
       
    65     void t_onHide();
       
    66     void t_readModel();
       
    67     void t_handleModelError();
       
    68     void t_mcnDisplaySettingChanged();
       
    69     void t_satDisplaySettingChanged();
       
    70     void t_settingsEditingFinished();
       
    71 
       
    72     // private implementation tests
       
    73     void t_updateItemsVisibility();
       
    74     void t_layoutInfoDisplay(); 
       
    75     void t_layoutSettingsDisplay(); 
       
    76     void t_initializeInfoDisplayItems();
       
    77     void t_initializeSettingsDisplayItems();
       
    78     void t_startChanges();
       
    79     void t_endChanges();
       
    80     
       
    81     void t_sizeHint();
       
    82     
       
    83     /*
       
    84      * Not work from commmand prompt.
       
    85      */
       
    86     void t_changeEvent();
       
    87     
       
    88     
       
    89 
       
    90 private:
       
    91     
       
    92     InfoWidget *m_infoWidget;
       
    93     InfoWidgetEngine::ModelData m_modelData;
       
    94     QColor m_qcolor;
       
    95     QGraphicsWidget m_qgraphicswidget;
       
    96 
       
    97 };
       
    98 
       
    99 #endif // UT_INFOWIDGET_H