emailuis/nmailui/inc/nmmailboxselectiondialog.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 11 Jun 2010 13:27:14 +0300
changeset 30 759dc5235cdb
parent 23 2dc6caa42ec3
permissions -rw-r--r--
Revision: 201021 Kit: 2010123

/*
* Copyright (c) 2010 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 NMMAILBOXSELECTIONDIALOG_H_
#define NMMAILBOXSELECTIONDIALOG_H_

#include <QObject>
#include <QAbstractItemModel> // For QModelIndex.
#include <nmcommon.h>

class HbDialog;
class HbListView;
class HbAction;
class QGraphicsItem;
class QStandardItemModel;
class NmMailboxListModel;
class NmMailboxMetaData;


class NmMailboxSelectionDialog : public QObject
{
    Q_OBJECT

public:

    NmMailboxSelectionDialog(NmMailboxListModel &mailboxListModel,
                             QGraphicsItem *parent = 0);
    virtual ~NmMailboxSelectionDialog();
    void open();

private slots:

    void itemActivated(QModelIndex index);
    void dialogClosed(HbAction *action);

signals:

    void selectionDialogClosed(NmId &mailboxId);

private:

    bool initializeUi();
    bool populateListItems();
    NmMailboxMetaData *mailboxMetaData(int index) const;

private:

    HbListView *mMailboxListView; // Content view, owned
    HbDialog *mMailboxSelectionDialog; // The dialog, owned
    QStandardItemModel *mContentItemModel; // Item model for list view content, owned
    NmMailboxListModel &mMailboxListModel; // Mailbox list model
    QGraphicsItem *mParent; // The parent for this dialog.
    NmId mMailboxId; // Selected mailbox ID
    QObjectList mWidgetList;
};


#endif /* NMMAILBOXSELECTIONDIALOG_H_ */

// End of file.