emailuis/nmailui/inc/nmmailboxselectiondialog.h
branchRCL_3
changeset 63 d189ee25cf9d
equal deleted inserted replaced
61:dcf0eedfc1a3 63:d189ee25cf9d
       
     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:
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef NMMAILBOXSELECTIONDIALOG_H_
       
    19 #define NMMAILBOXSELECTIONDIALOG_H_
       
    20 
       
    21 #include <QObject>
       
    22 #include <QAbstractItemModel> // For QModelIndex.
       
    23 #include <nmcommon.h>
       
    24 
       
    25 class HbDialog;
       
    26 class HbListView;
       
    27 class HbAction;
       
    28 class QGraphicsItem;
       
    29 class QStandardItemModel;
       
    30 class NmMailboxListModel;
       
    31 class NmMailboxMetaData;
       
    32 
       
    33 
       
    34 class NmMailboxSelectionDialog : public QObject
       
    35 {
       
    36     Q_OBJECT
       
    37 
       
    38 public:
       
    39 
       
    40     NmMailboxSelectionDialog(NmMailboxListModel &mailboxListModel,
       
    41                              QGraphicsItem *parent = 0);
       
    42     virtual ~NmMailboxSelectionDialog();
       
    43     void open();
       
    44 
       
    45 private slots:
       
    46 
       
    47     void itemActivated(QModelIndex index);
       
    48     void dialogClosed(HbAction *action);
       
    49 
       
    50 signals:
       
    51 
       
    52     void selectionDialogClosed(NmId &mailboxId);
       
    53 
       
    54 private:
       
    55 
       
    56     bool initializeUi();
       
    57     bool populateListItems();
       
    58     NmMailboxMetaData *mailboxMetaData(int index) const;
       
    59 
       
    60 private:
       
    61 
       
    62     HbListView *mMailboxListView; // Content view, owned
       
    63     HbDialog *mMailboxSelectionDialog; // The dialog, owned
       
    64     QStandardItemModel *mContentItemModel; // Item model for list view content, owned
       
    65     NmMailboxListModel &mMailboxListModel; // Mailbox list model
       
    66     QGraphicsItem *mParent; // The parent for this dialog.
       
    67     NmId mMailboxId; // Selected mailbox ID
       
    68     QObjectList mWidgetList;
       
    69 };
       
    70 
       
    71 
       
    72 #endif /* NMMAILBOXSELECTIONDIALOG_H_ */
       
    73 
       
    74 // End of file.