Warning, file /office/calligra/libs/flake/KoDrag.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /* This file is part of the KDE project
0002  * Copyright (C) 2007 Thorsten Zachmann <zachmann@kde.org>
0003  *
0004  * This library is free software; you can redistribute it and/or
0005  * modify it under the terms of the GNU Library General Public
0006  * License as published by the Free Software Foundation; either
0007  * version 2 of the License, or (at your option) any later version.
0008  *
0009  * This library is distributed in the hope that it will be useful,
0010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012  * Library General Public License for more details.
0013  *
0014  * You should have received a copy of the GNU Library General Public License
0015  * along with this library; see the file COPYING.LIB.  If not, write to
0016  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0017  * Boston, MA 02110-1301, USA.
0018  */
0019 
0020 #ifndef KODRAG_H
0021 #define KODRAG_H
0022 
0023 #include "flake_export.h"
0024 
0025 class QMimeData;
0026 class QString;
0027 class QByteArray;
0028 class KoDragOdfSaveHelper;
0029 class KoDragPrivate;
0030 
0031 /**
0032  * Class for simplifying adding a odf to the clip board
0033  *
0034  * For saving the odf a KoDragOdfSaveHelper class is used.
0035  * It implements the writing of the body of the document. The
0036  * setOdf takes care of saving styles and all the other
0037  * common stuff.
0038  */
0039 class FLAKE_EXPORT KoDrag
0040 {
0041 public:
0042     KoDrag();
0043     ~KoDrag();
0044 
0045     /**
0046      * Set odf mime type
0047      *
0048      * This calls helper.writeBody();
0049      *
0050      * @param mimeType used for creating the odf document
0051      * @param helper helper for saving the body of the odf document
0052      */
0053     bool setOdf(const char *mimeType, KoDragOdfSaveHelper &helper);
0054 
0055     /**
0056      * Add additional mimeTypes
0057      */
0058     void setData(const QString &mimeType, const QByteArray &data);
0059 
0060     /**
0061      * Add the mimeData to the clipboard
0062      */
0063     void addToClipboard();
0064 
0065     /**
0066      * Get the mime data
0067      *
0068      * This transfers the ownership of the mimeData to the caller
0069      *
0070      * This function is for use in automated tests
0071      */
0072     QMimeData *mimeData();
0073 
0074 private:
0075     KoDragPrivate * const d;
0076 };
0077 
0078 #endif /* KODRAG_H */