iaupdate/IAD/ui/inc/iaupdateapplistmodel.h
changeset 77 d1838696558c
equal deleted inserted replaced
75:2d2d25361590 77:d1838696558c
       
     1 /*
       
     2 * Copyright (c) 2010 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:   This file contains the header file of the IAUpdateAppListModel
       
    15 *                class 
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef IAUPDATEAPPLISTMODEL_H_
       
    20 #define IAUPDATEAPPLISTMODEL_H_
       
    21 
       
    22 
       
    23 #include <QAbstractListModel>
       
    24 #include <QObject>
       
    25 
       
    26 #include "iaupdatenode.h"
       
    27 class MIAUpdateFwNode;
       
    28 
       
    29 class IAUpdateAppListModel : public QAbstractListModel
       
    30 {
       
    31     Q_OBJECT 
       
    32     
       
    33 public:
       
    34     
       
    35     enum ItemRole
       
    36     {
       
    37         ProgressRole = Qt::UserRole + 1,
       
    38         ProgressValueRole
       
    39     };
       
    40     
       
    41     IAUpdateAppListModel();
       
    42     QVariant data (const QModelIndex &index, int role = Qt::DisplayRole ) const;
       
    43     int  rowCount (const QModelIndex &parent=QModelIndex()) const;
       
    44     void setNodeArray(const RPointerArray<MIAUpdateNode> &nodes);   
       
    45     //void setFwNodeArray(const RPointerArray<MIAUpdateFwNode> &fwNodes);
       
    46     void setFwNode(MIAUpdateFwNode *fwNode);
       
    47     void refresh();
       
    48     void refreshProgress();
       
    49     
       
    50 private: 
       
    51     bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex());
       
    52     void setImportance(MIAUpdateAnyNode *node, QString &importanceDescription) const;
       
    53    
       
    54 private:
       
    55     RPointerArray<MIAUpdateNode> mNodes;
       
    56     //RPointerArray<MIAUpdateFwNode> mFwNodes;
       
    57     MIAUpdateFwNode *mFwNode;
       
    58     
       
    59     int mRefreshedCount;
       
    60 };
       
    61 
       
    62 #endif /* IAUPDATEAPPLISTMODEL_H_ */