| 1 | /* |
| 2 | This file is part of the KFileMetaData project |
| 3 | SPDX-FileCopyrightText: 2016 Varun Joshi <varunj.1011@gmail.com> |
| 4 | SPDX-FileCopyrightText: 2016 Vishesh Handa <me@vhanda.in> |
| 5 | |
| 6 | SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
| 7 | */ |
| 8 | |
| 9 | #ifndef KFILEMETADTA_WRITER_H |
| 10 | #define KFILEMETADTA_WRITER_H |
| 11 | |
| 12 | #include "kfilemetadata_export.h" |
| 13 | #include <QStringList> |
| 14 | |
| 15 | #include <memory> |
| 16 | |
| 17 | namespace KFileMetaData |
| 18 | { |
| 19 | |
| 20 | class WriteData; |
| 21 | class WriterCollection; |
| 22 | class WriterPrivate; |
| 23 | |
| 24 | /*! |
| 25 | * \class KFileMetaData::Writer |
| 26 | * \inheaderfile KFileMetaData/Writer |
| 27 | * \inmodule KFileMetaData |
| 28 | * |
| 29 | * \brief The Writer class is used to write data to a file. |
| 30 | */ |
| 31 | class KFILEMETADATA_EXPORT Writer |
| 32 | { |
| 33 | /*! |
| 34 | * \value AutoDeletePlugin |
| 35 | * \value DoNotDeletePlugin |
| 36 | */ |
| 37 | enum WriterPluginOwnership { |
| 38 | AutoDeletePlugin, |
| 39 | DoNotDeletePlugin, |
| 40 | }; |
| 41 | |
| 42 | public: |
| 43 | Writer(Writer&&); |
| 44 | virtual ~Writer(); |
| 45 | |
| 46 | /*! |
| 47 | * |
| 48 | */ |
| 49 | void write(const WriteData& data); |
| 50 | |
| 51 | /*! |
| 52 | * |
| 53 | */ |
| 54 | QStringList mimetypes() const; |
| 55 | |
| 56 | private: |
| 57 | KFILEMETADATA_NO_EXPORT Writer(); |
| 58 | |
| 59 | Writer(const Writer&) = delete; |
| 60 | void operator =(const Writer&) = delete; |
| 61 | |
| 62 | KFILEMETADATA_NO_EXPORT void setAutoDeletePlugin(WriterPluginOwnership autoDelete); |
| 63 | |
| 64 | std::unique_ptr<WriterPrivate> d; |
| 65 | friend class WriterPrivate; |
| 66 | friend class WriterCollectionPrivate; |
| 67 | }; |
| 68 | } |
| 69 | |
| 70 | #endif // KFILEMETADTA_WRITER_H |
| 71 | |