tsdevicedialog/tsdevicedialogplugin/tsrc/t_tsmodel/t_tsmodel.h
changeset 117 c63ee96dbe5f
equal deleted inserted replaced
115:3ab5c078b490 117:c63ee96dbe5f
       
     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 #ifndef T_TSMODEL_H
       
    18 #define T_TSMODEL_H
       
    19 
       
    20 
       
    21 
       
    22 #include <QObject>
       
    23 #include <qlist.h>
       
    24 #include <QSharedPointer>
       
    25 #include <QVariant>
       
    26 #include <QModelIndex>
       
    27 
       
    28 #include "mocktstask.h"
       
    29 #include "mocktstaskmonitor.h"
       
    30 
       
    31 class TsModel;
       
    32 class TsTaskChangeInfo;
       
    33 
       
    34 /**
       
    35 * @test Test class for TsModel
       
    36 */
       
    37 class T_TsModel : public QObject, public TsTaskLauncher
       
    38 {
       
    39     Q_OBJECT
       
    40 
       
    41 private slots:
       
    42     void testData();
       
    43     void testRowCount();
       
    44     void testOpenApplication();
       
    45     void testCloseApplication();
       
    46     void testActivityWithNoIdDisplaysProperApplicationName();
       
    47     void testDataChangedSignalIsEmittedWhenActivityScreenshotIsUpdated();
       
    48     void testCustomNameIsUsedIfPresent();
       
    49     void testInsert1();
       
    50     void testDelete1();
       
    51     void testChange1();
       
    52     void testMove1();
       
    53     void testFullUpdateFromActivities();
       
    54 
       
    55 private slots:
       
    56     void initTestCase();
       
    57     void cleanupTestCase();
       
    58 
       
    59 private:
       
    60     QObject *activityService();
       
    61     QList<QVariantHash> activityDataSet(int)const;
       
    62     QList<TsTaskChange> appDataSetFull(int);
       
    63     QList<TsTaskChange> changeDataSet5New();
       
    64     QList<TsTaskChange> changeDataSetDelete1(int index);
       
    65     QList<TsTaskChange> changeDataSetInsert1(int index);
       
    66     QList<TsTaskChange> changeDataSetChange1(int index);
       
    67     QList<TsTaskChange> changeDataSetMove1(int newIndex, int oldIndex);
       
    68     void clearModel();
       
    69     
       
    70     int activityDataSetsCount()const;
       
    71    
       
    72 
       
    73 private:
       
    74     TsModel *mModel;
       
    75     TsTaskMonitor *mAppSrv;
       
    76     QObject *mActSrv;
       
    77 };
       
    78 
       
    79 Q_DECLARE_METATYPE(QModelIndex)
       
    80 
       
    81 #endif //T_TSMODEL_H