File indexing completed on 2024-04-21 04:54:19

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_LOOKUP_H
0010 #define KCDDB_LOOKUP_H
0011 
0012 #include "cddb.h"
0013 #include "cdinfo.h"
0014 
0015 #include <QList>
0016 #include <QObject>
0017 #include <QPair>
0018 
0019 namespace KCDDB
0020 {
0021   typedef QPair<QString, QString> CDDBMatch;
0022   typedef QList<CDDBMatch> CDDBMatchList;
0023 
0024   class Lookup : public CDDB, public QObject
0025   {
0026     public:
0027 
0028       enum Transport
0029       {
0030         CDDBP,
0031         HTTP
0032       };
0033 
0034 
0035       Lookup();
0036       virtual ~Lookup();
0037 
0038       virtual Result lookup( const QString &, uint, const TrackOffsetList & ) = 0;
0039 
0040       CDInfoList lookupResponse() const;
0041 
0042     protected:
0043 
0044       void parseExtraMatch(  const QString & );
0045       Result parseQuery(  const QString & );
0046       Result parseRead(  const QString & );
0047 
0048       CDInfoList cdInfoList_;
0049       CDDBMatchList matchList_;
0050       QString category_;
0051       QString discid_;
0052   };
0053 }
0054 
0055 #endif // KCDDB_LOOKUP_H
0056 // vim:tabstop=2:shiftwidth=2:expandtab:cinoptions=(s,U1,m1