digiKam
ddragobjects.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 : 2008-02-29
7  * Description : Drag object info containers.
8  *
9  * Copyright (C) 2008-2022 by Gilles Caulier <caulier dot gilles at gmail 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 DIGIKAM_DDRAG_OBJECTS_H
25 #define DIGIKAM_DDRAG_OBJECTS_H
26 
27 // Qt includes
28 
29 #include <QMimeData>
30 #include <QList>
31 #include <QStringList>
32 #include <QUrl>
33 
34 // Local includes
35 
36 #include "cameratype.h"
37 
38 class QWidget;
39 
40 namespace Digikam
41 {
42 
51 class DItemDrag : public QMimeData
52 {
53  Q_OBJECT
54 
55 public:
56 
57  DItemDrag(const QList<QUrl>& urls,
58  const QList<int>& albumIDs,
59  const QList<qlonglong>& imageIDs);
60 
61  static bool canDecode(const QMimeData* e);
62  static QStringList mimeTypes();
63  static bool decode(const QMimeData* e,
64  QList<QUrl>& urls,
65  QList<int>& albumIDs,
66  QList<qlonglong>& imageIDs);
67 
68 private:
69 
70  // Disable
71  explicit DItemDrag(QObject*) = delete;
72 };
73 
74 // ------------------------------------------------------------------------
75 
82 class DAlbumDrag : public QMimeData
83 {
84  Q_OBJECT
85 
86 public:
87 
88  DAlbumDrag(const QUrl& databaseUrl, int albumid, const QUrl& fileUrl = QUrl());
89  static QStringList mimeTypes();
90  static bool canDecode(const QMimeData* e);
91  static bool decode(const QMimeData* e, QList<QUrl>& urls, int& albumID);
92 
93 private:
94 
95  // Disable
96  explicit DAlbumDrag(QObject*) = delete;
97 };
98 
99 // ------------------------------------------------------------------------
100 
107 class DTagListDrag : public QMimeData
108 {
109  Q_OBJECT
110 
111 public:
112 
113  explicit DTagListDrag(const QList<int>& tagIDs);
114  static QStringList mimeTypes();
115  static bool canDecode(const QMimeData* e);
116  static bool decode(const QMimeData* e, QList<int>& tagIDs);
117 
118 private:
119 
120  // Disable
121  explicit DTagListDrag(QObject*) = delete;
122 };
123 
124 // ------------------------------------------------------------------------
125 
132 class DCameraItemListDrag : public QMimeData
133 {
134  Q_OBJECT
135 
136 public:
137 
138  explicit DCameraItemListDrag(const QStringList& cameraItemPaths);
139  static QStringList mimeTypes();
140  static bool canDecode(const QMimeData* e);
141  static bool decode(const QMimeData* e, QStringList& cameraItemPaths);
142 
143 private:
144 
145  // Disable
146  explicit DCameraItemListDrag(QObject*) = delete;
147 };
148 
149 // ------------------------------------------------------------------------
150 
157 class DCameraDragObject : public QMimeData
158 {
159  Q_OBJECT
160 
161 public:
162 
163  explicit DCameraDragObject(const CameraType& ctype);
164  static QStringList mimeTypes();
165  static bool canDecode(const QMimeData* e);
166  static bool decode(const QMimeData* e, CameraType& ctype);
167 
168 private:
169 
170  // Disable
171  explicit DCameraDragObject(QObject*) = delete;
172 };
173 
174 } // namespace Digikam
175 
176 #endif // DIGIKAM_DDRAG_OBJECTS_H
Definition: cameratype.h:41
Definition: ddragobjects.h:83
static bool decode(const QMimeData *e, QList< QUrl > &urls, int &albumID)
Definition: ddragobjects.cpp:183
static QStringList mimeTypes()
Definition: ddragobjects.cpp:159
DAlbumDrag(const QUrl &databaseUrl, int albumid, const QUrl &fileUrl=QUrl())
Definition: ddragobjects.cpp:138
static bool canDecode(const QMimeData *e)
Definition: ddragobjects.cpp:165
Definition: ddragobjects.h:158
DCameraDragObject(const CameraType &ctype)
Definition: ddragobjects.cpp:299
static bool decode(const QMimeData *e, CameraType &ctype)
Definition: ddragobjects.cpp:322
static bool canDecode(const QMimeData *e)
Definition: ddragobjects.cpp:317
static QStringList mimeTypes()
Definition: ddragobjects.cpp:312
Definition: ddragobjects.h:133
static bool decode(const QMimeData *e, QStringList &cameraItemPaths)
Definition: ddragobjects.cpp:276
DCameraItemListDrag(const QStringList &cameraItemPaths)
Definition: ddragobjects.cpp:257
static bool canDecode(const QMimeData *e)
Definition: ddragobjects.cpp:271
static QStringList mimeTypes()
Definition: ddragobjects.cpp:266
Definition: ddragobjects.h:52
static QStringList mimeTypes()
Definition: ddragobjects.cpp:64
static bool decode(const QMimeData *e, QList< QUrl > &urls, QList< int > &albumIDs, QList< qlonglong > &imageIDs)
Definition: ddragobjects.cpp:87
DItemDrag(const QList< QUrl > &urls, const QList< int > &albumIDs, const QList< qlonglong > &imageIDs)
Definition: ddragobjects.cpp:35
static bool canDecode(const QMimeData *e)
Definition: ddragobjects.cpp:74
Definition: ddragobjects.h:108
static QStringList mimeTypes()
Definition: ddragobjects.cpp:224
static bool canDecode(const QMimeData *e)
Definition: ddragobjects.cpp:229
static bool decode(const QMimeData *e, QList< int > &tagIDs)
Definition: ddragobjects.cpp:234
DTagListDrag(const QList< int > &tagIDs)
Definition: ddragobjects.cpp:215
Definition: datefolderview.cpp:43