File indexing completed on 2025-01-19 03:57:34

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2014-01-28
0007  * Description : drag and drop handling for Showfoto
0008  *
0009  * SPDX-FileCopyrightText: 2014 by Mohamed_Anwer <m_dot_anwer at gmx dot com>
0010  *
0011  * SPDX-License-Identifier: GPL-2.0-or-later
0012  *
0013  * ============================================================ */
0014 
0015 #ifndef SHOW_FOTO_DRAG_DROP_HANDLER_H
0016 #define SHOW_FOTO_DRAG_DROP_HANDLER_H
0017 
0018 // KDE includes
0019 
0020 #include <QMenu>
0021 
0022 // Local includes
0023 
0024 #include "abstractitemdragdrophandler.h"
0025 #include "showfotoitemmodel.h"
0026 #include "ddragobjects.h"
0027 
0028 namespace ShowFoto
0029 {
0030 
0031 class ShowfotoDragDropHandler : public AbstractItemDragDropHandler
0032 {
0033     Q_OBJECT
0034 
0035 public:
0036 
0037     explicit ShowfotoDragDropHandler(ShowfotoItemModel* const model);
0038 
0039     ShowfotoItemModel* model()                                                                           const;
0040 
0041     bool           dropEvent(QAbstractItemView* view, const QDropEvent* e, const QModelIndex& droppedOn)       override;
0042     Qt::DropAction accepts(const QDropEvent* e, const QModelIndex& dropIndex)                                  override;
0043     QStringList    mimeTypes()                                                                           const override;
0044     QMimeData*     createMimeData(const QList<QModelIndex>&)                                                   override;
0045 
0046 Q_SIGNALS:
0047 
0048     void signalDroppedUrls(const QList<QUrl>& droppedUrls, bool dropped, const QUrl& current);
0049 
0050 private:
0051 
0052     QAction* addGroupAction(QMenu* const menu);
0053     QAction* addCancelAction(QMenu* const menu);
0054 };
0055 
0056 } // namespace Showfoto
0057 
0058 #endif // SHOW_FOTO_DRAG_DROP_HANDLER_H