Crazy Eddie's GUI System  0.8.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
KeyFrame.h
1 /***********************************************************************
2  filename: CEGUIKeyFrame.h
3  created: 7/8/2010
4  author: Martin Preisler
5 
6  purpose: Defines the interface for the KeyFrame class
7 *************************************************************************/
8 /***************************************************************************
9  * Copyright (C) 2004 - 2010 Paul D Turner & The CEGUI Development Team
10  *
11  * Permission is hereby granted, free of charge, to any person obtaining
12  * a copy of this software and associated documentation files (the
13  * "Software"), to de/al in the Software without restriction, including
14  * without limitation the rights to use, copy, modify, merge, publish,
15  * distribute, sublicense, and/or sell copies of the Software, and to
16  * permit persons to whom the Software is furnished to do so, subject to
17  * the following conditions:
18  *
19  * The above copyright notice and this permission notice shall be
20  * included in all copies or substantial portions of the Software.
21  *
22  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
25  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
26  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
27  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28  * OTHER DEALINGS IN THE SOFTWARE.
29  ***************************************************************************/
30 #ifndef _CEGUIKeyFrame_h_
31 #define _CEGUIKeyFrame_h_
32 
33 #include "CEGUI/String.h"
34 
35 // Start of CEGUI namespace section
36 namespace CEGUI
37 {
38 
50 class CEGUIEXPORT KeyFrame :
51  public AllocatedObject<KeyFrame>
52 {
53 public:
58  {
69  P_Discrete
70  };
71 
73  KeyFrame(Affector* parent, float position);
74 
76  ~KeyFrame(void);
77 
82  Affector* getParent() const;
83 
91  size_t getIdxInParent() const;
92 
97  void moveToPosition(float newPosition);
98 
103  float getPosition() const;
104 
115  void setValue(const String& value);
116 
121  const String& getValue() const;
122 
135  void setSourceProperty(const String& sourceProperty);
136 
141  const String& getSourceProperty() const;
142 
154  const String& getValueForAnimation(AnimationInstance* instance) const;
155 
168  void setProgression(Progression p);
169 
174  Progression getProgression() const;
175 
181  float alterInterpolationPosition(float position);
182 
188  void savePropertyValue(AnimationInstance* instance);
189 
200  void notifyPositionChanged(float newPosition);
201 
209  void writeXMLToStream(XMLSerializer& xml_stream) const;
210 
211 private:
213  Affector* d_parent;
215  float d_position;
216 
218  String d_value;
220  String d_sourceProperty;
222  Progression d_progression;
223 };
224 
225 } // End of CEGUI namespace section
226 
227 #endif // end of guard _CEGUIKeyFrame_h_
228