1/* This file is part of the KDE libraries
2 Copyright (C) 2009 David Nolden <david.nolden.kdevelop@art-master.de>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library 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 GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
18*/
19
20#ifndef _THUMBSEQUENCECREATOR_H_
21#define _THUMBSEQUENCECREATOR_H_
22
23#include "thumbcreator.h"
24
25/**
26 * @see ThumbCreator
27 *
28 * This is an extension of ThumbCreator that allows creating a thumbnail sequence for
29 * a file. If your thumbnail plugin can create a thumbnail sequence, you should base it
30 * on ThumbSequenceCreator instead of ThumbCreator, and should use sequenceIndex()
31 * to decide what thumbnail you generate.
32 *
33 * You also need to set the following key in the thumbcreator .desktop file
34 * \code
35 * HandleSequences=true;
36 * \endcode
37 *
38 * @since 4.3
39 */
40class KIO_EXPORT ThumbSequenceCreator : public ThumbCreator
41{
42public:
43 Q_DISABLE_COPY(ThumbSequenceCreator)
44 ThumbSequenceCreator();
45 virtual ~ThumbSequenceCreator();
46
47 /**
48 * If this thumb-creator can create a sequence of thumbnails,
49 * it should use this to decide what sequence item to use.
50 *
51 * If the value is zero, the standard thumbnail should be created.
52 *
53 * This can be used for example to create thumbnails for different
54 * timeframes in videos(For example 0m, 10m, 20m, ...).
55 *
56 * If your thumb-creator supports a high granularity, like a video,
57 * you can respect the sub-integer precision coming from the float.
58 * Else, just round the index to an integer.
59 *
60 * If the end of your sequence is reached, the sequence should start
61 * from the beginning, or continue in some other way.
62 */
63 float sequenceIndex() const;
64
65 /**
66 * Sets the sequence-index for this thumb creator.
67 * @see sequenceIndex
68 */
69 void setSequenceIndex(float index);
70
71private:
72 class Private;
73 Private* d;
74};
75
76typedef ThumbCreator *(*newCreator)();
77
78#endif
79