File indexing completed on 2024-05-12 15:56:40

0001 /* This file is part of the KDE project
0002  * SPDX-FileCopyrightText: 2007 Thorsten Zachmann <zachmann@kde.org>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.0-or-later
0005  */
0006 
0007 #ifndef KODRAG_H
0008 #define KODRAG_H
0009 
0010 #include "kritaflake_export.h"
0011 
0012 #include <QList>
0013 
0014 class QMimeData;
0015 class QString;
0016 class QByteArray;
0017 class KoDragPrivate;
0018 class KoShape;
0019 
0020 /**
0021  * Class for simplifying adding a odf to the clip board
0022  *
0023  * For saving the odf a KoDragOdfSaveHelper class is used.
0024  * It implements the writing of the body of the document. The
0025  * setOdf takes care of saving styles and all the other
0026  * common stuff.
0027  */
0028 class KRITAFLAKE_EXPORT KoDrag
0029 {
0030 public:
0031     KoDrag();
0032     ~KoDrag();
0033 
0034 
0035     /**
0036      * Load SVG data into the current mime data
0037      */
0038     bool setSvg(const QList<KoShape*> shapes);
0039 
0040     /**
0041      * Add additional mimeTypes
0042      */
0043     void setData(const QString &mimeType, const QByteArray &data);
0044 
0045     /**
0046      * Add the mimeData to the clipboard
0047      */
0048     void addToClipboard();
0049 
0050     /**
0051      * Get the mime data
0052      *
0053      * This transfers the ownership of the mimeData to the caller
0054      *
0055      * This function is for use in automated tests
0056      */
0057     QMimeData *mimeData();
0058 
0059 private:
0060     KoDragPrivate * const d;
0061 };
0062 
0063 #endif /* KODRAG_H */