src/hbwidgets/popups/hbselectiondialog.h
changeset 34 ed14f46c0e55
parent 1 f7ac710697a9
equal deleted inserted replaced
31:7516d6d86cf5 34:ed14f46c0e55
    39 
    39 
    40 QT_END_NAMESPACE
    40 QT_END_NAMESPACE
    41 
    41 
    42 class HB_WIDGETS_EXPORT HbSelectionDialog : public HbDialog
    42 class HB_WIDGETS_EXPORT HbSelectionDialog : public HbDialog
    43 {
    43 {
    44 	Q_OBJECT
    44     Q_OBJECT
    45     Q_PROPERTY(HbAbstractItemView::SelectionMode selectionMode READ selectionMode WRITE setSelectionMode)
    45     Q_PROPERTY(HbAbstractItemView::SelectionMode selectionMode READ selectionMode WRITE setSelectionMode)
    46     Q_PROPERTY(QStringList items READ stringItems WRITE setStringItems)
    46     Q_PROPERTY(QStringList items READ stringItems WRITE setStringItems)
    47     Q_PROPERTY(QList<QVariant> selectedItems READ selectedItems WRITE setSelectedItems)
    47     Q_PROPERTY(QList<QVariant> selectedItems READ selectedItems WRITE setSelectedItems)
       
    48     Q_PROPERTY(QString selectionTitle READ selectionTitle WRITE setSelectionTitle)
       
    49 public:
       
    50     enum { Type = Hb::ItemType_SelectionDialog };
       
    51     int type() const { return Type; }
    48     
    52     
    49 public:
    53     explicit HbSelectionDialog(QGraphicsItem* parent=0);
    50 	enum { Type = Hb::ItemType_SelectionDialog };
       
    51 	int type() const { return Type; }
       
    52 	
       
    53 	explicit HbSelectionDialog(QGraphicsItem* parent=0);
       
    54     ~HbSelectionDialog();
    54     ~HbSelectionDialog();
    55         
    55         
    56     void setSelectionMode(HbAbstractItemView::SelectionMode mode);
    56     void setSelectionMode(HbAbstractItemView::SelectionMode mode);
    57     HbAbstractItemView::SelectionMode selectionMode() const;
    57     HbAbstractItemView::SelectionMode selectionMode() const;
    58     
    58     
    59 	void setStringItems(const QStringList &items,int currentIndex = 0);
    59     void setStringItems(const QStringList &items,int currentIndex = 0);
    60     QStringList stringItems() const;
    60     QStringList stringItems() const;
    61 	
    61     
    62     void setWidgetItems(const QList<HbListWidgetItem*> &items,bool transferOwnership = false,int currentIndex = 0);
    62     void setWidgetItems(const QList<HbListWidgetItem*> &items,bool transferOwnership = false,int currentIndex = 0);
    63 	QList<HbListWidgetItem*> widgetItems() const;
    63     QList<HbListWidgetItem*> widgetItems() const;
    64     
    64     
    65 	void setModel(QAbstractItemModel* model);
    65     void setModel(QAbstractItemModel* model);
    66 	QAbstractItemModel* model() const;
    66     QAbstractItemModel* model() const;
    67 	
    67     
    68     QList<QVariant> selectedItems() const;
    68     QList<QVariant> selectedItems() const;
    69     void setSelectedItems(const QList<QVariant> items);
    69     void setSelectedItems(const QList<QVariant> items);
    70 
    70 
    71     QModelIndexList selectedModelIndexes() const;
    71     QModelIndexList selectedModelIndexes() const;
    72 
    72 
       
    73     QString selectionTitle() const;
       
    74     void setSelectionTitle(const QString& title);
       
    75 
    73 protected:
    76 protected:
    74     void showEvent(QShowEvent *event);
    77     void showEvent(QShowEvent *event);
    75 
    78 signals:
       
    79     void selectionChanged();
    76 private:
    80 private:
    77     Q_DISABLE_COPY(HbSelectionDialog)
    81     Q_DISABLE_COPY(HbSelectionDialog)
    78     Q_DECLARE_PRIVATE_D(d_ptr, HbSelectionDialog)
    82     Q_DECLARE_PRIVATE_D(d_ptr, HbSelectionDialog)
    79 };
    83 };
    80 
    84