Qmmp
/usr/src/RPM/BUILD/qmmp-0.7-svn/src/qmmp/decoderfactory.h
00001 /***************************************************************************
00002  *   Copyright (C) 2006-2012 by Ilya Kotov                                 *
00003  *   forkotov02@hotmail.ru                                                 *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
00019  ***************************************************************************/
00020 
00021 #ifndef DECODERFACTORY_H
00022 #define DECODERFACTORY_H
00023 
00024 class QObject;
00025 class QString;
00026 class QIODevice;
00027 class QWidget;
00028 class QTranslator;
00029 class QStringList;
00030 
00031 class Decoder;
00032 class Output;
00033 class FileInfo;
00034 class MetaDataModel;
00035 
00039 class DecoderProperties
00040 {
00041 public:
00045     DecoderProperties()
00046     {
00047         hasAbout = false;
00048         hasSettings = false;
00049         noInput = false;
00050         noOutput = false;
00051         priority = 0;
00052     }
00053     QString name;             
00054     QString shortName;        
00055     QStringList filters;      
00056     QString description;      
00057     QStringList contentTypes; 
00058     QStringList protocols;    
00060     bool hasAbout;            
00061     bool hasSettings;         
00062     bool noInput;             
00063     bool noOutput;            
00064     int priority;             
00065 };
00069 class DecoderFactory
00070 {
00071 public:
00075     virtual ~DecoderFactory() {}
00079     virtual bool supports(const QString &source) const = 0;
00083     virtual bool canDecode(QIODevice *d) const = 0;
00087     virtual const DecoderProperties properties() const = 0;
00093     virtual Decoder *create(const QString &path , QIODevice *input = 0) = 0;
00100     virtual QList<FileInfo *> createPlayList(const QString &fileName, bool useMetaData) = 0;
00107     virtual MetaDataModel* createMetaDataModel(const QString &path, QObject *parent = 0) = 0;
00112     virtual void showSettings(QWidget *parent) = 0;
00117     virtual void showAbout(QWidget *parent) = 0;
00122     virtual QTranslator *createTranslator(QObject *parent) = 0;
00123 };
00124 
00125 Q_DECLARE_INTERFACE(DecoderFactory, "DecoderFactory/1.0")
00126 
00127 #endif
 All Classes Functions Variables Enumerations Enumerator