rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

List of all members | Public Types | Public Member Functions
IlvAnimator Class Referenceabstract

Named property class. More...

#include <ilviews/util/animator.h>

Inheritance diagram for IlvAnimator:
IlvNamedProperty IlvBitmapAnimator IlvGraphicAnimator

Public Types

enum  IlvAnimationMode {
  IlvAnimationNone, IlvAnimationForward, IlvAnimationBackward, IlvAnimationForwardOnce,
  IlvAnimationBackwardOnce
}
 This enumeration defines the possible values for the animation mode of an IlvAnimator object. More...
 

Public Member Functions

 IlvAnimator (IlSymbol *name, IlvAnimationMode mode=IlvAnimationForward, IlUInt period=100)
 Constructor. More...
 
virtual void animate ()
 Called to animate the animator. More...
 
void changeState (IlUInt state, IlBoolean redraw=IlTrue)
 Changes the animator state. More...
 
IlvAnimationMode getAnimationMode () const
 Returns the animation mode of the animator. More...
 
IlUInt getPeriod () const
 Returns the animation period of the animator. More...
 
IlUInt getState () const
 Returns the animator state. More...
 
virtual IlUInt getStatesCount () const =0
 Returns the number of states of the animator. More...
 
virtual void initReDraws () const =0
 Called to begin a redraw session. More...
 
virtual void invalidateRegion () const =0
 Called to invalidate the area affected by the animator. More...
 
virtual IlBoolean isLastState (IlUInt state) const
 Returns a Boolean value indicating whether the specified state is the last one. More...
 
virtual IlUInt nextState (IlUInt state) const
 Returns the animator state that must be set after a given state. More...
 
virtual void reDraw () const
 Called to redraw the animator. More...
 
virtual void reDrawViews () const =0
 Called to finish a redraw session. More...
 
void setAnimationMode (IlvAnimationMode mode)
 Sets the animation mode of the animator. More...
 
void setAnimationMode (IlvAnimationMode mode, IlUInt period)
 Sets the animation mode and the period of the animator. More...
 
void setState (IlUInt state)
 Sets the animator state. More...
 
virtual void stateChanged (IlUInt newState, IlUInt oldState)
 Called by IlvAnimator::changeState each time the animator state changes. More...
 
- Public Member Functions inherited from IlvNamedProperty
 IlvNamedProperty (IlSymbol *)
 Constructor. More...
 
 IlvNamedProperty (const IlvNamedProperty &source)
 Constructor. More...
 
IlvNamedPropertycopy () const =0
 Copies the property. More...
 
const char * getName () const
 Gets the name of the property. More...
 
IlSymbolgetSymbol () const
 Gets the name of the property. More...
 
virtual IlBoolean isPersistent () const
 Specifies whether the property must save itself. More...
 
void write (IlvOutputFile &stream) const =0
 Saves the description of the property. More...
 

Additional Inherited Members

- Public Attributes inherited from IlvNamedProperty
IlvNamedProperty *IlvInputFilestream
 Reads an instance of the property class. More...
 

Detailed Description

Named property class.

Library: views

IlvAnimator is a subclass of IlvNamedProperty that deals with animation. You can use it to animate any object that can be connected to a named property (IlvGraphic, IlvGadgetItem, IlvPane, IlvNotebookPage). Once started the animator calls the virtual method IlvAnimator::animate to animate the object.

See Also
IlvBitmapAnimator, IlvGraphicAnimator

Member Enumeration Documentation

This enumeration defines the possible values for the animation mode of an IlvAnimator object.

See Also
IlvAnimator::setAnimationMode
Enumerator
IlvAnimationNone 

The animator is stopped

IlvAnimationForward 

The animator is running forward, and loops once it has reached the last state of the animator

IlvAnimationBackward 

The animator is running backward, and loops once it has reached the first state of the animator

IlvAnimationForwardOnce 

The animator is running forward, and stops once it has reached the last state of the animator.

IlvAnimationBackwardOnce 

The animator is running backward, and stops once it has reached the first state of the animator

Constructor & Destructor Documentation

IlvAnimator::IlvAnimator ( IlSymbol name,
IlvAnimationMode  mode = IlvAnimationForward,
IlUInt  period = 100 
)

Constructor.

Initializes a new instance of the IlvAnimator class. The animator will start when it is connected to any object.

Parameters
nameThe animator name.
modeThe animation mode.
periodThe animator period.

Member Function Documentation

virtual void IlvAnimator::animate ( )
virtual

Called to animate the animator.

The default implementation calls IlvAnimator::changeState with the result of IlvAnimator::nextState as new state, and with redraw set to IlTrue.

See Also
getState, nextState, setState, changeState

Reimplemented in IlvGraphicAnimator.

void IlvAnimator::changeState ( IlUInt  state,
IlBoolean  redraw = IlTrue 
)

Changes the animator state.

This method calls IlvAnimator::setState to change the state, and then calls IlvAnimator::stateChanged.

Parameters
stateThe new animator state.
redrawA Boolean specifying whether the animator should be redrawn.
See Also
getState, nextState, setState, reDrawViews
IlvAnimationMode IlvAnimator::getAnimationMode ( ) const

Returns the animation mode of the animator.

Returns
The animation mode.
See Also
setAnimationMode(IlvAnimationMode), setAnimationMode(IlvAnimationMode, IlUInt)
IlUInt IlvAnimator::getPeriod ( ) const

Returns the animation period of the animator.

The animation period is the period between two calls TO the IlvAnimator::animate method.

Returns
The animation period.
See Also
IlvAnimator::setAnimationMode(IlvAnimationMode, IlUInt)
IlUInt IlvAnimator::getState ( ) const

Returns the animator state.

The animator state is a value that represents the state of the animator. The default value is 0.

Returns
The animator state.
See Also
setState, nextState, changeState
virtual IlUInt IlvAnimator::getStatesCount ( ) const
pure virtual

Returns the number of states of the animator.

You must redefine this method in a subclass.

Returns
The number of states of the animator.
See Also
nextState, changeState

Implemented in IlvBitmapAnimator.

virtual void IlvAnimator::initReDraws ( ) const
pure virtual

Called to begin a redraw session.

You must redefine this method in a subclass.

See Also
reDraw, invalidateRegion, reDrawViews

Implemented in IlvGraphicAnimator.

virtual void IlvAnimator::invalidateRegion ( ) const
pure virtual

Called to invalidate the area affected by the animator.

You must redefine this method in a subclass.

See Also
reDraw, initReDraws, reDrawViews

Implemented in IlvGraphicAnimator.

virtual IlBoolean IlvAnimator::isLastState ( IlUInt  state) const
virtual

Returns a Boolean value indicating whether the specified state is the last one.

The default implementation compares state to the result of IlvAnimator::getStatesCount(). You can override this function in your own subclass if you do not know the total number of states that the animator has.

Parameters
stateThe state.
Returns
A Boolean value indicating whether the state is the last state.
See Also
getStatesCount, nextState, changeState

Reimplemented in IlvBitmapAnimator.

virtual IlUInt IlvAnimator::nextState ( IlUInt  state) const
virtual

Returns the animator state that must be set after a given state.

The default implementation uses the animation mode to increment (IlvAnimationForward) or decrement (IlvAnimationBackward) the state. You may override this method to implement your own state automate.

Parameters
stateThe animator state.
Returns
The animator state that must be set after state. If IlvBadIndex is returned, the animator stops.
See Also
animate, changeState
virtual void IlvAnimator::reDraw ( ) const
virtual

Called to redraw the animator.

The default implementation calls IlvAnimator::initReDraws, then IlvAnimator::invalidateRegion, and finally reDrawViews.

See Also
initReDraws, invalidateRegion, reDrawViews
virtual void IlvAnimator::reDrawViews ( ) const
pure virtual

Called to finish a redraw session.

You must redefine this method in a subclass.

See Also
reDraw, initReDraws, invalidateRegion

Implemented in IlvGraphicAnimator.

void IlvAnimator::setAnimationMode ( IlvAnimationMode  mode)

Sets the animation mode of the animator.

This method does not change the animation period.

Parameters
modeThe new animation mode.
See Also
getAnimationMode, setAnimationMode(IlvAnimationMode, IlUInt)
void IlvAnimator::setAnimationMode ( IlvAnimationMode  mode,
IlUInt  period 
)

Sets the animation mode and the period of the animator.

Parameters
modeThe new animation mode.
periodThe new animation period.
See Also
getAnimationMode, setAnimationMode(IlvAnimationMode)
void IlvAnimator::setState ( IlUInt  state)

Sets the animator state.

This method does not call any other method.

Parameters
stateThe new animator state.
See Also
getState, nextState, changeState
virtual void IlvAnimator::stateChanged ( IlUInt  newState,
IlUInt  oldState 
)
virtual

Called by IlvAnimator::changeState each time the animator state changes.

The default implementation does nothing.

Parameters
newStateThe new animator state.
oldStateThe previous animator state.
See Also
getState, nextState, changeState

Reimplemented in IlvGraphicAnimator, and IlvBitmapAnimator.


© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.