emailuis/nmailuiengine/inc/nmmailboxlistmodel.h
author hgs
Mon, 23 Aug 2010 23:32:31 +0300
changeset 62 a8c646b56683
parent 43 99bcbff212ad
permissions -rw-r--r--
201033

/*
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:
*
*/

#ifndef NMMAILBOXLISTMODEL_H_
#define NMMAILBOXLISTMODEL_H_

#include <QStandardItemModel>

#include "nmuienginedef.h"
#include "nmcommon.h"

class NmMailbox;
class NmDataManager;

class NmMailboxListModelItem;

class NMUIENGINE_EXPORT NmMailboxListModel : public QStandardItemModel
{
    Q_OBJECT
public:

    NmMailboxListModel(NmDataManager &dataManager, QObject *parent = 0);
    virtual ~NmMailboxListModel();
    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
    void refresh(QList<NmMailbox*> &mailboxList);
    void refreshModelItem(const NmId &mailboxId);

public slots:
    void handleMailboxEvent(NmMailboxEvent event, const QList<NmId> &mailboxIds);

private:
    NmMailboxListModelItem *createMailboxItem(const NmMailbox *mailbox);

private:
    NmDataManager &mDataManager;    // not owned
};

#endif /* NMMAILBOXLISTMODEL_H_ */