1 /*************************************************************************** 2 * This file is part of libmygpo-qt * 3 * Copyright (c) 2010 - 2013 Stefan Derkits <stefan@derkits.at> * 4 * Copyright (c) 2010 - 2011 Christian Wagner <christian.wagner86@gmx.at> * 5 * Copyright (c) 2010 - 2011 Felix Winter <ixos01@gmail.com> * 6 * * 7 * This library is free software; you can redistribute it and/or * 8 * modify it under the terms of the GNU Lesser General Public * 9 * License as published by the Free Software Foundation; either * 10 * version 2.1 of the License, or (at your option) any later version. * 11 * * 12 * This library is distributed in the hope that it will be useful, * 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 15 * Lesser General Public License for more details. * 16 * * 17 * You should have received a copy of the GNU Lesser General Public * 18 * License along with this library; if not, write to the Free Software * 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * 20 * USA * 21 ***************************************************************************/ 22 23 #ifndef LIBMYGPO_QT_EPISODE_H 24 #define LIBMYGPO_QT_EPISODE_H 25 26 #include <QObject> 27 #include <QUrl> 28 #include <QString> 29 #include <QDateTime> 30 #include <QNetworkReply> 31 #include <QSharedPointer> 32 33 #include "mygpo_export.h" 34 35 namespace mygpo 36 { 37 38 class EpisodePrivate; 39 40 class MYGPO_EXPORT Episode : public QObject 41 { 42 Q_OBJECT 43 Q_PROPERTY( QUrl url READ url CONSTANT ) 44 Q_PROPERTY( QString title READ title CONSTANT ) 45 Q_PROPERTY( QUrl podcastUrl READ url CONSTANT ) 46 Q_PROPERTY( QString podcastTitle READ title CONSTANT ) 47 Q_PROPERTY( QString description READ description CONSTANT ) 48 Q_PROPERTY( QUrl website READ website CONSTANT ) 49 Q_PROPERTY( QDateTime released READ released CONSTANT ) 50 Q_PROPERTY( int status READ status CONSTANT ) 51 Q_PROPERTY( QUrl mygpoUrl READ mygpoUrl CONSTANT ) 52 53 public: 54 55 enum Status 56 { 57 UNKNOWN, 58 NEW, 59 PLAY, 60 DOWNLOAD, 61 DELETE 62 }; 63 64 Episode( QNetworkReply* reply, QObject* parent = 0 ); 65 Episode( const QVariant& variant, QObject* parent = 0 ); 66 virtual ~Episode(); 67 QUrl url() const; 68 QString title() const; 69 QUrl podcastUrl() const; 70 QString podcastTitle() const; 71 QString description() const; 72 QUrl website() const; 73 QUrl mygpoUrl() const; 74 QDateTime released() const; 75 Episode::Status status() const; 76 private: 77 Q_DISABLE_COPY( Episode ) 78 EpisodePrivate* const d; 79 friend class EpisodePrivate; 80 signals: 81 /**Gets emitted when the data is ready to read*/ 82 void finished(); 83 /**Gets emitted when an parse error ocurred*/ 84 void parseError(); 85 /**Gets emitted when an request error ocurred*/ 86 void requestError( QNetworkReply::NetworkError error ); 87 88 }; 89 90 typedef QSharedPointer<Episode> EpisodePtr; 91 92 } 93 94 Q_DECLARE_METATYPE(mygpo::EpisodePtr) 95 96 #endif // LIBMYGPO_QT_EPISODE_H 97