1 /****************************************************************************************
2  * Copyright (c) 2011 Lucas Lira Gomes <x8lucas8x@gmail.com>                            *
3  *                                                                                      *
4  * This program is free software; you can redistribute it and/or modify it under        *
5  * the terms of the GNU General Public License as published by the Free Software        *
6  * Foundation; either version 2 of the License, or (at your option) any later           *
7  * version.                                                                             *
8  *                                                                                      *
9  * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
10  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
11  * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
12  *                                                                                      *
13  * You should have received a copy of the GNU General Public License along with         *
14  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
15  ****************************************************************************************/
16 
17 #ifndef SYNCEDPODCAST_H
18 #define SYNCEDPODCAST_H
19 
20 #include "core/podcasts/PodcastMeta.h"
21 #include "playlistmanager/SyncedPlaylist.h"
22 
23 class SyncedPodcast : public SyncedPlaylist, public Podcasts::PodcastChannel
24 {
25     public:
26         explicit SyncedPodcast( Podcasts::PodcastChannelPtr podcast );
~SyncedPodcast()27         ~SyncedPodcast() override {}
28 
29         //Playlist virtual methods
name()30         QString name() const override { return title(); }
31 
32         //PodcastMetaCommon methods
title()33         QString title() const override { return m_master->title(); }
description()34         QString description() const override { return m_master->description(); }
keywords()35         QStringList keywords() const override { return m_master->keywords(); }
subtitle()36         QString subtitle() const override { return m_master->subtitle(); }
summary()37         QString summary() const override { return m_master->summary(); }
author()38         QString author() const override { return m_master->author(); }
39 
40         //Podcasts::PodcastChannel methods
url()41         QUrl url() const override { return m_master->url(); }
webLink()42         QUrl webLink() const override { return m_master->webLink(); }
hasImage()43         bool hasImage() const override { return m_master->hasImage(); }
imageUrl()44         QUrl imageUrl() const override { return m_master->imageUrl(); }
image()45         QImage image() const override { return m_master->image(); }
copyright()46         QString copyright() const override { return m_master->copyright(); }
labels()47         QStringList labels() const override { return m_master->labels(); }
subscribeDate()48         QDate subscribeDate() const override { return m_master->subscribeDate(); }
49 
setUrl(const QUrl & url)50         void setUrl( const QUrl &url ) override { m_master->setUrl( url ); }
setWebLink(const QUrl & link)51         void setWebLink( const QUrl &link ) override { m_master->setWebLink( link ); }
setImage(const QImage & image)52         void setImage( const QImage &image ) override { m_master->setImage( image ); }
setImageUrl(const QUrl & imageUrl)53         void setImageUrl( const QUrl &imageUrl ) override { m_master->setImageUrl( imageUrl ); }
setCopyright(const QString & copyright)54         void setCopyright( const QString &copyright ) override { m_master->setCopyright( copyright ); }
setLabels(const QStringList & labels)55         void setLabels( const QStringList &labels ) override { m_master->setLabels( labels ); }
addLabel(const QString & label)56         void addLabel( const QString &label ) override { m_master->addLabel( label ); }
setSubscribeDate(const QDate & date)57         void setSubscribeDate( const QDate &date ) override { m_master->setSubscribeDate( date ); }
58 
addEpisode(const Podcasts::PodcastEpisodePtr & episode)59         Podcasts::PodcastEpisodePtr addEpisode( const Podcasts::PodcastEpisodePtr &episode ) override
60         {
61             return m_master->addEpisode( episode );
62         }
episodes()63         Podcasts::PodcastEpisodeList episodes() const override { return m_master->episodes(); }
64 
load(QTextStream & stream)65         bool load( QTextStream &stream ) { return m_master->load( stream ); }
66 
67         //Settings
saveLocation()68         virtual QUrl saveLocation() const { return m_master->saveLocation(); }
autoScan()69         virtual bool autoScan() const { return m_master->autoScan(); }
hasPurge()70         virtual bool hasPurge() const { return m_master->hasPurge(); }
purgeCount()71         virtual int purgeCount() const { return m_master->purgeCount(); }
72 
setSaveLocation(const QUrl & url)73         void setSaveLocation( const QUrl &url ) { m_master->setSaveLocation( url ); }
setAutoScan(bool autoScan)74         void setAutoScan( bool autoScan ) { m_master->setAutoScan( autoScan ); }
setFetchType(Podcasts::PodcastChannel::FetchType fetchType)75         void setFetchType( Podcasts::PodcastChannel::FetchType fetchType )
76         {
77             m_master->setFetchType( fetchType );
78         }
setPurge(bool purge)79         void setPurge( bool purge ) { m_master->setPurge( purge ); }
setPurgeCount(int purgeCount)80         void setPurgeCount( int purgeCount ) { m_master->setPurgeCount( purgeCount ); }
81 
82     private:
83         Podcasts::PodcastChannelPtr m_master;
84 };
85 
86 typedef AmarokSharedPointer<SyncedPodcast> SyncedPodcastPtr;
87 typedef QList<SyncedPodcastPtr> SyncedPodcastList;
88 
89 Q_DECLARE_METATYPE( SyncedPodcastPtr )
90 Q_DECLARE_METATYPE( SyncedPodcastList )
91 
92 #endif // SYNCEDPODCAST_H
93