2 PictureFlow - animated image show widget
3 http://pictureflow.googlecode.com
5 Copyright (C) 2009 Ariya Hidayat (ariya@kde.org)
6 Copyright (C) 2008 Ariya Hidayat (ariya@kde.org)
7 Copyright (C) 2007 Ariya Hidayat (ariya@kde.org)
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
32 #include "../components/playlist/playlist_model.hpp" /* getArtPixmap etc */
34 class PictureFlowPrivate;
37 Class PictureFlow implements an image show widget with animation effect
38 like Apple's CoverFlow (in iTunes and iPod). Images are arranged in form
39 of slides, one main slide is shown at the center with few slides on
40 the left and right sides of the center slide. When the next or previous
41 slide is brought to the front, the whole slides flow to the right or
42 the right with smooth animation effect; until the new slide is finally
46 class PictureFlow : public QWidget
50 Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor)
51 Q_PROPERTY(QSize slideSize READ slideSize WRITE setSlideSize)
52 Q_PROPERTY(int slideCount READ slideCount)
53 Q_PROPERTY(int centerIndex READ centerIndex WRITE setCenterIndex)
57 enum ReflectionEffect {
64 Creates a new PictureFlow widget.
66 PictureFlow(QWidget* parent = 0, VLCModel *model = 0);
74 Returns the background color.
76 QColor backgroundColor() const;
79 Sets the background color. By default it is black.
81 void setBackgroundColor(const QColor& c);
84 Returns the dimension of each slide (in pixels).
86 QSize slideSize() const;
89 Sets the dimension of each slide (in pixels).
91 void setSlideSize(QSize size);
94 Returns the total number of slides.
96 int slideCount() const;
99 Returns the index of slide currently shown in the middle of the viewport.
101 int centerIndex() const;
104 Returns the effect applied to the reflection.
106 ReflectionEffect reflectionEffect() const;
109 Sets the effect applied to the reflection. The default is PlainReflection.
111 void setReflectionEffect(ReflectionEffect effect);
117 Sets slide to be shown in the middle of the viewport. No animation
118 effect will be produced, unlike using showSlide.
120 void setCenterIndex(int index);
128 Shows previous slide using animation effect.
133 Shows next slide using animation effect.
138 Go to specified slide using animation effect.
140 void showSlide(int index);
143 Rerender the widget. Normally this function will be automatically invoked
144 whenever necessary, e.g. during the transition animation.
149 Schedules a rendering update. Unlike render(), this function does not cause
152 void triggerRender();
155 void centerIndexChanged(int index);
158 void paintEvent(QPaintEvent *event);
159 void keyPressEvent(QKeyEvent* event);
160 void mousePressEvent(QMouseEvent* event);
161 void resizeEvent(QResizeEvent* event);
164 void updateAnimation();
167 PictureFlowPrivate* d;
170 #endif // PICTUREFLOW_H