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