Crazy Eddies GUI System 0.7.5
CEGUIKeyFrame.h
00001 /***********************************************************************
00002     filename:   CEGUIKeyFrame.h
00003     created:    7/8/2010
00004     author:     Martin Preisler
00005 
00006     purpose:    Defines the interface for the KeyFrame class
00007 *************************************************************************/
00008 /***************************************************************************
00009  *   Copyright (C) 2004 - 2010 Paul D Turner & The CEGUI Development Team
00010  *
00011  *   Permission is hereby granted, free of charge, to any person obtaining
00012  *   a copy of this software and associated documentation files (the
00013  *   "Software"), to de/al in the Software without restriction, including
00014  *   without limitation the rights to use, copy, modify, merge, publish,
00015  *   distribute, sublicense, and/or sell copies of the Software, and to
00016  *   permit persons to whom the Software is furnished to do so, subject to
00017  *   the following conditions:
00018  *
00019  *   The above copyright notice and this permission notice shall be
00020  *   included in all copies or substantial portions of the Software.
00021  *
00022  *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00023  *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00024  *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00025  *   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
00026  *   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
00027  *   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
00028  *   OTHER DEALINGS IN THE SOFTWARE.
00029  ***************************************************************************/
00030 #ifndef _CEGUIKeyFrame_h_
00031 #define _CEGUIKeyFrame_h_
00032 
00033 #include "CEGUIString.h"
00034 
00035 // Start of CEGUI namespace section
00036 namespace CEGUI
00037 {
00038 
00050 class CEGUIEXPORT KeyFrame
00051 {
00052 public:
00056     enum Progression
00057     {
00059         P_Linear,
00061         P_QuadraticAccelerating,
00063         P_QuadraticDecelerating,
00068         P_Discrete
00069     };
00070 
00072     KeyFrame(Affector* parent, float position);
00073 
00075     ~KeyFrame(void);
00076 
00081     Affector* getParent() const;
00082 
00087     void moveToPosition(float newPosition);
00088 
00093     float getPosition() const;
00094 
00105     void setValue(const String& value);
00106 
00111     const String& getValue() const;
00112 
00125     void setSourceProperty(const String& sourceProperty);
00126 
00131     const String& getSourceProperty() const;
00132 
00144     const String& getValueForAnimation(AnimationInstance* instance) const;
00145 
00158     void setProgression(Progression p);
00159 
00164     Progression getProgression() const;
00165 
00171     float alterInterpolationPosition(float position);
00172 
00178     void savePropertyValue(AnimationInstance* instance);
00179 
00190     void notifyPositionChanged(float newPosition);
00191 
00192 private:
00194     Affector* d_parent;
00196     float d_position;
00197 
00199     String d_value;
00201     String d_sourceProperty;
00203     Progression d_progression;
00204 };
00205 
00206 } // End of  CEGUI namespace section
00207 
00208 #endif  // end of guard _CEGUIKeyFrame_h_
00209