File indexing completed on 2024-05-05 04:49:15

0001 /****************************************************************************************
0002  * Copyright (c) 2007 Nikolaj Hald Nielsen <nhn@kde.org>                                *
0003  *                                                                                      *
0004  * This program is free software; you can redistribute it and/or modify it under        *
0005  * the terms of the GNU General Public License as published by the Free Software        *
0006  * Foundation; either version 2 of the License, or (at your option) any later           *
0007  * version.                                                                             *
0008  *                                                                                      *
0009  * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
0010  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
0011  * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
0012  *                                                                                      *
0013  * You should have received a copy of the GNU General Public License along with         *
0014  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
0015  ****************************************************************************************/
0016 
0017 #ifndef INFOPARSERBASE_H
0018 #define INFOPARSERBASE_H
0019 
0020 #include "amarok_export.h"
0021 #include "core/meta/forward_declarations.h"
0022 
0023 #include <QObject>
0024 
0025 /**
0026   Abstract base class for info parsers
0027 */
0028 class AMAROK_EXPORT InfoParserBase  : public QObject
0029 {
0030     Q_OBJECT
0031 
0032 public:
0033     InfoParserBase();
0034 
0035      /**
0036      * Fetches info about artist and emits info( QString )
0037      * with a ready to show html page when the info is ready
0038      * @param artist The artist to get info about
0039      */
0040     virtual void getInfo( const Meta::ArtistPtr &artist ) = 0;
0041 
0042     /**
0043      * Overloaded function
0044      * Fetches info about album and emits info( QString )
0045      * with a ready to show html page when the info is ready
0046      * @param album The album to get info about
0047      */
0048     virtual void getInfo( const Meta::AlbumPtr &album ) = 0;
0049 
0050     /**
0051      * Overloaded function
0052      * Fetches info about track and emits info( QString )
0053      * with a ready to show html page when the info is ready
0054      * @param track The track to get info about
0055      */
0056     virtual void getInfo( const Meta::TrackPtr &track ) = 0;
0057 
0058     void showLoading( const QString &message );
0059 
0060 Q_SIGNALS:
0061     /**
0062      * Signal emitted when new html info is ready to be shown
0063      * @param info The string containing the html formatted information
0064      */
0065     void info( const QString &info );
0066 
0067 private:
0068     static QString s_loadingBaseHtml;
0069 };
0070 
0071 #endif