• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

libplasma

Plasma::LayoutAnimator

Plasma::LayoutAnimator Class Reference

#include <layoutanimator.h>

Inheritance diagram for Plasma::LayoutAnimator:

Inheritance graph
[legend]

List of all members.


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

enum Plasma::LayoutAnimator::State

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.

enum Plasma::LayoutAnimator::Effect

This enum describes the available effects which can be used to animate changes in a layout.

Enumerator:
NoEffect  No effect.

When the animation begins, the item immediately appears in its final position and size.

MoveEffect  The item is smoothly moved and resized from its initial geometry to its final geometry as the animation progresses.
FadeEffect  The item fades out during the first half of the animation in its initial geometry and then fades in at its final position and size during the second half of the animation.
FadeInMoveEffect  The item is initially invisible and fades in whilst moving and resizing to its final position as the animation progresses.
FadeOutMoveEffect  The item is initially fully opqaue and fades out whilst moving and resizing to its final position as the animation progresses.

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

See setEffect().

Definition at line 147 of file layoutanimator.cpp.

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

See setCurrentState().

Definition at line 165 of file layoutanimator.cpp.

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

Returns the QTimeLine used by this animator.

Definition at line 196 of file layoutanimator.cpp.

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

See setAutoDeleteOnRemoval().

Definition at line 124 of file layoutanimator.cpp.

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:
  • layoutanimator.h
  • layoutanimator.cpp

libplasma

Skip menu "libplasma"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libplasma
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal