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 IlvValueInterface 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...
 
- Public Member Functions inherited from IlvValueInterface
virtual IlBoolean applyValue (const IlvValue &value)
 Apply an accessor. More...
 
virtual IlBoolean changeValue (const IlvValue &val)
 Changes the value of an accessor. More...
 
virtual IlBoolean changeValues (const IlvValue *values, IlUShort count=0)
 Changes several accessor values simultaneously. More...
 
virtual void getAccessors (const IlSymbol *const **names, const IlvValueTypeClass *const **types, IlUInt &count) const
 Retrieves the list of available accessors of an object. More...
 
virtual IlvValuequeryValue (IlvValue &val) const
 Retrieves an accessor value. More...
 
virtual void queryValues (IlvValue *values, IlUShort count) const
 Retrieves multiple accessor values simultaneously. 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

§ IlvAnimationMode

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::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

§ animate()

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.

§ changeState()

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()

§ getAnimationMode()

IlvAnimationMode IlvAnimator::getAnimationMode ( ) const

Returns the animation mode of the animator.

Returns
The animation mode.
See also
setAnimationMode(IlvAnimationMode), setAnimationMode(IlvAnimationMode, IlUInt)

§ getPeriod()

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)

§ getState()

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()

§ getStatesCount()

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.

§ initReDraws()

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.

§ invalidateRegion()

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.

§ isLastState()

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.

§ nextState()

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()

§ reDraw()

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()

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

§ setAnimationMode() [1/2]

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)

§ setAnimationMode() [2/2]

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)

§ setState()

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()

§ stateChanged()

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 2018, 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.