digiKam
showfotodragdrophandler.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2014-01-28
7  * Description : drag and drop handling for Showfoto
8  *
9  * Copyright (C) 2014 by Mohamed_Anwer <m_dot_anwer at gmx dot com>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option)
15  * any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef SHOW_FOTO_DRAG_DROP_HANDLER_H
25 #define SHOW_FOTO_DRAG_DROP_HANDLER_H
26 
27 // KDE includes
28 
29 #include <QMenu>
30 
31 // Local includes
32 
34 #include "showfotoitemmodel.h"
35 #include "ddragobjects.h"
36 
37 namespace ShowFoto
38 {
39 
41 {
42  Q_OBJECT
43 
44 public:
45 
47 
48  ShowfotoItemModel* model() const;
49 
50  bool dropEvent(QAbstractItemView* view, const QDropEvent* e, const QModelIndex& droppedOn) override;
51  Qt::DropAction accepts(const QDropEvent* e, const QModelIndex& dropIndex) override;
52  QStringList mimeTypes() const override;
53  QMimeData* createMimeData(const QList<QModelIndex>&) override;
54 
55 Q_SIGNALS:
56 
57  void signalDroppedUrls(const QList<QUrl>& droppedUrls, bool dropped, const QUrl& current);
58 
59 private:
60 
61  QAction* addGroupAction(QMenu* const menu);
62  QAction* addCancelAction(QMenu* const menu);
63 };
64 
65 } // namespace Showfoto
66 
67 #endif // SHOW_FOTO_DRAG_DROP_HANDLER_H
Definition: abstractitemdragdrophandler.h:42
Definition: showfotodragdrophandler.h:41
ShowfotoDragDropHandler(ShowfotoItemModel *const model)
Definition: showfotodragdrophandler.cpp:46
void signalDroppedUrls(const QList< QUrl > &droppedUrls, bool dropped, const QUrl &current)
Qt::DropAction accepts(const QDropEvent *e, const QModelIndex &dropIndex) override
Definition: showfotodragdrophandler.cpp:78
bool dropEvent(QAbstractItemView *view, const QDropEvent *e, const QModelIndex &droppedOn) override
Definition: showfotodragdrophandler.cpp:62
QMimeData * createMimeData(const QList< QModelIndex > &) override
Definition: showfotodragdrophandler.cpp:96
QStringList mimeTypes() const override
Definition: showfotodragdrophandler.cpp:88
ShowfotoItemModel * model() const
Definition: showfotodragdrophandler.cpp:118
Definition: showfotoitemmodel.h:47
DropAction
Definition: itemdragdrop.cpp:60
Definition: showfotofolderviewbar.cpp:52