taskswitcherapp/tsdevicedialogplugin/inc/tsmodel.h
changeset 51 4785f57bf3d4
parent 46 23b5d6a29cce
equal deleted inserted replaced
46:23b5d6a29cce 51:4785f57bf3d4
    20 
    20 
    21 #include <QAbstractItemModel>
    21 #include <QAbstractItemModel>
    22 #include <QList>
    22 #include <QList>
    23 #include <QSize>
    23 #include <QSize>
    24 #include <QSharedPointer>
    24 #include <QSharedPointer>
    25 #include <caquery.h>
    25 #include <tstaskmonitor.h>
    26 #include <caentry.h>
    26 #ifdef Q_OS_SYMBIAN
       
    27 #include <apgcli.h>
       
    28 #endif
    27 
    29 
    28 class CaService;
    30 class TsTaskMonitor;
    29 class ActivityManager;
    31 class ActivityManager;
    30 class CaNotifier;
    32 class CaNotifier;
    31 class TsModelItem;
    33 class TsModelItem;
    32 
    34 
    33 class TsModel : public QAbstractListModel
    35 class TsModel : public QAbstractListModel
    34 {
    36 {
    35     Q_OBJECT
    37     Q_OBJECT
    36 
    38 
    37 public:
    39 public:
    38     explicit TsModel(CaService &applicationSrv,
    40     explicit TsModel(TsTaskMonitor &applicationSrv,
    39                      QObject &activitySrv,
    41                      QObject &activitySrv,
    40                      QObject *parent = 0);
    42                      QObject *parent = 0);
    41     ~TsModel();
    43     ~TsModel();
    42 
    44 
    43     int rowCount(const QModelIndex &parent = QModelIndex()) const;
    45     int rowCount(const QModelIndex &parent = QModelIndex()) const;
    46 
    48 
    47 public slots:
    49 public slots:
    48     void openApplication(const QModelIndex &index);
    50     void openApplication(const QModelIndex &index);
    49     void closeApplication(const QModelIndex &index);
    51     void closeApplication(const QModelIndex &index);
    50     void updateModel();
    52     void updateModel();
    51     void entryChanged(CaEntry, ChangeType);
       
    52     void entryChanged(TsModelItem *);
    53     void entryChanged(TsModelItem *);
    53 private:
    54 private:
    54     TsModelItem *entry(const QModelIndex &index) const;
    55     TsModelItem *entry(const QModelIndex &index) const;
    55     void getApplications();
    56     void getApplications();
    56     void getActivities();
    57     void getActivities();
    61     /*
    62     /*
    62      * List containing result
    63      * List containing result
    63      */
    64      */
    64     QList<TsModelItem *> mEntries;
    65     QList<TsModelItem *> mEntries;
    65 
    66 
    66     /*
    67     TsTaskMonitor &mApplicationService;
    67      * Query
       
    68      */
       
    69     CaQuery mQuery;
       
    70 
       
    71     /*
       
    72      * Content Arsenal Service
       
    73      */
       
    74     CaService &mApplicationService;
       
    75 
    68 
    76     /*
    69     /*
    77      * Activity Service
    70      * Activity Service
    78      */
    71      */
    79     QObject &mActivityService;
    72     QObject &mActivityService;
    80 
    73     
    81     /*
    74 #ifdef Q_OS_SYMBIAN
    82      * Content Arsenal Notifier
    75     RApaLsSession iAppArcSession;
    83      */
    76 #endif
    84     CaNotifier *mNotifier;
       
    85 
    77 
    86     /*
    78     /*
    87      * Icon size in model
    79      * Icon size in model
    88      */
    80      */
    89     QSize mSize;
    81     QSize mSize;