File indexing completed on 2024-03-24 04:57:12
0001 /* 0002 SPDX-FileCopyrightText: 2002 Rik Hemsley ( rikkus ) <rik@kde.org> 0003 SPDX-FileCopyrightText: 2002 Benjamin Meyer <ben-devel@meyerhome.net> 0004 SPDX-FileCopyrightText: 2002 Nadeem Hasan <nhasan@kde.org> 0005 0006 SPDX-License-Identifier: LGPL-2.0-or-later 0007 */ 0008 0009 #ifndef KCDDB_HTTP_LOOKUP_H 0010 #define KCDDB_HTTP_LOOKUP_H 0011 0012 #include "lookup.h" 0013 #include <QUrl> 0014 0015 namespace KIO 0016 { 0017 class Job; 0018 } 0019 0020 namespace KCDDB 0021 { 0022 class HTTPLookup : public Lookup 0023 { 0024 0025 Q_OBJECT 0026 0027 public: 0028 0029 enum State 0030 { 0031 Idle, 0032 WaitingForQueryResponse, 0033 WaitingForReadResponse 0034 }; 0035 0036 HTTPLookup(); 0037 virtual ~HTTPLookup(); 0038 0039 protected: 0040 0041 void initURL( const QString &, uint ); 0042 void makeURL( const QString & ); 0043 virtual Result fetchURL() = 0; 0044 0045 void jobFinished(); 0046 0047 Result sendQuery(); 0048 Result sendRead( const CDDBMatch & ); 0049 0050 Q_SIGNALS: 0051 0052 void queryReady(); 0053 void readReady(); 0054 0055 protected: 0056 0057 bool block_; 0058 QUrl cgiURL_; 0059 QByteArray data_; 0060 State state_; 0061 Result result_; 0062 }; 0063 } 0064 0065 #endif 0066 0067 // vim:tabstop=2:shiftwidth=2:expandtab:cinoptions=(s,U1,m1