Debian Codegraph @

include/filedrag/dfiledragclient.h

raw
1 // SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
2 //
3 // SPDX-License-Identifier: LGPL-3.0-or-later
4
5 #ifndef DFILEDRAGCLIENT_H
6 #define DFILEDRAGCLIENT_H
7
8 #include "dfiledragcommon.h"
9
10 #include <dtkgui_global.h>
11 #include <DObject>
12
13 #include <QObject>
14
15 class QMimeData;
16
17 DGUI_BEGIN_NAMESPACE
18
19 class DFileDragClientPrivate;
20 class DFileDragClient : public QObject, public DCORE_NAMESPACE::DObject
21 {
22 Q_OBJECT
23 public:
24 explicit DFileDragClient(const QMimeData *data, QObject *parent = nullptr);
25 int progress() const;
26 DFileDragState state() const;
27
28 Q_SIGNALS:
29 void progressChanged(int progress);
30 void stateChanged(DFileDragState state);
31 void serverDestroyed();
32
33 public:
34 static bool checkMimeData(const QMimeData *data);
35 static void setTargetData(const QMimeData *data, QString key, QVariant value);
36 static void setTargetUrl(const QMimeData *data, QUrl url);
37
38 private:
39 D_DECLARE_PRIVATE(DFileDragClient)
40 };
41
42 DGUI_END_NAMESPACE
43
44 #endif // DFILEDRAGCLIENT_H