diff --git a/src/libtomahawk/resolvers/playlist/ExternalResolverPlaylistUpdater.cpp b/src/libtomahawk/resolvers/playlist/ExternalResolverPlaylistUpdater.cpp new file mode 100644 index 000000000..e0e147c8e --- /dev/null +++ b/src/libtomahawk/resolvers/playlist/ExternalResolverPlaylistUpdater.cpp @@ -0,0 +1,11 @@ +#include "ExternalResolverPlaylistUpdater.h" + +namespace Tomahawk { + +ExternalResolverPlaylistUpdater::ExternalResolverPlaylistUpdater( const playlist_ptr& pl, Resolver* resolver ) + : PlaylistUpdaterInterface( pl ) +{ + // TODO +} + +} // namespace Tomahawk diff --git a/src/libtomahawk/resolvers/playlist/ExternalResolverPlaylistUpdater.h b/src/libtomahawk/resolvers/playlist/ExternalResolverPlaylistUpdater.h new file mode 100644 index 000000000..d8f0687a9 --- /dev/null +++ b/src/libtomahawk/resolvers/playlist/ExternalResolverPlaylistUpdater.h @@ -0,0 +1,64 @@ +#ifndef TOMAHAWK_EXTERNALRESOLVERPLAYLISTUPDATER_H +#define TOMAHAWK_EXTERNALRESOLVERPLAYLISTUPDATER_H + +#include "playlist/PlaylistUpdaterInterface.h" + +namespace Tomahawk { + +class ExternalResolverPlaylistUpdater : public PlaylistUpdaterInterface +{ + Q_OBJECT +public: + explicit ExternalResolverPlaylistUpdater( const playlist_ptr& pl, Resolver* resolver ); + + virtual ~ExternalResolverPlaylistUpdater(); + + // What type you are. If you add a new updater, add the creation code as well. + // virtual QString type() const = 0; + + // Small widget to show in playlist header that configures the updater + // virtual QWidget* configurationWidget() const = 0; + + // Small overlay over playlist icon in the sidebar to indicate that it has this updater type + // Should be around 16x16 or something + // virtual QPixmap typeIcon() const { return QPixmap(); } + + // void remove(); + + // playlist_ptr playlist() const { return m_playlist; } + + // virtual bool sync() const { return false; } + // virtual void setSync( bool ) {} + + // virtual bool canSubscribe() const { return false; } + // virtual bool subscribed() const { return false; } + // virtual void setSubscribed( bool ) {} + // virtual void setCollaborative( bool ) {} + // virtual bool collaborative() const { return false; } + + // The int data value associated with each question must be unique across *all* playlist updaters, + // as setQuestionResults is called with all questions from all updaters. + // virtual bool hasCustomDeleter() const { return false; } + // virtual PlaylistDeleteQuestions deleteQuestions() const { return PlaylistDeleteQuestions(); } + // virtual void setQuestionResults( const QMap< int, bool > ) {} + +public slots: + // virtual void updateNow() {} + + // void save(); + +protected: + // virtual void aboutToDelete() {} + + // QVariantHash settings() const; + // void saveSettings( const QVariantHash& settings ); + +signals: + +public slots: + +}; + +} // namespace Tomahawk + +#endif // TOMAHAWK_EXTERNALRESOLVERPLAYLISTUPDATER_H diff --git a/src/libtomahawk/resolvers/playlist/ExternalResolverPlaylistUpdaterFactory.cpp b/src/libtomahawk/resolvers/playlist/ExternalResolverPlaylistUpdaterFactory.cpp new file mode 100644 index 000000000..5b08d11c9 --- /dev/null +++ b/src/libtomahawk/resolvers/playlist/ExternalResolverPlaylistUpdaterFactory.cpp @@ -0,0 +1,54 @@ +/* === This file is part of Tomahawk Player - === + * + * Copyright 2014, Uwe L. Korn + * + * Tomahawk is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Tomahawk is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Tomahawk. If not, see . + */ + +#include "ExternalResolverPlaylistUpdaterFactory.h" + +#include "Pipeline.h" + +namespace Tomahawk { + +ExternalResolverPlaylistUpdaterFactory::ExternalResolverPlaylistUpdaterFactory() +{ + connect( Pipeline::instance(), SIGNAL( resolverAdded(Tomahawk::Resolver* ) ), + SLOT( resolverAdded( Tomahawk::Resolver* ) ) ); +} + +ExternalResolverPlaylistUpdaterFactory::~ExternalResolverPlaylistUpdaterFactory() +{ +} + + +QString +ExternalResolverPlaylistUpdaterFactory::type() const +{ +} + + +PlaylistUpdaterInterface* +ExternalResolverPlaylistUpdaterFactory::create( const playlist_ptr& playlist, const QVariantHash& settings ) +{ +} + + +void +ExternalResolverPlaylistUpdaterFactory::resolverAdded( Resolver* resolver ) +{ +} + + +} // namespace Tomahawk diff --git a/src/libtomahawk/resolvers/playlist/ExternalResolverPlaylistUpdaterFactory.h b/src/libtomahawk/resolvers/playlist/ExternalResolverPlaylistUpdaterFactory.h new file mode 100644 index 000000000..a7aab5466 --- /dev/null +++ b/src/libtomahawk/resolvers/playlist/ExternalResolverPlaylistUpdaterFactory.h @@ -0,0 +1,45 @@ +/* === This file is part of Tomahawk Player - === + * + * Copyright 2014, Uwe L. Korn + * + * Tomahawk is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Tomahawk is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Tomahawk. If not, see . + */ + + +#ifndef TOMAHAWK_EXTERNALRESOLVERPLAYLISTUPDATERFACTORY_H +#define TOMAHAWK_EXTERNALRESOLVERPLAYLISTUPDATERFACTORY_H + +#include "playlist/PlaylistUpdaterInterface.h" + +#include "DllMacro.h" + +namespace Tomahawk { + +class DLLEXPORT ExternalResolverPlaylistUpdaterFactory : public PlaylistUpdaterFactory +{ + Q_OBJECT +public: + ExternalResolverPlaylistUpdaterFactory(); + virtual ~ExternalResolverPlaylistUpdaterFactory(); + + QString type() const Q_DECL_OVERRIDE; + PlaylistUpdaterInterface* create( const playlist_ptr&, const QVariantHash& settings ) Q_DECL_OVERRIDE; + +private slots: + void resolverAdded( Tomahawk::Resolver* resolver ); +}; + +} // namespace Tomahawk + +#endif // TOMAHAWK_EXTERNALRESOLVERPLAYLISTUPDATERFACTORY_H