File indexing completed on 2024-04-28 04:21:22

0001 /* SPDX-FileCopyrightText: 2003-2010 Jesper K. Pedersen <blackie@kde.org>
0002 
0003    SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 #ifndef SELECTIONINTERACTION_H
0006 #define SELECTIONINTERACTION_H
0007 
0008 #include "MouseInteraction.h"
0009 #include "ThumbnailComponent.h"
0010 #include "enums.h"
0011 
0012 #include <kpabase/FileName.h>
0013 
0014 #include <QObject>
0015 
0016 class QMouseEvent;
0017 namespace ThumbnailView
0018 {
0019 class ThumbnailFactory;
0020 
0021 class SelectionInteraction : public QObject, public MouseInteraction, private ThumbnailComponent
0022 {
0023     Q_OBJECT
0024 
0025 public:
0026     explicit SelectionInteraction(ThumbnailFactory *factory);
0027     bool mousePressEvent(QMouseEvent *) override;
0028     bool mouseMoveEvent(QMouseEvent *) override;
0029     bool isDragging() const;
0030 
0031 protected:
0032     void startDrag();
0033 
0034 private:
0035     /**
0036      * This variable contains the position the mouse was pressed down.
0037      * The point is in contents coordinates.
0038      */
0039     QPoint m_mousePressPos;
0040 
0041     /**
0042      * Did the mouse interaction start with the mouse on top of an icon.
0043      */
0044     bool m_isMouseDragOperation;
0045 
0046     // PENDING(blackie) this instance variable is unused!
0047     DB::FileNameSet m_originalSelectionBeforeDragStart;
0048     bool m_dragInProgress;
0049 };
0050 }
0051 
0052 #endif /* SELECTIONINTERACTION_H */
0053 
0054 // vi:expandtab:tabstop=4 shiftwidth=4: