Changeset View
Changeset View
Standalone View
Standalone View
src/kitemviews/kitemlistcontroller.h
Show All 22 Lines | |||||
23 | #ifndef KITEMLISTCONTROLLER_H | 23 | #ifndef KITEMLISTCONTROLLER_H | ||
24 | #define KITEMLISTCONTROLLER_H | 24 | #define KITEMLISTCONTROLLER_H | ||
25 | 25 | | |||
26 | #include "dolphin_export.h" | 26 | #include "dolphin_export.h" | ||
27 | #include "kitemset.h" | 27 | #include "kitemset.h" | ||
28 | 28 | | |||
29 | #include <QObject> | 29 | #include <QObject> | ||
30 | #include <QPointF> | 30 | #include <QPointF> | ||
31 | #include <QTimer> | ||||
31 | 32 | | |||
32 | class QTimer; | 33 | class QTimer; | ||
33 | class KItemModelBase; | 34 | class KItemModelBase; | ||
34 | class KItemListKeyboardSearchManager; | 35 | class KItemListKeyboardSearchManager; | ||
35 | class KItemListSelectionManager; | 36 | class KItemListSelectionManager; | ||
36 | class KItemListView; | 37 | class KItemListView; | ||
37 | class KItemListWidget; | 38 | class KItemListWidget; | ||
38 | class QGraphicsSceneHoverEvent; | 39 | class QGraphicsSceneHoverEvent; | ||
▲ Show 20 Lines • Show All 109 Lines • ▼ Show 20 Line(s) | 69 | public: | |||
148 | virtual bool dragLeaveEvent(QGraphicsSceneDragDropEvent* event, const QTransform& transform); | 149 | virtual bool dragLeaveEvent(QGraphicsSceneDragDropEvent* event, const QTransform& transform); | ||
149 | virtual bool dragMoveEvent(QGraphicsSceneDragDropEvent* event, const QTransform& transform); | 150 | virtual bool dragMoveEvent(QGraphicsSceneDragDropEvent* event, const QTransform& transform); | ||
150 | virtual bool dropEvent(QGraphicsSceneDragDropEvent* event, const QTransform& transform); | 151 | virtual bool dropEvent(QGraphicsSceneDragDropEvent* event, const QTransform& transform); | ||
151 | virtual bool hoverEnterEvent(QGraphicsSceneHoverEvent* event, const QTransform& transform); | 152 | virtual bool hoverEnterEvent(QGraphicsSceneHoverEvent* event, const QTransform& transform); | ||
152 | virtual bool hoverMoveEvent(QGraphicsSceneHoverEvent* event, const QTransform& transform); | 153 | virtual bool hoverMoveEvent(QGraphicsSceneHoverEvent* event, const QTransform& transform); | ||
153 | virtual bool hoverLeaveEvent(QGraphicsSceneHoverEvent* event, const QTransform& transform); | 154 | virtual bool hoverLeaveEvent(QGraphicsSceneHoverEvent* event, const QTransform& transform); | ||
154 | virtual bool wheelEvent(QGraphicsSceneWheelEvent* event, const QTransform& transform); | 155 | virtual bool wheelEvent(QGraphicsSceneWheelEvent* event, const QTransform& transform); | ||
155 | virtual bool resizeEvent(QGraphicsSceneResizeEvent* event, const QTransform& transform); | 156 | virtual bool resizeEvent(QGraphicsSceneResizeEvent* event, const QTransform& transform); | ||
157 | virtual bool touchBeginEvent(QTouchEvent* event, const QTransform& transform); | ||||
158 | virtual bool touchUpdateEvent(QTouchEvent* event, const QTransform& transform); | ||||
159 | virtual bool touchEndEvent(QTouchEvent* event, const QTransform& transform); | ||||
156 | virtual bool processEvent(QEvent* event, const QTransform& transform); | 160 | virtual bool processEvent(QEvent* event, const QTransform& transform); | ||
157 | 161 | | |||
158 | signals: | 162 | signals: | ||
159 | /** | 163 | /** | ||
160 | * Is emitted if exactly one item has been activated by e.g. a mouse-click | 164 | * Is emitted if exactly one item has been activated by e.g. a mouse-click | ||
161 | * or by pressing Return/Enter. | 165 | * or by pressing Return/Enter. | ||
162 | */ | 166 | */ | ||
163 | void itemActivated(int index); | 167 | void itemActivated(int index); | ||
▲ Show 20 Lines • Show All 138 Lines • ▼ Show 20 Line(s) | 261 | private: | |||
302 | 306 | | |||
303 | /** | 307 | /** | ||
304 | * Dependent on the selection-behavior the extendedSelectionRegion-property | 308 | * Dependent on the selection-behavior the extendedSelectionRegion-property | ||
305 | * of the KItemListStyleOption from the view should be adjusted: If no | 309 | * of the KItemListStyleOption from the view should be adjusted: If no | ||
306 | * rubberband selection is used the property should be enabled. | 310 | * rubberband selection is used the property should be enabled. | ||
307 | */ | 311 | */ | ||
308 | void updateExtendedSelectionRegion(); | 312 | void updateExtendedSelectionRegion(); | ||
309 | 313 | | |||
314 | bool onPress(const QPoint& screenPos, const Qt::KeyboardModifiers modifiers = 0, const Qt::MouseButtons buttons = 0); | ||||
315 | void onMove(const QPointF& pos, const Qt::MouseButtons buttons); | ||||
316 | bool onRelease(const QPointF& pos, const Qt::KeyboardModifiers modifiers = 0, const Qt::MouseButtons buttons = 0); | ||||
317 | bool onDoubleClick(const QPointF& pos, const QPoint& screenPos, const int index, const Qt::MouseButton button); | ||||
310 | private: | 318 | private: | ||
311 | bool m_singleClickActivationEnforced; | 319 | bool m_singleClickActivationEnforced; | ||
312 | bool m_selectionTogglePressed; | 320 | bool m_selectionTogglePressed; | ||
313 | bool m_clearSelectionIfItemsAreNotDragged; | 321 | bool m_clearSelectionIfItemsAreNotDragged; | ||
322 | bool m_cancelTouchOnRelease; | ||||
323 | bool m_touchDoubleClickInProgress; | ||||
324 | QPointF m_touchDoubleClickStartPos; | ||||
314 | SelectionBehavior m_selectionBehavior; | 325 | SelectionBehavior m_selectionBehavior; | ||
315 | AutoActivationBehavior m_autoActivationBehavior; | 326 | AutoActivationBehavior m_autoActivationBehavior; | ||
316 | MouseDoubleClickAction m_mouseDoubleClickAction; | 327 | MouseDoubleClickAction m_mouseDoubleClickAction; | ||
317 | KItemModelBase* m_model; | 328 | KItemModelBase* m_model; | ||
318 | KItemListView* m_view; | 329 | KItemListView* m_view; | ||
319 | KItemListSelectionManager* m_selectionManager; | 330 | KItemListSelectionManager* m_selectionManager; | ||
320 | KItemListKeyboardSearchManager* m_keyboardManager; | 331 | KItemListKeyboardSearchManager* m_keyboardManager; | ||
321 | int m_pressedIndex; | 332 | int m_pressedIndex; | ||
333 | int m_touchDoubleClickStartIndex; | ||||
322 | QPointF m_pressedMousePos; | 334 | QPointF m_pressedMousePos; | ||
323 | 335 | | |||
324 | QTimer* m_autoActivationTimer; | 336 | QTimer* m_autoActivationTimer; | ||
337 | QTimer m_touchDoubleClickTimer; | ||||
325 | 338 | | |||
326 | /** | 339 | /** | ||
327 | * When starting a rubberband selection during a Shift- or Control-key has been | 340 | * When starting a rubberband selection during a Shift- or Control-key has been | ||
328 | * pressed the current selection should never be deleted. To be able to restore | 341 | * pressed the current selection should never be deleted. To be able to restore | ||
329 | * the current selection it is remembered in m_oldSelection before the | 342 | * the current selection it is remembered in m_oldSelection before the | ||
330 | * rubberband gets activated. | 343 | * rubberband gets activated. | ||
331 | */ | 344 | */ | ||
332 | KItemSet m_oldSelection; | 345 | KItemSet m_oldSelection; | ||
Show All 22 Lines |