digiKam
albummodeldragdrophandler.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-04-16
7  * Description : Qt Model for Albums - drag and drop handling
8  *
9  * Copyright (C) 2009-2010 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
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 DIGIKAM_ALBUM_MODEL_DRAG_DROP_HANDLER_H
25 #define DIGIKAM_ALBUM_MODEL_DRAG_DROP_HANDLER_H
26 
27 // Qt includes
28 
29 #include <QAbstractItemModel>
30 #include <QAbstractItemView>
31 
32 namespace Digikam
33 {
34 
35 class Album;
36 class AbstractAlbumModel;
37 
38 class AlbumModelDragDropHandler : public QObject
39 {
40  Q_OBJECT
41 
42 public:
43 
45  ~AlbumModelDragDropHandler() override;
46 
47  AbstractAlbumModel* model() const;
48 
55  virtual bool dropEvent(QAbstractItemView* view, const QDropEvent* e, const QModelIndex& droppedOn);
56 
61  virtual Qt::DropAction accepts(const QDropEvent* e, const QModelIndex& dropIndex);
62 
67  virtual QStringList mimeTypes() const;
68 
72  virtual QMimeData* createMimeData(const QList<Album*>&);
73 
81  virtual bool acceptsMimeData(const QMimeData* data);
82 
83 protected:
84 
86 };
87 
88 } // namespace Digikam
89 
90 #endif // DIGIKAM_ALBUM_MODEL_DRAG_DROP_HANDLER_H
Definition: abstractalbummodel.h:49
Definition: albummodeldragdrophandler.h:39
AbstractAlbumModel * model() const
Definition: albummodeldragdrophandler.cpp:47
AbstractAlbumModel * m_model
Definition: albummodeldragdrophandler.h:85
virtual QMimeData * createMimeData(const QList< Album * > &)
Definition: albummodeldragdrophandler.cpp:67
virtual Qt::DropAction accepts(const QDropEvent *e, const QModelIndex &dropIndex)
Definition: albummodeldragdrophandler.cpp:57
AlbumModelDragDropHandler(AbstractAlbumModel *model)
Definition: albummodeldragdrophandler.cpp:37
~AlbumModelDragDropHandler() override
Definition: albummodeldragdrophandler.cpp:43
virtual QStringList mimeTypes() const
Definition: albummodeldragdrophandler.cpp:62
virtual bool dropEvent(QAbstractItemView *view, const QDropEvent *e, const QModelIndex &droppedOn)
Definition: albummodeldragdrophandler.cpp:52
virtual bool acceptsMimeData(const QMimeData *data)
Definition: albummodeldragdrophandler.cpp:72
@ Album
Definition: coredbfields.h:58
Definition: datefolderview.cpp:43
DropAction
Definition: itemdragdrop.cpp:60