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

Plasma

Plasma::Animator

Plasma::Animator Class Reference

A system for applying effects to Plasma elements. More...

#include <Plasma/Animator>

Inheritance diagram for Plasma::Animator:

Inheritance graph
[legend]

List of all members.


Public Types

enum  Animation { AppearAnimation = 0, DisappearAnimation, ActivateAnimation }
enum  CurveShape { EaseInCurve = 0, EaseOutCurve, EaseInOutCurve, LinearCurve }
enum  Movement { SlideInMovement = 0, SlideOutMovement, FastSlideInMovement, FastSlideOutMovement }

Signals

void animationFinished (QGraphicsItem *item, Plasma::Animator::Animation anim)
void customAnimationFinished (int id)
void elementAnimationFinished (int id)
void movementFinished (QGraphicsItem *item)

Public Member Functions

Q_INVOKABLE int animateElement (QGraphicsItem *obj, Animation)
Q_INVOKABLE int animateItem (QGraphicsItem *item, Animation anim)
Q_INVOKABLE QPixmap currentPixmap (int id)
Q_INVOKABLE int customAnimation (int frames, int duration, Animator::CurveShape curve, QObject *receiver, const char *method)
Q_INVOKABLE bool isAnimating () const
Q_INVOKABLE int moveItem (QGraphicsItem *item, Movement movement, const QPoint &destination)
Q_INVOKABLE void setInitialPixmap (int id, const QPixmap &pixmap)
Q_INVOKABLE void stopCustomAnimation (int id)
Q_INVOKABLE void stopElementAnimation (int id)
Q_INVOKABLE void stopItemAnimation (int id)
Q_INVOKABLE void stopItemMovement (int id)

Static Public Member Functions

static Animator * self ()

Protected Member Functions

void timerEvent (QTimerEvent *event)

Detailed Description

A system for applying effects to Plasma elements.

Definition at line 42 of file animator.h.


Member Enumeration Documentation

enum Plasma::Animator::Animation

Enumerator:
AppearAnimation 
DisappearAnimation 
ActivateAnimation 

Definition at line 51 of file animator.h.

enum Plasma::Animator::CurveShape

Enumerator:
EaseInCurve 
EaseOutCurve 
EaseInOutCurve 
LinearCurve 

Definition at line 58 of file animator.h.

enum Plasma::Animator::Movement

Enumerator:
SlideInMovement 
SlideOutMovement 
FastSlideInMovement 
FastSlideOutMovement 

Definition at line 65 of file animator.h.


Member Function Documentation

int Plasma::Animator::animateElement ( QGraphicsItem *  obj,
Animation  animation 
)

Definition at line 444 of file animator.cpp.

int Plasma::Animator::animateItem ( QGraphicsItem *  item,
Animation  anim 
)

Starts a standard animation on a QGraphicsItem.

  • item the item to animate in some fashion
  • anim the type of animation to perform
    Returns:
    the id of the animation

Definition at line 266 of file animator.cpp.

void Plasma::Animator::animationFinished ( QGraphicsItem *  item,
Plasma::Animator::Animation  anim 
) [signal]

QPixmap Plasma::Animator::currentPixmap ( int  id  ) 

Definition at line 512 of file animator.cpp.

int Plasma::Animator::customAnimation ( int  frames,
int  duration,
Animator::CurveShape  curve,
QObject *  receiver,
const char *  method 
)

Starts a custom animation, preventing the need to create a timeline with its own timer tick.

  • frames the number of frames this animation should persist for
  • duration the length, in milliseconds, the animation will take
  • curve the curve applied to the frame rate
  • receive the object that will handle the actual animation
  • method the method name of slot to be invoked on each update. It must take a qreal. So if the slot is animate(qreal), pass in "animate" as the method parameter. It has an optional integer paramenter that takes an integer that reapresents the animation id, useful if you want to manage multiple animations with a sigle slot
Returns:
an id that can be used to identify this animation.

Definition at line 368 of file animator.cpp.

void Plasma::Animator::customAnimationFinished ( int  id  )  [signal]

void Plasma::Animator::elementAnimationFinished ( int  id  )  [signal]

bool Plasma::Animator::isAnimating (  )  const

Can be used to query if there are other animations happening.

This way heavy operations can be delayed until all animations are finished.

Returns:
true if there are animations going on.
Since:
4.1

Definition at line 541 of file animator.cpp.

int Plasma::Animator::moveItem ( QGraphicsItem *  item,
Movement  movement,
const QPoint &  destination 
)

Starts a standard animation on a QGraphicsItem.

  • item the item to animate in some fashion
  • anim the type of animation to perform
    Returns:
    the id of the animation

Definition at line 318 of file animator.cpp.

void Plasma::Animator::movementFinished ( QGraphicsItem *  item  )  [signal]

Animator * Plasma::Animator::self (  )  [static]

Singleton accessor.

Definition at line 198 of file animator.cpp.

void Plasma::Animator::setInitialPixmap ( int  id,
const QPixmap &  pixmap 
)

Definition at line 500 of file animator.cpp.

void Plasma::Animator::stopCustomAnimation ( int  id  ) 

Stops a custom animation.

Note that it is not necessary to call this on object destruction, as custom animations associated with a given QObject are cleaned up automatically on QObject destruction.

  • id the id of the animation as returned by customAnimation

Definition at line 407 of file animator.cpp.

void Plasma::Animator::stopElementAnimation ( int  id  ) 

Definition at line 490 of file animator.cpp.

void Plasma::Animator::stopItemAnimation ( int  id  ) 

Stops an item animation before the animation is complete.

Note that it is not necessary to call this on normal completion of the animation.

  • id the id of the animation as returned by animateItem

Definition at line 418 of file animator.cpp.

void Plasma::Animator::stopItemMovement ( int  id  ) 

Stops an item movement before the animation is complete.

Note that it is not necessary to call this on normal completion of the animation.

  • id the id of the animation as returned by moveItem

Definition at line 431 of file animator.cpp.

void Plasma::Animator::timerEvent ( QTimerEvent *  event  )  [protected]

Reimplemented from QObject.

Definition at line 549 of file animator.cpp.


The documentation for this class was generated from the following files:
  • animator.h
  • animator.cpp

Plasma

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
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