1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/* ============================================================
 *
 * This file is a part of digiKam project
 * https://www.digikam.org
 *
 * Date        : 2014-01-28
 * Description : drag and drop handling for Showfoto
 *
 * SPDX-FileCopyrightText: 2014 by Mohamed_Anwer <m_dot_anwer at gmx dot com>
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 *
 * ============================================================ */

#ifndef SHOW_FOTO_DRAG_DROP_HANDLER_H
#define SHOW_FOTO_DRAG_DROP_HANDLER_H

// KDE includes

#include <QMenu>

// Local includes

#include "abstractitemdragdrophandler.h"
#include "showfotoitemmodel.h"
#include "ddragobjects.h"

namespace ShowFoto
{

class ShowfotoDragDropHandler : public AbstractItemDragDropHandler
{
    Q_OBJECT

public:

    explicit ShowfotoDragDropHandler(ShowfotoItemModel* const model);

    ShowfotoItemModel* model()                                                                           const;<--- Derived function 'ShowfotoDragDropHandler::model'

    bool           dropEvent(QAbstractItemView* view, const QDropEvent* e, const QModelIndex& droppedOn)       override;
    Qt::DropAction accepts(const QDropEvent* e, const QModelIndex& dropIndex)                                  override;
    QStringList    mimeTypes()                                                                           const override;
    QMimeData*     createMimeData(const QList<QModelIndex>&)                                                   override;

Q_SIGNALS:

    void signalDroppedUrls(const QList<QUrl>& droppedUrls, bool dropped, const QUrl& current);

private:

    QAction* addGroupAction(QMenu* const menu);
    QAction* addCancelAction(QMenu* const menu);
};

} // namespace Showfoto

#endif // SHOW_FOTO_DRAG_DROP_HANDLER_H