Adding doxygen comments in animation classes (part 1).

svn path=/trunk/KDE/kdelibs/; revision=1060701
This commit is contained in:
Adenilson Cavalcanti Da Silva 2009-12-09 17:56:40 +00:00
parent f449a1586a
commit d7daecf191
3 changed files with 83 additions and 7 deletions

View File

@ -59,9 +59,9 @@ void Animation::setDuration(int duration)
d->duration = qMax(0, duration);
}
void Animation::setWidgetToAnimate(QGraphicsWidget* receiver)
void Animation::setWidgetToAnimate(QGraphicsWidget* widget)
{
d->animObject = receiver;
d->animObject = widget;
}
QGraphicsWidget* Animation::widgetToAnimate()

View File

@ -52,12 +52,14 @@ class PLASMA_EXPORT Animation : public QAbstractAnimation
public:
/**
* Get the animation duration.
* Get the animation duration. It can be set using the property duration.
* @return duration in ms.
*/
int duration() const;
/* FIXME: find a better place and name for it. */
/**
* Animation movement reference (used by \ref RotationAnimation).
*/
enum Reference{
Center,
Up,
@ -66,14 +68,29 @@ public:
Right
};
/**
* Default constructor.
*
* @param parent Object parent (might be set when using
* \ref Animator::create factory).
*
*/
explicit Animation(QObject* parent = 0);
/**
* Destructor.
*/
virtual ~Animation() = 0;
/**
* Set the widget on which the animation is to be performed.
*
* If the animation class has any special initialization to be done
* in the target widget, you should reimplement this method in
* the derived class.
* @arg receiver The QGraphicsWidget to be animated.
*/
virtual void setWidgetToAnimate(QGraphicsWidget* receiver);
virtual void setWidgetToAnimate(QGraphicsWidget* widget);
/**
* The widget that the animation will be performed upon
@ -93,16 +110,36 @@ public:
protected:
/**
* Change the animation duration. Default is 1000ms.
* Change the animation duration. Default is 250ms.
* @arg duration The new duration of the animation.
*/
virtual void setDuration(int duration = 250);
/**
* QAbstractAnimation will call this method while the animation
* is running. Each specialized animation class should implement
* the correct behavior for it.
* @param currentTime Slapsed time using the \ref duration as reference
* (it will be from duration up to zero if the animation is running
* backwards).
*/
virtual void updateCurrentTime(int currentTime);
/**
* Internal use only, access the easing curve object (see
* \ref AnimationPrivate). Commonly used if a non-linear
* animation is desired while setting the delta in \ref updateCurrentTime.
*
* @return An internal easing curve (default is Type::Linear).
*/
QEasingCurve &easingCurve();
private:
/**
* Internal pimple (actually is used as a data structure, see
* \ref AnimationPrivate).
*/
AnimationPrivate *const d;
};

View File

@ -34,7 +34,9 @@ namespace Plasma
* @class Fade plasma/animations/fade.h
* @short Fade effect
*
* Effect that slowly transforms the opacity of the object to the given value.
* Effect that slowly transforms the opacity of the object from a starting
* value to a target value. The range is 0 (full translucent) to 1 (full
* opaque).
*/
class FadeAnimation : public Animation
{
@ -43,15 +45,50 @@ class FadeAnimation : public Animation
Q_PROPERTY(qreal targetOpacity READ targetOpacity WRITE setTargetOpacity)
public:
/** Default constructor */
FadeAnimation(QObject *parent = 0);
/** Destructor */
virtual ~FadeAnimation();
/**
* Access start opacity of the target widget.
*
* You can set both a start and an end opacity for an widget when
* using this animation class. See \ref setStartOpacity.
* @return The opacity (range is 0 to 1).
*/
qreal startOpacity() const;
/**
* Set the start opacity of the target widget.
*
* See also \ref targetOpacity.
* @param qreal The opacity (range is 0 to 1).
*/
void setStartOpacity(qreal);
/**
* Access final opacity of the target widget.
*
* You can set both a start and an end opacity for an widget when
* using this animation class. See \ref setTargetOpacity.
* @return The opacity (range is 0 to 1).
*/
qreal targetOpacity() const;
/**
* Set the final opacity of the target widget.
*
* See also \ref startOpacity.
* @param qreal The opacity (range is 0 to 1).
*/
void setTargetOpacity(qreal);
/**
* Set the widget on which the animation is to be performed.
*
* This animation reimplements it to make possible to apply the
* start opacity in the widget (see \ref setStartOpacity).
* @arg receiver The QGraphicsWidget to be animated.
*/
void setWidgetToAnimate(QGraphicsWidget *widget);
protected:
@ -59,7 +96,9 @@ protected:
void updateCurrentTime(int currentTime);
private:
/** Initial opacity */
qreal m_startOpacity;
/** Final opacity */
qreal m_targetOpacity;
};