tsdevicedialog/tsdevicedialogplugin/inc/tsmodel.h
changeset 112 dbfb5e38438b
parent 107 b34d53f6acdf
child 116 305818acdca4
equal deleted inserted replaced
107:b34d53f6acdf 112:dbfb5e38438b
    16 */
    16 */
    17 
    17 
    18 #ifndef TSMODEL_H
    18 #ifndef TSMODEL_H
    19 #define TSMODEL_H
    19 #define TSMODEL_H
    20 
    20 
    21 #include <QAbstractItemModel>
    21 #include <QAbstractListModel>
    22 #include <QList>
    22 #include <QList>
    23 #include <QSize>
    23 #include <QSize>
    24 #include <QSharedPointer>
    24 #include <QSharedPointer>
       
    25 
    25 #include <tstaskmonitor.h>
    26 #include <tstaskmonitor.h>
       
    27 
    26 #ifdef Q_OS_SYMBIAN
    28 #ifdef Q_OS_SYMBIAN
    27 #include <apgcli.h>
    29 #include <apgcli.h>
    28 #endif
    30 #endif
    29 
    31 
    30 class TsTaskMonitor;
       
    31 class CaNotifier;
    32 class CaNotifier;
    32 class TsModelItem;
    33 class TsModelItem;
    33 
    34 
    34 class TsModel : public QAbstractListModel
    35 class TsModel : public QAbstractListModel
    35 {
    36 {
    43 
    44 
    44     int rowCount(const QModelIndex &parent = QModelIndex()) const;
    45     int rowCount(const QModelIndex &parent = QModelIndex()) const;
    45     QVariant data(const QModelIndex &index, 
    46     QVariant data(const QModelIndex &index, 
    46                   int role = Qt::DisplayRole) const;
    47                   int role = Qt::DisplayRole) const;
    47     int maxRowCount()const;
    48     int maxRowCount()const;
       
    49     // from QAbstractModel
       
    50     virtual bool insertRows(int row, int count, TsModelItem* item,
       
    51                             const QModelIndex & parent = QModelIndex());
       
    52     virtual bool removeRows(int row, int count,
       
    53                             const QModelIndex & parent = QModelIndex());
       
    54 
       
    55     
       
    56     bool moveRows(int oldPosition, int newPosition,
       
    57                   const QModelIndex & parent = QModelIndex());
       
    58     bool updateRows(int row, TsModelItem* item);
       
    59     void fullUpdate();
    48 
    60 
    49 public slots:
    61 public slots:
    50     void openApplication(const QModelIndex &index);
    62     void openApplication(const QModelIndex &index);
    51     void closeApplication(const QModelIndex &index);
    63     void closeApplication(const QModelIndex &index);
    52     void updateModel();
    64     void updateApplications();
       
    65     void updateActivities();
    53     void entryChanged(TsModelItem *);
    66     void entryChanged(TsModelItem *);
    54 private:
    67 private:
    55     TsModelItem *entry(const QModelIndex &index) const;
    68     TsModelItem *entry(const QModelIndex &index) const;
    56     void getApplications();
    69     void getApplications();
    57     void getActivities();
    70     void getActivities();