--- a/src/hbwidgets/popups/hbselectiondialog_p.h Mon Oct 04 17:49:30 2010 +0300
+++ b/src/hbwidgets/popups/hbselectiondialog_p.h Mon Oct 18 18:23:13 2010 +0300
@@ -42,7 +42,7 @@
class HbSelectionDialogPrivate : public HbDialogPrivate
{
- Q_DECLARE_PUBLIC(HbSelectionDialog)
+ Q_DECLARE_PUBLIC(HbSelectionDialog)
public:
HbSelectionDialogPrivate();
~HbSelectionDialogPrivate();
@@ -51,73 +51,91 @@
private:
void init();
- void setStringItems(const QStringList &items,int currentIndex);
+ void setStringItems(const QStringList &items,int currentIndex);
QStringList stringItems() const;
- void setWidgetItems(const QList<HbListWidgetItem*> &items,bool transferOwnership,int currentIndex);
+ void setWidgetItems(const QList<HbListWidgetItem*> &items,bool transferOwnership,int currentIndex);
QList<HbListWidgetItem*> widgetItems() const;
void setSelectedItems(const QList<QVariant> items);
QList<QVariant> selectedItems() const;
- void setModel(QAbstractItemModel* model);
- QAbstractItemModel* model() const;
+ void setModel(QAbstractItemModel* model);
+ QAbstractItemModel* model() const;
QItemSelectionModel* selectionModel() const;
QModelIndexList selectedModelIndexes() const;
- void clearItems(bool keepItems);
- void showActions(HbAbstractItemView::SelectionMode selectionMode);
+ void clearItems(bool keepItems);
+ void showActions(HbAbstractItemView::SelectionMode selectionMode);
+ QString selectionTitle() const;
+ void setSelectionTitle(const QString& title);
public:
bool bOwnItems;
- HbAbstractItemView::SelectionMode mSelectionMode;
+ HbAbstractItemView::SelectionMode mSelectionMode;
void close();
+ void _p_SelectionChanged();
private:
- HbAction *action1;
- HbAction *action2;
+ QPointer<HbAction> action1;
+ QPointer<HbAction> action2;
};
class HbSelectionDialogMarkWidget : public HbWidget
{
- Q_OBJECT
+ Q_OBJECT
public:
- QGraphicsItem *mBackgroundItem;
+ QGraphicsObject *mBackgroundItem;
HbCheckBox* chkMark;
- HbTextItem* lbCounter;
- HbSelectionDialogMarkWidget(QGraphicsItem *parent = 0);
- ~HbSelectionDialogMarkWidget();
- void createPrimitives();
- void updatePrimitives();
- QVariant itemChange( GraphicsItemChange change, const QVariant &value );
- QGraphicsItem* primitive(HbStyle::Primitive primitive) const;
+ QGraphicsObject* mLbCounter;
+ HbSelectionDialogMarkWidget(QGraphicsItem *parent = 0);
+ ~HbSelectionDialogMarkWidget();
+ void createPrimitives();
+ void updatePrimitives();
+ void recreatePrimitives();
+ void initPrimitiveData(HbStylePrimitiveData *primitiveData, const QGraphicsObject *primitive);
+ QVariant itemChange( GraphicsItemChange change, const QVariant &value );
+ QGraphicsItem *primitive(const QString &itemName) const;
+ void updateCounter(const QString& text);
+ QString mCounterText;
};
class HB_AUTOTEST_EXPORT HbSelectionDialogContentWidget :public HbWidget
{
- Q_OBJECT
- Q_PROPERTY( bool multiSelection READ multiSelection WRITE setMultiSelection )
+ Q_OBJECT
+ Q_PROPERTY( bool multiSelection READ multiSelection WRITE setMultiSelection )
private:
- int selectedItemCount() const;
- int totalItemCount() const;
+ int selectedItemCount() const;
+ int totalItemCount() const;
public:
- void createListWidget();
- void createListView();
- void connectSlots();
- HbListView* mListView;
+ void createListWidget();
+ void createListView();
+ void connectSlots();
+ HbListView* mListView;
HbSelectionDialogPrivate* d;
HbSelectionDialogContentWidget(HbSelectionDialogPrivate *priv);
enum { Type = Hb::ItemType_SelectionDialogContentWidget };
int type() const { return Type; }
- void showMarkWidget(bool bShow);
- bool multiSelection(){return bMultiSelection;};
- void setMultiSelection(bool bValue){bMultiSelection = bValue;};
- bool bMultiSelection;
- void updateCounter();
+ void showMarkWidget(bool bShow);
+ bool multiSelection(){return bMultiSelection;};
+ void setMultiSelection(bool bValue){bMultiSelection = bValue;};
+ bool bMultiSelection;
+ void updateCounter();
+ void setModel(QAbstractItemModel* model);
+ QString selectionTitle() const;
+ void setSelectionTitle(const QString& title);
private:
- HbSelectionDialogMarkWidget* markWidget;
+ HbSelectionDialogMarkWidget* markWidget;
+ QString mSelectionTitle;
private slots:
- void _q_listWidgetItemSelected(HbListWidgetItem *item);
- void _q_listItemSelected(QModelIndex index);
- void _q_checkboxclicked(int value);
+ void _q_listWidgetItemSelected(HbListWidgetItem *item);
+ void _q_listItemSelected(QModelIndex index);
+ void _q_selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
+ void _q_checkboxclicked(int value);
+ void modelChanged(const QModelIndex &parent, int start,int end);
};
-
+class HbMarkWidget : public HbWidget
+{
+public:
+ HbCheckBox* chkMark;
+ HbTextItem* lbCounter;
+};
#endif //HBSELECTIONDIALOGPRIVATE_H