taskswitcher/testapplications/tstestpluginmanager/fakeplugin/inc/tstestmodel.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 
       
    18 #ifndef TSTESTMODEL_H
       
    19 #define TSTESTMODEL_H
       
    20 
       
    21 #include <QObject>
       
    22 #include <QVariantHash>
       
    23 #include <QColor>
       
    24 #include <QPixmap>
       
    25 
       
    26 
       
    27 #include <qvaluespacesubscriber.h>
       
    28 QTM_USE_NAMESPACE
       
    29 
       
    30 #if defined(Q_OS_SYMBIAN)
       
    31     #include <fbs.h>
       
    32 #endif
       
    33 
       
    34 class TsTestModel : public QObject
       
    35 {
       
    36     Q_OBJECT
       
    37 
       
    38 public:
       
    39     TsTestModel(QObject *parent = 0);
       
    40     virtual ~TsTestModel();
       
    41 
       
    42 public slots:
       
    43     QList<QVariantHash> taskList() const;
       
    44     QList<QVariantHash> taskList(int limit) const;
       
    45     
       
    46     bool openTask(const QVariant &id);
       
    47     bool closeTask(const QVariant &id);
       
    48     
       
    49 
       
    50 private slots:
       
    51     void verifyConnection();
       
    52     void checkValue();
       
    53     
       
    54 signals:
       
    55     void dataChanged();    
       
    56     
       
    57 private:
       
    58     void removeAll();
       
    59     char byte(int numtoget, int byte);
       
    60     QColor generateColor(int item);
       
    61     QPixmap generatePixmap(int item);
       
    62     void addItem(bool running, bool closeable);
       
    63     void addItems(int num, bool running, bool closeable);
       
    64     
       
    65 private:
       
    66     QList<QVariantHash> mData;
       
    67     bool mWasValid;
       
    68 #if defined(Q_OS_SYMBIAN)
       
    69     QList<CFbsBitmap*> mBitmaps;
       
    70 #endif
       
    71     QValueSpaceSubscriber mSubscriber;
       
    72 };
       
    73 
       
    74 #endif // TSTESTMODEL_H