digiKam
Loading...
Searching...
No Matches
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 * SPDX-FileCopyrightText: 2010-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
10 * SPDX-FileCopyrightText: 2010 by Michael G. Hansen <mike at mghansen dot de>
11 *
12 * SPDX-License-Identifier: GPL-2.0-or-later
13 *
14 * ============================================================ */
15
16#pragma once
17
18// Qt includes
19
20#include <QAbstractItemModel>
21#include <QMimeData>
22
23// Local includes
24
25#include "geodragdrophandler.h"
26#include "digikam_export.h"
27
28namespace Digikam
29{
30
31class GPSGeoIfaceModelHelper;
32
33class DIGIKAM_EXPORT MapDragData : public QMimeData
34{
35 Q_OBJECT
36
37public:
38
39 explicit MapDragData()
40 : QMimeData (),
41 draggedIndices()
42 {
43 }
44
45 QList<QPersistentModelIndex> draggedIndices;
46
47private:
48
49 // Disable
50 explicit MapDragData(QObject*) = delete;
51};
52
53// -----------------------------------------------------------------------------------
54
55class DIGIKAM_EXPORT MapDragDropHandler : public GeoDragDropHandler
56{
57 Q_OBJECT
58
59public:
60
61 explicit MapDragDropHandler(QAbstractItemModel* const /*pModel*/,
62 GPSGeoIfaceModelHelper* const parent);
63 ~MapDragDropHandler() override = default;
64
65 Qt::DropAction accepts(const QDropEvent* e) override;
66 bool dropEvent(const QDropEvent* e, const GeoCoordinates& dropCoordinates) override;
67 QMimeData* createMimeData(const QList<QPersistentModelIndex>& modelIndices) override;
68
69private:
70
71 GPSGeoIfaceModelHelper* const gpsGeoIfaceModelHelper = nullptr;
72};
73
74} // namespace Digikam
Definition gpsgeoifacemodelhelper.h:37
Definition geocoordinates.h:44
Definition geodragdrophandler.h:30
Definition mapdragdrophandler.h:34
QList< QPersistentModelIndex > draggedIndices
Definition mapdragdrophandler.h:45
MapDragData()
Definition mapdragdrophandler.h:39
Definition mapdragdrophandler.h:56
~MapDragDropHandler() override=default
Definition datefolderview.cpp:34