1 /* 2 Interface of the KDE data protocol core operations 3 4 SPDX-FileCopyrightText: 2002 Leo Savernik <l.savernik@aon.at> 5 6 SPDX-License-Identifier: LGPL-2.0-only 7 */ 8 9 #ifndef DATAPROTOCOL_H 10 #define DATAPROTOCOL_H 11 12 // dataprotocol.* interprets the following defines 13 // TESTKIO: define for test-driving 14 // Both defines are mutually exclusive. Defining none of them compiles 15 // DataProtocol for internal usage within libkiocore. 16 17 /* Wondering what this is all about? Leo explained it to me: 18 * 19 * That's simple, you can compile it into a standalone executable that is 20 * registered like any other kioslave. 21 * 22 * However, given that data-urls don't depend on any external data it seemed 23 * overkill, therefore I added a special hack that the kio-dataslave is invoked 24 * in-process on the client side. 25 */ 26 27 class QByteArray; 28 29 class QUrl; 30 31 #if !defined(TESTKIO) 32 #include "dataslave_p.h" 33 #endif 34 35 namespace KIO 36 { 37 /** This kioslave provides support of data urls as specified by rfc 2397 38 * @see http://www.ietf.org/rfc/rfc2397.txt 39 * @author Leo Savernik 40 */ 41 #if defined(TESTKIO) 42 class DataProtocol : public TestSlave 43 { 44 #else 45 class DataProtocol : public DataSlave 46 { 47 Q_OBJECT 48 #endif 49 50 public: 51 DataProtocol(); 52 53 #if defined(TESTKIO) 54 void mimetype(const QUrl &url); 55 void get(const QUrl &url); 56 #else 57 void mimetype(const QUrl &url) override; 58 void get(const QUrl &url) override; 59 #endif 60 ~DataProtocol() override; 61 }; 62 63 } /*end namespace*/ 64 65 #endif 66