emailuis/nmailuiengine/inc/nmmailboxlistmodel.h
changeset 18 578830873419
child 30 759dc5235cdb
equal deleted inserted replaced
4:e7aa27f58ae1 18:578830873419
       
     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 NMMAILBOXLISTMODEL_H_
       
    19 #define NMMAILBOXLISTMODEL_H_
       
    20 
       
    21 #include <QStandardItemModel>
       
    22 
       
    23 #include "nmuienginedef.h"
       
    24 #include "nmcommon.h"
       
    25 
       
    26 class NmMailbox;
       
    27 class NmDataManager;
       
    28 
       
    29 class NmMailboxListModelItem;
       
    30 
       
    31 class NMUIENGINE_EXPORT NmMailboxListModel : public QStandardItemModel
       
    32 {
       
    33     Q_OBJECT
       
    34 public:
       
    35 
       
    36     NmMailboxListModel(NmDataManager &dataManager, QObject *parent = 0);
       
    37     virtual ~NmMailboxListModel();
       
    38     QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
       
    39     void refresh(QList<NmMailbox*> &mailboxList);
       
    40     void refreshModelItem(const NmId &mailboxId, bool allowEmitDataChanged = true);
       
    41 
       
    42 public slots:
       
    43     void handleMailboxEvent(NmMailboxEvent event, const QList<NmId> &mailboxIds);
       
    44 
       
    45 private:
       
    46     NmMailboxListModelItem *createMailboxItem(const NmMailbox *mailbox);
       
    47 
       
    48 private:
       
    49     NmDataManager &mDataManager;    // not owned
       
    50 };
       
    51 
       
    52 #endif /* NMMAILBOXLISTMODEL_H_ */