digiKam
mapdragdrophandler.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 : 2010-03-22
7  * Description : Drag-and-drop handler for geolocation interface integration.
8  *
9  * Copyright (C) 2010-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2010 by Michael G. Hansen <mike at mghansen dot de>
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_MAP_DRAG_DROP_HANDLER_H
26 #define DIGIKAM_MAP_DRAG_DROP_HANDLER_H
27 
28 // Qt includes
29 
30 #include <QAbstractItemModel>
31 #include <QMimeData>
32 
33 // Local includes
34 
35 #include "geodragdrophandler.h"
36 #include "digikam_export.h"
37 
38 namespace Digikam
39 {
40 
41 class GPSGeoIfaceModelHelper;
42 
43 class DIGIKAM_EXPORT MapDragData : public QMimeData
44 {
45  Q_OBJECT
46 
47 public:
48 
49  explicit MapDragData()
50  : QMimeData (),
51  draggedIndices()
52  {
53  }
54 
56 
57 private:
58 
59  // Disable
60  explicit MapDragData(QObject*) = delete;
61 };
62 
63 // -----------------------------------------------------------------------------------
64 
65 class DIGIKAM_EXPORT MapDragDropHandler : public GeoDragDropHandler
66 {
67  Q_OBJECT
68 
69 public:
70 
71  explicit MapDragDropHandler(QAbstractItemModel* const /*pModel*/,
72  GPSGeoIfaceModelHelper* const parent);
73  ~MapDragDropHandler() override;
74 
75  Qt::DropAction accepts(const QDropEvent* e) override;
76  bool dropEvent(const QDropEvent* e, const GeoCoordinates& dropCoordinates) override;
77  QMimeData* createMimeData(const QList<QPersistentModelIndex>& modelIndices) override;
78 
79 private:
80 
81  GPSGeoIfaceModelHelper* const gpsGeoIfaceModelHelper;
82 };
83 
84 } // namespace Digikam
85 
86 #endif // DIGIKAM_MAP_DRAG_DROP_HANDLER_H
Definition: gpsgeoifacemodelhelper.h:47
Definition: geocoordinates.h:49
Definition: geodragdrophandler.h:40
Definition: mapdragdrophandler.h:44
QList< QPersistentModelIndex > draggedIndices
Definition: mapdragdrophandler.h:55
MapDragData()
Definition: mapdragdrophandler.h:49
Definition: mapdragdrophandler.h:66
Definition: datefolderview.cpp:43
DropAction
Definition: itemdragdrop.cpp:60