1
/***************************************************************************
2
* Copyright (C) 2009 by Kai Dombrowe <just89@gmx.de> *
4
* This program is free software; you can redistribute it and/or modify *
5
* it under the terms of the GNU General Public License as published by *
6
* the Free Software Foundation; either version 2 of the License, or *
7
* (at your option) any later version. *
9
* This program is distributed in the hope that it will be useful, *
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12
* GNU General Public License for more details. *
14
* You should have received a copy of the GNU General Public License *
15
* along with this program; if not, write to the *
16
* Free Software Foundation, Inc., *
17
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
18
***************************************************************************/
32
class KDE_EXPORT Video : public KYouBlip::Service
38
Video(QObject *parent = 0);
44
QString title() const;
46
* @return the description
48
QString description() const;
50
* @return the keywords/tags
52
QStringList keywords() const;
54
* @return the url to the video
58
* @return the translated category
60
virtual QString category() const = 0;
62
* @return the duration in seconds
68
QString author() const;
70
* @return the thumbnail url
72
KUrl thumbnailUrl() const;
74
* @return the date and time when the video was published
76
QDateTime published() const;
78
* @return the local video file
82
* @return the local thumbnail
84
QString thumbnail() const;
88
double rating() const;
90
* @return the translated license name
92
virtual QString license() const = 0;
95
* @return all available licenses
97
virtual QStringList licenses() const = 0;
99
* @return all available categorys (translated)
101
virtual QStringList categorys() const = 0;
104
* sets the title for the video
106
* @param title the title
108
void setTitle(const QString &title);
110
* sets the description for the video
112
* @param description the description
114
void setDescription(const QString &description);
116
* sets the tags/keywords for the video
118
* @param keywords comma-separated list of tags
120
void setKeywords(const QString &keywords);
122
* sets the url for the video
126
void setUrl(const KUrl &url);
128
* sets the category for the video
130
* @param category the category (translated or untranslated)
132
virtual void setCategory(const QString &category) = 0;
134
* sets the duration for the video
136
* @param duration the duration in seconds
138
void setDuration(const int &duration);
140
* sets the author of this video
142
* @param author the author
144
void setAuthor(const QString &author);
146
* sets the thumbnail url for the video
150
void setThumbnailUrl(const KUrl &url);
152
* sets the date and time at which the video was published
154
* @param date the date/time
156
void setPublished(const QDateTime &date);
158
* sets the local video file
160
* @param file the local file
162
void setFile(const QString &file);
164
* sets the local thumbnail for the video
166
* @param file the thumbnail
168
void setThumbnail(const QString &file);
170
* sets the rating for the video
175
* @param rating the rating
177
void setRating(const double &rating);
179
* sets the license for the video
183
virtual void setLicense(const QString &license) = 0;
186
* updates the thumbnail for the video
188
* @param thumbnailDir the folder where the thumbnail should be saved
189
* @see loadThumbnail()
191
void updateThumbnail(const QString &thumbnailDir);
193
* trying to load the thumbnail from a local folder
195
* @param thumbnailDir the folder where the thumbnail was saved
196
* @return false if the thumbnail does not exist
197
* @return true if the thumbnail was found
198
* @see updateThumbnail()
200
bool loadThumbnail(const QString &thumbnailDir);
204
QHash<QString, QVariant> m_data;
205
KJob *m_thumbnailJob;
207
QByteArray getMD5String() const;
211
void jobFinished(KJob *job, const QByteArray &data);
216
* The thumbnail was successfully updated
218
void thumbnailUpdated(const QString &thumbnail);
222
void thumbnailUpdateFailed();
228
}; // namespace KYouBlip