KDeclarative

MimeDataWrapper.h
1 /*
2  SPDX-FileCopyrightText: 2015 Aleix Pol Gonzalez <[email protected]>
3 
4  SPDX-License-Identifier: MIT
5 */
6 
7 #ifndef MIMEDATAWRAPPER_H
8 #define MIMEDATAWRAPPER_H
9 
10 #include <QObject>
11 #include <QString>
12 #include <QJsonArray>
13 
14 class QMimeData;
15 class QObject;
21 class MimeDataWrapper : public QObject
22 {
23  Q_OBJECT
24 
28  Q_PROPERTY(QString text READ text CONSTANT)
29 
30 
33  Q_PROPERTY(QString html READ html CONSTANT)
34 
38  Q_PROPERTY(QUrl url READ url CONSTANT)
39 
44  Q_PROPERTY(QJsonArray urls READ urls CONSTANT)
45 
49  Q_PROPERTY(QVariant color READ color CONSTANT)
50 
54  Q_PROPERTY(QVariant source READ source CONSTANT)
55 
61  Q_PROPERTY(QStringList formats READ formats CONSTANT)
62 
66  Q_PROPERTY(bool hasUrls READ hasUrls CONSTANT)
67 
71  Q_PROPERTY(QMimeData* mimeData READ mimeData CONSTANT)
72 
73 public:
74  MimeDataWrapper(const QMimeData* data, QObject* parent);
75 
76  QString text() const;
77  QString html() const;
78  QUrl url() const;
79  QJsonArray urls() const;
80  bool hasUrls() const;
81  QVariant color() const;
82  QStringList formats() const;
83  QVariant source() const;
84  QMimeData* mimeData() const;
85 
86  Q_INVOKABLE QByteArray getDataAsByteArray(const QString& format);
87 
88 private:
89  const QMimeData* m_data;
90 };
91 
92 #endif
Q_OBJECTQ_OBJECT
Exposes a const QMimeData instance.
Q_PROPERTY(...)
Q_INVOKABLEQ_INVOKABLE
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Wed Jan 27 2021 22:38:28 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.