rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvAnimator Class Reference

Named property class. More...

#include <ilviews/util/animator.h>

Inheritance diagram for IlvAnimator:
IlvNamedProperty IlvBitmapAnimator IlvGraphicAnimator

List of all members.

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.
virtual void animate ()
 Called to animate the animator.
void changeState (IlUInt state, IlBoolean redraw=((IlBoolean) 1))
 Changes the animator state.
IlvAnimationMode getAnimationMode () const
 Returns the animation mode of the animator.
IlUInt getPeriod () const
 Returns the animation period of the animator.
IlUInt getState () const
 Returns the animator state.
virtual IlUInt getStatesCount () const =0
 Returns the number of states of the animator.
virtual void initReDraws () const =0
 Called to begin a redraw session.
virtual void invalidateRegion () const =0
 Called to invalidate the area affected by the animator.
virtual IlBoolean isLastState (IlUInt state) const
 Returns a Boolean value indicating whether the specified state is the last one.
virtual IlUInt nextState (IlUInt state) const
 Returns the animator state that must be set after a given state.
virtual void reDraw () const
 Called to redraw the animator.
virtual void reDrawViews () const =0
 Called to finish a redraw session.
void setAnimationMode (IlvAnimationMode mode, IlUInt period)
 Sets the animation mode and the period of the animator.
void setAnimationMode (IlvAnimationMode mode)
 Sets the animation mode of the animator.
void setState (IlUInt state)
 Sets the animator state.
virtual void stateChanged (IlUInt newState, IlUInt oldState)
 Called by IlvAnimator::changeState each time the animator state changes.

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:
name The animator name.
mode The animation mode.
period The 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 = ((IlBoolean) 1) 
)

Changes the animator state.

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

Parameters:
state The new animator state.
redraw A 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:
state The 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:
state The 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,
IlUInt  period 
)

Sets the animation mode and the period of the animator.

Parameters:
mode The new animation mode.
period The new animation period.
See also:
getAnimationMode, setAnimationMode(IlvAnimationMode)
void IlvAnimator::setAnimationMode ( IlvAnimationMode  mode  ) 

Sets the animation mode of the animator.

This method does not change the animation period.

Parameters:
mode The new animation mode.
See also:
getAnimationMode, setAnimationMode(IlvAnimationMode, IlUInt)
void IlvAnimator::setState ( IlUInt  state  ) 

Sets the animator state.

This method does not call any other method.

Parameters:
state The 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:
newState The new animator state.
oldState The previous animator state.
See also:
getState, nextState, changeState

Reimplemented in IlvBitmapAnimator, and IlvGraphicAnimator.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

© 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.