taskswitcherapp/tsserviceplugin/inc/tsrecentapplicationsmodel.h
changeset 35 f9ce957a272c
child 36 cdae8c6c3876
equal deleted inserted replaced
5:c743ef5928ba 35:f9ce957a272c
       
     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: recentapplicationsmodel.h
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef TSRECENTAPPLICATIONSMODEL_H
       
    19 #define TSRECENTAPPLICATIONSMODEL_H
       
    20 
       
    21 #include <QAbstractItemModel>
       
    22 #include <QList>
       
    23 #include <QSize>
       
    24 #include <QSharedPointer>
       
    25 #include <caquery.h>
       
    26 #include <caentry.h>
       
    27 
       
    28 class CaService;
       
    29 class CaNotifier;
       
    30 
       
    31 /**
       
    32  * @ingroup group_tsserviceprovider
       
    33  * @brief TsRecentApplicationsModel model with recent application.
       
    34  *
       
    35  * Loads recent aplications from content arsenal.
       
    36  *
       
    37  * @lib tsserviceprovider.lib
       
    38  * @since S60 ?S60_version
       
    39  */
       
    40 class TsRecentApplicationsModel : public QAbstractListModel
       
    41 {
       
    42     Q_OBJECT
       
    43 
       
    44 public:
       
    45     explicit TsRecentApplicationsModel(QObject *parent = 0);
       
    46     ~TsRecentApplicationsModel();
       
    47 
       
    48     int rowCount(const QModelIndex &parent = QModelIndex()) const;
       
    49     virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
       
    50 
       
    51 public slots:
       
    52     void updateModel();
       
    53     void entryChanged(CaEntry, ChangeType);
       
    54 
       
    55 private:
       
    56     bool closeable(const QModelIndex &index) const;
       
    57     QVariant entryId(const QModelIndex &index) const;
       
    58     CaEntry *entry(const QModelIndex &index) const;
       
    59 
       
    60 public:
       
    61     /*
       
    62      * List containing result
       
    63      */
       
    64     QList<CaEntry *> mEntries;
       
    65 
       
    66     /*
       
    67      * Query
       
    68      */
       
    69     CaQuery mQuery;
       
    70 
       
    71     /*
       
    72      * Content Arsenal Service
       
    73      */
       
    74     QSharedPointer<CaService> mService;
       
    75 
       
    76     /*
       
    77      * Content Arsenal Notifier
       
    78      */
       
    79     CaNotifier *mNotifier;
       
    80 
       
    81     /*
       
    82      * Icon size in model
       
    83      */
       
    84     QSize mSize;
       
    85 };
       
    86 
       
    87 #endif // TSRECENTAPPLICATIONSMODEL_H