Adding doxygen comments in animation classes (part 3).

svn path=/trunk/KDE/kdelibs/; revision=1060718
This commit is contained in:
Adenilson Cavalcanti Da Silva 2009-12-09 18:40:02 +00:00
parent 411a711d2b
commit 0a452da077
5 changed files with 98 additions and 9 deletions

View File

@ -18,7 +18,7 @@
*/
/**
* @file This file contains the definition for the Fade effect.
* @file This file contains the definition for the Geometry effect.
*/
#ifndef PLASMA_ANIMATIONS_GEO_H

View File

@ -31,12 +31,13 @@ namespace Plasma
{
/**
* @class Grow plasma/animations/grow.h
* @class GrowAnimation plasma/animations/grow.h
* @short Grow effect
*
* Effect that grows any QGraphicsWidget by a multiple given in the
* constructor. The center of the object stays in place while the sides grow.
*
* constructor. The center of the object stays in place while the sides grow
* (it does the animation by changing the objects geometry). Also see
* \ref ZoomAnimation.
*/
class GrowAnimation : public Animation
{
@ -44,12 +45,29 @@ class GrowAnimation : public Animation
Q_PROPERTY(qreal factor READ factor WRITE setFactor)
public:
/** Default Constructor
* @param parent Animation object parent.
* @param factor Expand factor (default is twice the size of
* animated widget).
*/
GrowAnimation(QObject *parent = 0, qreal factor = 2);
/** Destructor */
virtual ~GrowAnimation(){};
/**
* Access expansion factor of the shadow pulsable copy.
*
* If not set, the default is twice (2x) the size of animated widget.
* See \ref setFactor.
* @return Expansion factor.
*/
qreal factor() const;
/**
* Set expansion factor of target widget.
*
* If not set, the default is twice (2x) the size of animated widget.
* @param factor A expansion factor
*/
void setFactor(const qreal factor);
protected:
@ -57,8 +75,11 @@ protected:
void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState);
private:
/** Animation grow factor */
qreal m_animFactor;
/** Widget start geometry */
QRectF m_startGeometry;
/** Widget final geometry */
QRectF m_targetGeometry;
};

View File

@ -16,6 +16,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/**
* @file This file contains the definition for the Pulse effect.
*/
#ifndef PLASMA_ANIMATIONS_PULSE_H
#define PLASMA_ANIMATIONS_PULSE_H
@ -27,17 +31,39 @@ namespace Plasma
class ShadowFake;
/**
* @class PulseAnimation plasma/animations/pulser_p.h
* @short Pulse effect
*
* Effect that pulses a shadow copy of any QGraphicsWidget making
* it more translucent and bigger along the time until it vanishes.
*/
class PulseAnimation : public Animation
{
Q_OBJECT
public:
/** Default Constructor */
PulseAnimation(QObject *parent = 0);
/** Destructor */
~PulseAnimation();
/**
* Set the widget on which the animation is to be performed.
*
* This animation reimplements it to create the shadow copy of
* the animated widget. The shadow is the one that is actually
* animated (see \ref ShadowFake).
* @arg receiver The QGraphicsWidget to be animated.
*/
void setWidgetToAnimate(QGraphicsWidget *widget);
public Q_SLOTS:
/**
* Resets the shadow widget to its initial state (full translucent
* and with same geometry as the target widget). It is executed
* when the animation is over.
*/
void resetPulser();
protected:
@ -46,10 +72,19 @@ protected:
void setCopy();
private:
/** Zvalue (tipically -1 than the target widget) */
qreal zvalue;
/** Original widget scale */
qreal scale;
/** Opacity of shadow widget (full translucent) */
qreal mopacity;
/** Target scale of shadow widget (default is 1.5x the animated
* widget scale).
*/
qreal endScale;
/** The shadow copy (it really is a QGraphicsWidget with a pixmap
* copy of the original widget).
*/
ShadowFake *under;
};

View File

@ -19,9 +19,12 @@
/* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA */
/* 02110-1301 USA */
/***********************************************************************/
/**
* @file This file contains the definition for the 2D Rotation effect.
*/
#ifndef ROTATION_P_H
#define ROTATION_P_H
#ifndef PLASMA_ROTATION_P_H
#define PLASMA_ROTATION_P_H
#include <plasma/animations/animation.h>
#include <plasma/plasma_export.h>
@ -31,7 +34,14 @@
class QGraphicsRotation;
namespace Plasma {
/**
* @class RotationAnimation plasma/animations/rotation_p.h
* @short 2D rotation animation.
*
* This animation rotates a QGraphicsWidget in a axis (reference and
* axis can be defined using properties). See also
* \ref StackedRotationAnimation.
*/
class RotationAnimation : public Animation
{
@ -41,11 +51,20 @@ class RotationAnimation : public Animation
Q_PROPERTY(qreal angle READ angle WRITE setAngle)
public:
/** Default constructor
*
* @param parent Animation object parent.
* @param reference See \ref Animation::Reference.
* @param axis Which axis to rotate (XAxis, YAxis, ZAxis).
* @param angle Rotation angle (0 to 360)
*
*/
RotationAnimation(QObject *parent = 0,
const qint8 &reference = Up,
const Qt::Axis &axis = Qt::ZAxis,
const qreal &angle = 180);
/** Destructor */
~RotationAnimation();
/**
@ -88,9 +107,13 @@ protected:
void updateCurrentTime(int currentTime);
private:
/** Rotation transform object */
QGraphicsRotation *m_rotation;
/** Rotation angle */
qreal m_angle;
/** Axis where to perform the rotation */
Qt::Axis m_axis;
/** Reference, the default is Up (see \ref Animation::Reference) */
qint8 m_reference;
};
} // Plasma

View File

@ -19,6 +19,10 @@
// 02110-1301 USA //
/////////////////////////////////////////////////////////////////////////
/**
* @file This file contains the definition for the StackedRotationAnimation.
*/
#ifndef PLASMA_ROTATIONSTACKED_H
#define PLASMA_ROTATIONSTACKED_H
@ -34,6 +38,12 @@ namespace Plasma {
/* TODO:
* create a parent class for rotations
*/
/**
* @class RotationStackedAnimation plasma/animations/rotationstacked_p.h
* @short 3D like rotation animation
* Use this class when you want to rotate a widget along an axis (e.g. Y)
* and display a 'hidden' widget behind it. See also \ref RotationAnimation.
*/
class RotationStackedAnimation : public Animation
{
Q_OBJECT