~ubuntu-branches/ubuntu/raring/recorditnow/raring

« back to all changes in this revision

Viewing changes to src/plugins/upload/lib/video.h

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2011-01-09 14:54:01 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20110109145401-gyckb4airz4fio50
Tags: 0.8.1-0ubuntu1
* New upstream release. (LP: #681270)
  - Update debian/copyright.
* Build-depend on recordmydesktop.
* Add a watch file.
* Drop 01_fix_ftbfs_kwarning_call.diff, fixed upstream.
* Add 01_joschy_install_to_usr_lib.diff.
* Add 02_fix_ftbfs_no-add-needed.diff.
* Add 03_dont_install_header_files.diff.
* Replace dependency on libpolkit-qt-1-0 with policykit-1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
 *   Copyright (C) 2009 by Kai Dombrowe <just89@gmx.de>                    *
3
 
 *                                                                         *
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.                                   *
8
 
 *                                                                         *
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.                          *
13
 
 *                                                                         *
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
 
 ***************************************************************************/
19
 
 
20
 
 
21
 
#ifndef VIDEO_H
22
 
#define VIDEO_H
23
 
 
24
 
 
25
 
// own
26
 
#include "service.h"
27
 
 
28
 
 
29
 
namespace KYouBlip {
30
 
 
31
 
 
32
 
class KDE_EXPORT Video : public KYouBlip::Service
33
 
{
34
 
    Q_OBJECT
35
 
 
36
 
 
37
 
public:
38
 
    Video(QObject *parent = 0);
39
 
    ~Video();
40
 
 
41
 
    /**
42
 
     * @return the title
43
 
     */
44
 
    QString title() const;
45
 
    /**
46
 
     * @return the description
47
 
     */
48
 
    QString description() const;
49
 
    /**
50
 
     * @return the keywords/tags
51
 
     */
52
 
    QStringList keywords() const;
53
 
    /**
54
 
     * @return the url to the video
55
 
     */
56
 
    KUrl url() const;
57
 
    /**
58
 
     * @return the translated category
59
 
     */
60
 
    virtual QString category() const = 0;
61
 
    /**
62
 
     * @return the duration in seconds
63
 
     */
64
 
    int duration() const;
65
 
    /**
66
 
     * @return the author
67
 
     */
68
 
    QString author() const;
69
 
    /**
70
 
     * @return the thumbnail url
71
 
     */
72
 
    KUrl thumbnailUrl() const;
73
 
    /**
74
 
     * @return the date and time when the video was published
75
 
     */
76
 
    QDateTime published() const;
77
 
    /**
78
 
     * @return the local video file
79
 
     */
80
 
    QString file() const;
81
 
    /**
82
 
     * @return the local thumbnail
83
 
     */
84
 
    QString thumbnail() const;
85
 
    /**
86
 
     * @return the rating
87
 
     */
88
 
    double rating() const;
89
 
    /**
90
 
     * @return the translated license name
91
 
     */
92
 
    virtual QString license() const = 0;
93
 
 
94
 
    /**
95
 
     * @return all available licenses
96
 
     */
97
 
    virtual QStringList licenses() const = 0;
98
 
    /**
99
 
     * @return all available categorys (translated)
100
 
     */
101
 
    virtual QStringList categorys() const = 0;
102
 
 
103
 
    /**
104
 
     * sets the title for the video
105
 
     *
106
 
     * @param title the title
107
 
     */
108
 
    void setTitle(const QString &title);
109
 
    /**
110
 
     * sets the description for the video
111
 
     *
112
 
     * @param description the description
113
 
     */
114
 
    void setDescription(const QString &description);
115
 
    /**
116
 
     * sets the tags/keywords for the video
117
 
     *
118
 
     * @param keywords comma-separated list of tags
119
 
     */
120
 
    void setKeywords(const QString &keywords);
121
 
    /**
122
 
     * sets the url for the video
123
 
     *
124
 
     * @param url the url
125
 
     */
126
 
    void setUrl(const KUrl &url);
127
 
    /**
128
 
     * sets the category for the video
129
 
     *
130
 
     * @param category the category (translated or untranslated)
131
 
     */
132
 
    virtual void setCategory(const QString &category) = 0;
133
 
    /**
134
 
     * sets the duration for the video
135
 
     *
136
 
     * @param duration the duration in seconds
137
 
     */
138
 
    void setDuration(const int &duration);
139
 
    /**
140
 
     * sets the author of this video
141
 
     *
142
 
     * @param author the author
143
 
     */
144
 
    void setAuthor(const QString &author);
145
 
    /**
146
 
     * sets the thumbnail url for the video
147
 
     *
148
 
     * @param url the url
149
 
     */
150
 
    void setThumbnailUrl(const KUrl &url);
151
 
    /**
152
 
     * sets the date and time at which the video was published
153
 
     *
154
 
     * @param date the date/time
155
 
     */
156
 
    void setPublished(const QDateTime &date);
157
 
    /**
158
 
     * sets the local video file
159
 
     *
160
 
     * @param file the local file
161
 
     */
162
 
    void setFile(const QString &file);
163
 
    /**
164
 
     * sets the local thumbnail for the video
165
 
     *
166
 
     * @param file the thumbnail
167
 
     */
168
 
    void setThumbnail(const QString &file);
169
 
    /**
170
 
     * sets the rating for the video
171
 
     *
172
 
     * max: 5.0
173
 
     * min: 1.0
174
 
     *
175
 
     * @param rating the rating
176
 
     */
177
 
    void setRating(const double &rating);
178
 
    /**
179
 
     * sets the license for the video
180
 
     *
181
 
     * @param the license
182
 
     */
183
 
    virtual void setLicense(const QString &license) = 0;
184
 
 
185
 
    /**
186
 
     * updates the thumbnail for the video
187
 
     *
188
 
     * @param thumbnailDir the folder where the thumbnail should be saved
189
 
     * @see loadThumbnail()
190
 
     */
191
 
    void updateThumbnail(const QString &thumbnailDir);
192
 
    /**
193
 
     * trying to load the thumbnail from a local folder
194
 
     *
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()
199
 
     */
200
 
    bool loadThumbnail(const QString &thumbnailDir);
201
 
 
202
 
 
203
 
private:
204
 
    QHash<QString, QVariant> m_data;
205
 
    KJob *m_thumbnailJob;
206
 
 
207
 
    QByteArray getMD5String() const;
208
 
 
209
 
 
210
 
protected slots:
211
 
    void jobFinished(KJob *job, const QByteArray &data);
212
 
 
213
 
 
214
 
signals:
215
 
    /**
216
 
     * The thumbnail was successfully updated
217
 
     */
218
 
    void thumbnailUpdated(const QString &thumbnail);
219
 
    /**
220
 
     * The update failed
221
 
     */
222
 
    void thumbnailUpdateFailed();
223
 
 
224
 
 
225
 
};
226
 
 
227
 
 
228
 
}; // namespace KYouBlip
229
 
 
230
 
 
231
 
#endif // VIDEO_H