class KItemListKeyboardSearchManager;
class KItemListSelectionManager;
class KItemListView;
+class KItemListWidget;
class QGraphicsSceneHoverEvent;
class QGraphicsSceneDragDropEvent;
class QGraphicsSceneMouseEvent;
signals:
void itemActivated(int index);
void itemMiddleClicked(int index);
- void contextMenuRequested(int index, const QPointF& pos);
+
+ /**
+ * Emitted if a context-menu is requested for the item with
+ * the index \a index. It is assured that the index is valid.
+ */
+ void itemContextMenuRequested(int index, const QPointF& pos);
+
+ /**
+ * Emitted if a context-menu is requested for the KItemListView.
+ */
+ void viewContextMenuRequested(const QPointF& pos);
+
+ /**
+ * Emitted if a context-menu is requested for the header of the KItemListView.
+ */
+ void headerContextMenuRequested(const QPointF& pos);
/**
* Is emitted if the item with the index \p index gets hovered.
*/
void itemHovered(int index);
+
/**
* Is emitted if the item with the index \p index gets unhovered.
* It is assured that the signal itemHovered() for this index
void itemExpansionToggleClicked(int index);
+ /**
+ * Is emitted if a drop event is done above the item with the index
+ * \a index. If \a index is < 0 the drop event is done above an
+ * empty area of the view.
+ */
+ void itemDropEvent(int index, QGraphicsSceneDragDropEvent* event);
+
void modelChanged(KItemModelBase* current, KItemModelBase* previous);
void viewChanged(KItemListView* current, KItemListView* previous);
private slots:
- void slotViewOffsetChanged(qreal current, qreal previous);
+ void slotViewScrollOffsetChanged(qreal current, qreal previous);
/**
* Is invoked when the rubberband boundaries have been changed and will select
*/
void slotRubberBandChanged();
- void slotKeyboardActivationRequested(const QString& text, bool searchFromNextItem);
+ void slotChangeCurrentItem(const QString& text, bool searchFromNextItem);
private:
/**
- * Creates a QDrag object to start a drag-operation.
- * @return True if the QDrag object has been created. If false is returned
- * there is no implementation available for KItemModelBase::createMimeData().
+ * Creates a QDrag object and initiates a drag-operation.
+ */
+ void startDragging();
+
+ /**
+ * @return Widget that is currently in the hovered state. 0 is returned
+ * if no widget is marked as hovered.
+ */
+ KItemListWidget* hoveredWidget() const;
+
+ /**
+ * @return Widget that is below the position \a pos. 0 is returned
+ * if no widget is below the position.
*/
- bool startDragging();
+ KItemListWidget* widgetForPos(const QPointF& pos) const;
private:
- bool m_dragging;
SelectionBehavior m_selectionBehavior;
KItemModelBase* m_model;
KItemListView* m_view;