Qmmp
|
00001 /*************************************************************************** 00002 * Copyright (C) 2009-2015 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 EMGINEFACTORY_H 00022 #define EMGINEFACTORY_H 00023 00024 class QObject; 00025 class QString; 00026 class QIODevice; 00027 class QWidget; 00028 class QTranslator; 00029 class QStringList; 00030 class MetaDataModel; 00031 class FileInfo; 00032 class AbstractEngine; 00033 00037 class EngineProperties 00038 { 00039 public: 00043 EngineProperties() 00044 { 00045 hasAbout = false; 00046 hasSettings = false; 00047 } 00048 QString name; 00049 QString shortName; 00050 QStringList filters; 00051 QString description; 00052 QStringList contentTypes; 00053 QStringList protocols; 00054 bool hasAbout; 00055 bool hasSettings; 00056 }; 00060 class EngineFactory 00061 { 00062 public: 00066 virtual ~EngineFactory() {} 00070 virtual bool supports(const QString &source) const = 0; 00074 virtual const EngineProperties properties() const = 0; 00079 virtual AbstractEngine *create(QObject *parent = 0) = 0; 00088 virtual QList<FileInfo *> createPlayList(const QString &fileName, bool useMetaData, QStringList *ignoredPaths) = 0; 00095 virtual MetaDataModel* createMetaDataModel(const QString &path, QObject *parent = 0) = 0; 00100 virtual void showSettings(QWidget *parent) = 0; 00105 virtual void showAbout(QWidget *parent) = 0; 00110 virtual QTranslator *createTranslator(QObject *parent) = 0; 00111 }; 00112 00113 Q_DECLARE_INTERFACE(EngineFactory, "EngineFactory/1.0") 00114 00115 #endif