libplasma
Plasma::LayoutAnimator Class Reference
#include <layoutanimator.h>

Detailed Description
LayoutAnimator can be used to animate changes in Layouts.
LayoutAnimator* animator = new LayoutAnimator; QTimeLine* timeLine = new QTimeLine; animator->setTimeLine(timeLine); animator->setEffect( LayoutAnimator::InsertedState , LayoutAnimator::FadeInMoveEffect ); animator->setEffect( LayoutAnimator::StandardState , LayoutAnimator::MoveEffect ); animator->setEffect( LayoutAnimator::RemovedState , LayoutAnimator::FadeOutMoveEffect ); myLayout->setAnimator(animator);
Definition at line 53 of file layoutanimator.h.
Public Types | |
| enum | State { InsertedState, StandardState, RemovedState, DeadState } |
| enum | Effect { NoEffect, MoveEffect, FadeEffect, FadeInMoveEffect, FadeOutMoveEffect } |
Signals | |
| void | stateChanged (LayoutItem *item, State oldState, State newState) |
Public Member Functions | |
| LayoutAnimator (QObject *parent=0) | |
| ~LayoutAnimator () | |
| void | setEffect (State state, int effect) |
| int | effect (State state) const |
| void | setCurrentState (LayoutItem *item, State state) |
| State | state (LayoutItem *item) const |
| virtual void | setGeometry (LayoutItem *item, const QRectF &geometry) |
| void | setTimeLine (QTimeLine *timeLine) |
| QTimeLine * | timeLine () const |
| void | setAutoDeleteOnRemoval (bool autoDelete) |
| bool | autoDeleteOnRemoval () const |
Protected Member Functions | |
| virtual void | updateItem (qreal value, LayoutItem *item) |
Member Enumeration Documentation
This enum describes the possible states which a layout item may be in.
Different effects can be defined for items which are being inserted, moved or resized or removed from layouts.
- Enumerator:
-
InsertedState State for an item which has recently been added to a layout. When the animation completes, the item's state will change to StandardState
StandardState Normal state for items in the layout. Items will remain in this state until it is explicitly changed via setCurrentState()
RemovedState State for an item which is currently being removed from a layout. When the animation completes, the item will be removed from the animator and its state will be undefined.
DeadState State for an item whoose geometry is not managed by the animator. All LayoutItems are initially in this state and are moved into a different state ( usually InsertedState ) by calling setCurrentState( item , state )
An item transitions into this state when the animation completes whilst the item is in RemovedState
Definition at line 67 of file layoutanimator.h.
This enum describes the available effects which can be used to animate changes in a layout.
- Enumerator:
Definition at line 104 of file layoutanimator.h.
Constructor & Destructor Documentation
| LayoutAnimator::LayoutAnimator | ( | QObject * | parent = 0 |
) | [explicit] |
Constructs a new layout animator with the specified parent.
Definition at line 96 of file layoutanimator.cpp.
| LayoutAnimator::~LayoutAnimator | ( | ) |
Definition at line 103 of file layoutanimator.cpp.
Member Function Documentation
| void LayoutAnimator::setEffect | ( | State | state, | |
| int | effect | |||
| ) |
Sets the effect for items in the layout which are under-going a change specified by action.
This allows different effects to be defined for items which are being added to, removed from, or repositioned inside layouts.
Definition at line 143 of file layoutanimator.cpp.
| int LayoutAnimator::effect | ( | State | state | ) | const |
| void LayoutAnimator::setCurrentState | ( | LayoutItem * | item, | |
| State | state | |||
| ) |
Sets the current action for a particular layout item.
The Layout class should call this before changing an item so that the animator can apply the correct animation.
When the current animation completes, depending on the current state, the item may advance into a new state.
Definition at line 152 of file layoutanimator.cpp.
| LayoutAnimator::State LayoutAnimator::state | ( | LayoutItem * | item | ) | const |
| void LayoutAnimator::setGeometry | ( | LayoutItem * | item, | |
| const QRectF & | geometry | |||
| ) | [virtual] |
Sets the new geometry for a layout item.
The item will animate from its current geometry to geometry, using the effect specified in setEffect() for the state currently associated with item
Definition at line 209 of file layoutanimator.cpp.
| void LayoutAnimator::setTimeLine | ( | QTimeLine * | timeLine | ) |
Sets the time line used by this animator.
The duration of the animation can be changed by altering timeLine 's duration
Definition at line 174 of file layoutanimator.cpp.
| QTimeLine * LayoutAnimator::timeLine | ( | ) | const |
| void LayoutAnimator::setAutoDeleteOnRemoval | ( | bool | autoDelete | ) |
Convenience feature which causes LayoutItems and their associated QGraphicsItems to be automatically deleted when their removal animation finishes.
The default is false.
Definition at line 108 of file layoutanimator.cpp.
| bool LayoutAnimator::autoDeleteOnRemoval | ( | ) | const |
| void Plasma::LayoutAnimator::stateChanged | ( | LayoutItem * | item, | |
| State | oldState, | |||
| State | newState | |||
| ) | [signal] |
This signal is emitted when the state of an item in the animator changes.
| void LayoutAnimator::updateItem | ( | qreal | value, | |
| LayoutItem * | item | |||
| ) | [protected, virtual] |
Definition at line 289 of file layoutanimator.cpp.
The documentation for this class was generated from the following files:
KDE 4.0 API Reference