Qmmp
|
00001 /*************************************************************************** 00002 * Copyright (C) 2006-2017 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 priority = 0; 00051 } 00052 QString name; 00053 QString shortName; 00054 QStringList filters; 00055 QString description; 00056 QStringList contentTypes; 00057 QStringList protocols; 00059 bool hasAbout; 00060 bool hasSettings; 00061 bool noInput; 00062 int priority; 00063 }; 00067 class DecoderFactory 00068 { 00069 public: 00073 virtual ~DecoderFactory() {} 00077 virtual bool canDecode(QIODevice *d) const = 0; 00081 virtual const DecoderProperties properties() const = 0; 00087 virtual Decoder *create(const QString &path, QIODevice *input = 0) = 0; 00096 virtual QList<FileInfo *> createPlayList(const QString &fileName, bool useMetaData, QStringList *ignoredPaths) = 0; 00103 virtual MetaDataModel* createMetaDataModel(const QString &path, QObject *parent = 0) = 0; 00108 virtual void showSettings(QWidget *parent) = 0; 00113 virtual void showAbout(QWidget *parent) = 0; 00118 virtual QTranslator *createTranslator(QObject *parent) = 0; 00119 }; 00120 00121 Q_DECLARE_INTERFACE(DecoderFactory, "DecoderFactory/1.0") 00122 00123 #endif