1 /* This file is part of the KDE libraries 2 3 Copyright (c) 2007 Jos van den Oever <jos@vandenoever.info> 4 5 This library is free software; you can redistribute it and/or 6 modify it under the terms of the GNU Library General Public 7 License (LGPL) as published by the Free Software Foundation; either 8 version 2 of the License, or (at your option) any later version. 9 10 This library is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 Library General Public License for more details. 14 15 You should have received a copy of the GNU Library General Public License 16 along with this library; see the file COPYING.LIB. If not, write to 17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 Boston, MA 02110-1301, USA. 19 */ 20 #ifndef KFILEWRITEPLUGIN_H 21 #define KFILEWRITEPLUGIN_H 22 23 #include <kdelibs4support_export.h> 24 #include <QVariant> 25 26 class QUrl; 27 28 class KDELIBS4SUPPORT_DEPRECATED_EXPORT KFileWritePlugin : public QObject 29 { 30 Q_OBJECT 31 friend class KFileWriterProvider; 32 public: 33 /** 34 * @brief Constructor that initializes the object as a QObject. 35 **/ 36 KFileWritePlugin(QObject *parent, const QStringList &args); 37 /** 38 * @brief Destructor 39 **/ 40 ~KFileWritePlugin() override; 41 /** 42 * @brief determine if this plugin can write a value into a particular 43 * resource. 44 **/ 45 virtual bool canWrite(const QUrl &file, const QString &key) = 0; 46 /** 47 * @brief Write a set of values into a resource pointed to by @p file. 48 **/ 49 virtual bool write(const QUrl &file, const QVariantMap &data) = 0; 50 51 private: 52 class Private; 53 Private *const d; 54 }; 55 56 #endif 57