src/hbwidgets/popups/hbselectiondialog.h
changeset 1 f7ac710697a9
child 23 e6ad4ef83b23
child 34 ed14f46c0e55
equal deleted inserted replaced
0:16d8024aca5e 1:f7ac710697a9
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (developer.feedback@nokia.com)
       
     6 **
       
     7 ** This file is part of the HbWidgets module of the UI Extensions for Mobile.
       
     8 **
       
     9 ** GNU Lesser General Public License Usage
       
    10 ** This file may be used under the terms of the GNU Lesser General Public
       
    11 ** License version 2.1 as published by the Free Software Foundation and
       
    12 ** appearing in the file LICENSE.LGPL included in the packaging of this file.
       
    13 ** Please review the following information to ensure the GNU Lesser General
       
    14 ** Public License version 2.1 requirements will be met:
       
    15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    16 **
       
    17 ** In addition, as a special exception, Nokia gives you certain additional
       
    18 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    20 **
       
    21 ** If you have questions regarding the use of this file, please contact
       
    22 ** Nokia at developer.feedback@nokia.com.
       
    23 **
       
    24 ****************************************************************************/
       
    25 
       
    26 #ifndef HBSELECTIONDIALOG_H
       
    27 #define HBSELECTIONDIALOG_H
       
    28 
       
    29 #include <QAbstractItemView>
       
    30 #include <hbdialog.h>
       
    31 #include <hbabstractitemview.h>
       
    32 
       
    33 class HbSelectionDialogPrivate;
       
    34 class HbListWidgetItem;
       
    35 
       
    36 QT_BEGIN_NAMESPACE
       
    37 
       
    38 class QAbstractItemModel;
       
    39 
       
    40 QT_END_NAMESPACE
       
    41 
       
    42 class HB_WIDGETS_EXPORT HbSelectionDialog : public HbDialog
       
    43 {
       
    44 	Q_OBJECT
       
    45     Q_PROPERTY(HbAbstractItemView::SelectionMode selectionMode READ selectionMode WRITE setSelectionMode)
       
    46     Q_PROPERTY(QStringList items READ stringItems WRITE setStringItems)
       
    47     Q_PROPERTY(QList<QVariant> selectedItems READ selectedItems WRITE setSelectedItems)
       
    48     
       
    49 public:
       
    50 	enum { Type = Hb::ItemType_SelectionDialog };
       
    51 	int type() const { return Type; }
       
    52 	
       
    53 	explicit HbSelectionDialog(QGraphicsItem* parent=0);
       
    54     ~HbSelectionDialog();
       
    55         
       
    56     void setSelectionMode(HbAbstractItemView::SelectionMode mode);
       
    57     HbAbstractItemView::SelectionMode selectionMode() const;
       
    58     
       
    59 	void setStringItems(const QStringList &items,int currentIndex = 0);
       
    60     QStringList stringItems() const;
       
    61 	
       
    62     void setWidgetItems(const QList<HbListWidgetItem*> &items,bool transferOwnership = false,int currentIndex = 0);
       
    63 	QList<HbListWidgetItem*> widgetItems() const;
       
    64     
       
    65 	void setModel(QAbstractItemModel* model);
       
    66 	QAbstractItemModel* model() const;
       
    67 	
       
    68     QList<QVariant> selectedItems() const;
       
    69     void setSelectedItems(const QList<QVariant> items);
       
    70 
       
    71     QModelIndexList selectedModelIndexes() const;
       
    72 
       
    73 protected:
       
    74     void showEvent(QShowEvent *event);
       
    75 
       
    76 private:
       
    77     Q_DISABLE_COPY(HbSelectionDialog)
       
    78     Q_DECLARE_PRIVATE_D(d_ptr, HbSelectionDialog)
       
    79 };
       
    80 
       
    81 #endif //HBSELECTIONDIALOG_H