File indexing completed on 2024-05-19 04:55:59

0001 /**
0002  * \file iservertrackimporterfactory.h
0003  * Interface for server track importer factory.
0004  *
0005  * \b Project: Kid3
0006  * \author Urs Fleisch
0007  * \date 21 Jul 2013
0008  *
0009  * Copyright (C) 2013-2018  Urs Fleisch
0010  *
0011  * This file is part of Kid3.
0012  *
0013  * Kid3 is free software; you can redistribute it and/or modify
0014  * it under the terms of the GNU General Public License as published by
0015  * the Free Software Foundation; either version 2 of the License, or
0016  * (at your option) any later version.
0017  *
0018  * Kid3 is distributed in the hope that it will be useful,
0019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0021  * GNU General Public License for more details.
0022  *
0023  * You should have received a copy of the GNU General Public License
0024  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
0025  */
0026 
0027 #pragma once
0028 
0029 #include <QtPlugin>
0030 #include <QStringList>
0031 #include "kid3api.h"
0032 
0033 class QNetworkAccessManager;
0034 class TrackDataModel;
0035 class ServerTrackImporter;
0036 
0037 /**
0038  * Interface for server track importer factory.
0039  */
0040 class KID3_CORE_EXPORT IServerTrackImporterFactory {
0041 public:
0042   /**
0043    * Destructor.
0044    */
0045   virtual ~IServerTrackImporterFactory();
0046 
0047   /**
0048    * Get keys of available server importers.
0049    * @return list of keys.
0050    */
0051   virtual QStringList serverTrackImporterKeys() const = 0;
0052 
0053   /**
0054    * Create server importer.
0055    * @param key server importer key
0056    * @param netMgr network access manager
0057    * @param trackDataModel track data to be filled with imported values
0058    * @return server importer instance, 0 if key unknown.
0059    * @remarks The caller takes ownership of the returned instance.
0060    */
0061   virtual ServerTrackImporter* createServerTrackImporter(
0062       const QString& key,
0063       QNetworkAccessManager* netMgr, TrackDataModel* trackDataModel) = 0;
0064 };
0065 
0066 Q_DECLARE_INTERFACE(IServerTrackImporterFactory,
0067                     "org.kde.kid3.IServerTrackImporterFactory")