digiKam
tagdragdrop.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 : 2009-11-21
7  * Description : Qt Model for Tags - drag and drop handling
8  *
9  * Copyright (C) 2009 by Johannes Wienke <languitar at semipol dot de>
10  * Copyright (C) 2013-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option)
16  * any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * ============================================================ */
24 
25 #ifndef DIGIKAM_TAG_DRAG_DROP_H
26 #define DIGIKAM_TAG_DRAG_DROP_H
27 
28 // Local includes
29 
31 #include "albummodel.h"
32 
33 namespace Digikam
34 {
35 
37 {
38  Q_OBJECT
39 
40 public:
41 
42  explicit TagDragDropHandler(TagModel* const model);
43 
44  TagModel* model() const;
45 
46  bool dropEvent(QAbstractItemView* view,
47  const QDropEvent* e,
48  const QModelIndex& droppedOn) override;
49 
50  Qt::DropAction accepts(const QDropEvent* e,
51  const QModelIndex& dropIndex) override;
52 
53  QStringList mimeTypes() const override;
54  QMimeData* createMimeData(const QList<Album*>&) override;
55 
56 Q_SIGNALS:
57 
58  void assignTags(const QList<qlonglong>& imageIDs, const QList<int>& tagIDs);
59 };
60 
61 } // namespace Digikam
62 
63 #endif // DIGIKAM_TAG_DRAG_DROP_H
Definition: albummodeldragdrophandler.h:39
Definition: tagdragdrop.h:37
Qt::DropAction accepts(const QDropEvent *e, const QModelIndex &dropIndex) override
Definition: tagdragdrop.cpp:424
QStringList mimeTypes() const override
Definition: tagdragdrop.cpp:498
TagDragDropHandler(TagModel *const model)
Definition: tagdragdrop.cpp:53
void assignTags(const QList< qlonglong > &imageIDs, const QList< int > &tagIDs)
bool dropEvent(QAbstractItemView *view, const QDropEvent *e, const QModelIndex &droppedOn) override
Definition: tagdragdrop.cpp:63
QMimeData * createMimeData(const QList< Album * > &) override
Definition: tagdragdrop.cpp:508
TagModel * model() const
Definition: tagdragdrop.cpp:58
Definition: albummodel.h:63
Definition: datefolderview.cpp:43
DropAction
Definition: itemdragdrop.cpp:60