1
1
/* This file is part of the KDE project
2
2
* Copyright ( C ) 2007 Thorsten Zachmann <zachmann@kde.org>
3
* Copyright ( C ) 2010 Benjamin Port <port.benjamin@gmail.com>
4
5
* This library is free software; you can redistribute it and/or
5
6
* modify it under the terms of the GNU Library General Public
20
21
#ifndef KPRSHAPEANIMATIONS_H
21
22
#define KPRSHAPEANIMATIONS_H
23
#define BOOST_MULTI_INDEX_DISABLE_SERIALIZATION
24
#include <boost/multi_index_container.hpp>
25
#include <boost/multi_index/composite_key.hpp>
26
#include <boost/multi_index/mem_fun.hpp>
27
#include <boost/multi_index/ordered_index.hpp>
31
#include "kpresenter_export.h"
32
#include "shapeanimations/KPrShapeAnimation.h"
34
struct shape_step_key : boost::multi_index::composite_key<
36
boost::multi_index::const_mem_fun<KPrShapeAnimation, KoShape *, &KPrShapeAnimation::shape>,
37
boost::multi_index::const_mem_fun<KPrShapeAnimation, int, &KPrShapeAnimation::step>
42
typedef boost::multi_index_container<
44
boost::multi_index::indexed_by<
45
boost::multi_index::ordered_unique<
48
boost::multi_index::ordered_non_unique<
49
boost::multi_index::const_mem_fun<KPrShapeAnimation, int, &KPrShapeAnimation::step>
54
typedef boost::multi_index::nth_index<ShapeAnimations,1>::type ShapeAnimationsByStep;
56
class KPRESENTER_TEST_EXPORT KPrShapeAnimations
25
#include "animations/KPrShapeAnimation.h"
26
#include "animations/KPrAnimationStep.h"
29
class KPrShapeAnimations
59
32
KPrShapeAnimations();
60
33
~KPrShapeAnimations();
34
void init(const QList<KPrAnimationStep *> animations);
63
36
* Add animation to the animations
79
52
* Get the animations for the given step
81
54
* @param step the step for which the animations should be returned
82
* @return A map of the shape -> animation if the animation is 0 the shape
55
* @return A map of the shape -> animation if the animation is 0 the shape
85
QMap<KoShape *, KPrShapeAnimation *> animations( int step ) const;
58
/* QMap<KoShape *, KPrShapeAnimation *> animations( int step ) const;
88
* Get a list of used steps in the animations
90
* Step 0 is the step for showing a new page. The list will always contain
91
* step 0 even when there is no animation for it.
93
QList<int> steps() const;
63
QList<KPrAnimationStep *> steps() const;
96
ShapeAnimations m_shapeAnimations;
66
QList<KPrAnimationStep *> m_shapeAnimations;
99
69
#endif /* KPRSHAPEANIMATIONS_H */