Crazy Eddie's GUI System  0.8.4
KeyFrame.h
00001 /***********************************************************************
00002     created:    7/8/2010
00003     author:     Martin Preisler
00004 
00005     purpose:    Defines the interface for the KeyFrame class
00006 *************************************************************************/
00007 /***************************************************************************
00008  *   Copyright (C) 2004 - 2010 Paul D Turner & The CEGUI Development Team
00009  *
00010  *   Permission is hereby granted, free of charge, to any person obtaining
00011  *   a copy of this software and associated documentation files (the
00012  *   "Software"), to de/al in the Software without restriction, including
00013  *   without limitation the rights to use, copy, modify, merge, publish,
00014  *   distribute, sublicense, and/or sell copies of the Software, and to
00015  *   permit persons to whom the Software is furnished to do so, subject to
00016  *   the following conditions:
00017  *
00018  *   The above copyright notice and this permission notice shall be
00019  *   included in all copies or substantial portions of the Software.
00020  *
00021  *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00022  *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00023  *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00024  *   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
00025  *   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
00026  *   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
00027  *   OTHER DEALINGS IN THE SOFTWARE.
00028  ***************************************************************************/
00029 #ifndef _CEGUIKeyFrame_h_
00030 #define _CEGUIKeyFrame_h_
00031 
00032 #include "CEGUI/String.h"
00033 
00034 // Start of CEGUI namespace section
00035 namespace CEGUI
00036 {
00037 
00049 class CEGUIEXPORT KeyFrame :
00050     public AllocatedObject<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 
00090     size_t getIdxInParent() const;
00091 
00096     void moveToPosition(float newPosition);
00097 
00102     float getPosition() const;
00103 
00114     void setValue(const String& value);
00115 
00120     const String& getValue() const;
00121 
00134     void setSourceProperty(const String& sourceProperty);
00135 
00140     const String& getSourceProperty() const;
00141 
00153     const String& getValueForAnimation(AnimationInstance* instance) const;
00154 
00167     void setProgression(Progression p);
00168 
00173     Progression getProgression() const;
00174 
00180     float alterInterpolationPosition(float position);
00181 
00187     void savePropertyValue(AnimationInstance* instance);
00188 
00199     void notifyPositionChanged(float newPosition);
00200 
00208         void writeXMLToStream(XMLSerializer& xml_stream) const;
00209 
00210 private:
00212     Affector* d_parent;
00214     float d_position;
00215 
00217     String d_value;
00219     String d_sourceProperty;
00221     Progression d_progression;
00222 };
00223 
00224 } // End of  CEGUI namespace section
00225 
00226 #endif  // end of guard _CEGUIKeyFrame_h_
00227 
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends