home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / libkcddb / client.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-09-10  |  2.7 KB  |  105 lines

  1. /*
  2.   Copyright (C) 2002 Rik Hemsley (rikkus) <rik@kde.org>
  3.   Copyright (C) 2002 Benjamin Meyer <ben-devel@meyerhome.net>
  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 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., 59 Temple Place - Suite 330,
  18.   Boston, MA 02111-1307, USA.
  19. */
  20.  
  21. #ifndef KCDDB_CLIENT_H
  22. #define KCDDB_CLIENT_H
  23.  
  24. #include "config.h"
  25. #include "cdinfo.h"
  26. #include <qobject.h>
  27. #include "cddb.h"
  28. #include <kdemacros.h>
  29.  
  30. namespace KCDDB
  31. {
  32.   class Lookup;
  33.   class Submit;
  34.  
  35.   /**
  36.    * Class used to obtain CDDB information about a CD
  37.    * 
  38.    * Example:
  39.    * <code>KCDDB::Client *cddb = new KCDDB::Client();
  40.    * cddb->lookup(discSignature);
  41.    * CDInfo info = cddb->bestLookupResponse();</code>
  42.    */
  43.   class KDE_EXPORT Client : public QObject
  44.   {
  45.     Q_OBJECT
  46.  
  47.     public:
  48.  
  49.       /**
  50.        * Uses settings read from config.
  51.        */
  52.       Client();
  53.  
  54.       virtual ~Client();
  55.  
  56.       Config & config() const;
  57.  
  58.       /**
  59.        * @return a list of CDDB entries that match the disc signature
  60.        */
  61.       CDInfoList lookupResponse() const;
  62.       /**
  63.        * @return a the CDDB entries that is the best match to the disc signature
  64.        */
  65.       CDInfo bestLookupResponse() const;
  66.  
  67.       /**
  68.        * @return if the results of the lookup: Success, NoRecordFound, etc
  69.        */
  70.       CDDB::Result lookup(const TrackOffsetList &trackOffsetList);
  71.       /**
  72.        * @returns the results of trying to submit
  73.        */
  74.       CDDB::Result submit(const CDInfo &cdInfo, const TrackOffsetList &trackOffsetList);
  75.  
  76.       void setBlockingMode( bool );
  77.       bool blockingMode() const;
  78.  
  79.     signals:
  80.       /**
  81.        * emited when not blocking and lookup() finished.
  82.        */
  83.       void finished( CDDB::Result result );
  84.  
  85.     protected slots:
  86.       /**
  87.        * Called when the lookup is finished with the result
  88.        */ 
  89.       void slotFinished( CDDB::Result result );
  90.       /**
  91.        * Called when the submit is finished with the result
  92.        */
  93.       void slotSubmitFinished( CDDB::Result result );
  94.  
  95.     private:
  96.       class Private;
  97.       Private * d;
  98.       Lookup * cdInfoLookup;
  99.       Submit * cdInfoSubmit;
  100.   };
  101. }
  102.  
  103. #endif // KCDDB_CLIENT_H
  104. // vim:tabstop=2:shiftwidth=2:expandtab:cinoptions=(s,U1,m1
  105.