1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
4 * Moonlight List (moonlight-list@lists.ximian.com)
6 * Copyright 2007 Novell, Inc. (http://www.novell.com)
8 * See the LICENSE file included with the distribution for details.
12 #ifndef MOON_TIMELINE_H
13 #define MOON_TIMELINE_H
20 /* @Namespace=System.Windows.Media.Animation */
21 class Timeline
: public DependencyObject
{
23 /* @PropertyType=bool,DefaultValue=false,GenerateAccessors */
24 const static int AutoReverseProperty
;
25 /* @PropertyType=TimeSpan,Nullable,DefaultValue=(gint64) 0\, Type::TIMESPAN */
26 const static int BeginTimeProperty
;
27 /* @PropertyType=Duration,DefaultValue=Duration::Automatic */
28 const static int DurationProperty
;
29 /* @PropertyType=FillBehavior,DefaultValue=FillBehaviorHoldEnd,GenerateAccessors */
30 const static int FillBehaviorProperty
;
31 /* @PropertyType=RepeatBehavior,DefaultValue=RepeatBehavior ((double) 1) */
32 const static int RepeatBehaviorProperty
;
33 /* @PropertyType=double,DefaultValue=1.0,GenerateAccessors */
34 const static int SpeedRatioProperty
;
36 /* @GenerateCBinding,GeneratePInvoke,ManagedAccess=Protected */
39 void SetAutoReverse (bool autoreverse
);
40 bool GetAutoReverse ();
42 TimeSpan
GetBeginTime ();
44 void SetDuration (Duration duration
);
45 Duration
*GetDuration ();
47 FillBehavior
GetFillBehavior ();
48 void SetFillBehavior (FillBehavior behavior
);
50 bool GetHadParent () { return this->had_parent
; }
51 void SetHadParent (bool had_parent
) { this->had_parent
= had_parent
; }
53 void SetRepeatBehavior (RepeatBehavior behavior
);
54 RepeatBehavior
*GetRepeatBehavior ();
56 void SetSpeedRatio (double ratio
);
57 double GetSpeedRatio ();
59 Duration
GetNaturalDuration (Clock
*clock
);
60 virtual Duration
GetNaturalDurationCore (Clock
*clock
);
62 virtual Clock
*AllocateClock ();
63 virtual bool Validate ();
69 TIMELINE_STATUS_DETACHED
72 TimelineStatus
GetTimelineStatus () { return timeline_status
; }
74 bool HasManualTarget () { return manual_target
!= NULL
; }
76 /* @GenerateCBinding,GeneratePInvoke */
77 DependencyObject
* GetManualTarget () { return manual_target
; }
79 /* @GenerateCBinding,GeneratePInvoke */
80 void SetManualTarget (DependencyObject
*o
) { manual_target
= o
; }
83 const static int CompletedEvent
;
85 virtual void TeardownClock ();
90 void AttachCompletedHandler ();
91 void DetachCompletedHandler ();
93 virtual void OnClockCompleted ();
95 static void clock_completed (EventObject
*sender
, EventArgs
*calldata
, gpointer closure
);
101 TimelineStatus timeline_status
;
102 DependencyObject
*manual_target
;
106 /* @Namespace=System.Windows.Media.Animation */
107 class TimelineCollection
: public DependencyObjectCollection
{
109 /* @GenerateCBinding,GeneratePInvoke */
110 TimelineCollection ();
112 virtual Type::Kind
GetElementType() { return Type::TIMELINE
; }
115 virtual ~TimelineCollection ();
119 /* @Namespace=None,ManagedDependencyProperties=None,ManagedEvents=None */
120 class TimelineGroup
: public Timeline
{
122 /* @PropertyType=TimelineCollection,AutoCreateValue,GenerateAccessors */
123 const static int ChildrenProperty
;
125 /* @GenerateCBinding,GeneratePInvoke */
128 virtual Clock
*AllocateClock ();
129 virtual bool Validate ();
131 void AddChild (Timeline
*child
);
132 void RemoveChild (Timeline
*child
);
134 virtual void OnCollectionChanged (Collection
*col
, CollectionChangedEventArgs
*args
);
137 // Property Accessors
139 void SetChildren (TimelineCollection
*children
);
140 TimelineCollection
*GetChildren ();
143 virtual ~TimelineGroup ();
147 /* @Namespace=None */
148 class ParallelTimeline
: public TimelineGroup
{
150 /* @GenerateCBinding,GeneratePInvoke */
153 virtual Duration
GetNaturalDurationCore (Clock
*clock
);
156 virtual ~ParallelTimeline ();
160 /* @Namespace=System.Windows.Media */
161 class TimelineMarker
: public DependencyObject
{
163 /* @PropertyType=string,GenerateAccessors */
164 const static int TextProperty
;
165 /* @PropertyType=TimeSpan,GenerateAccessors */
166 const static int TimeProperty
;
167 /* @PropertyType=string,GenerateAccessors */
168 const static int TypeProperty
;
170 /* @GenerateCBinding,GeneratePInvoke */
174 // Property Accessors
176 void SetText (const char *text
);
177 const char *GetText ();
179 void SetTime (TimeSpan time
);
182 void SetType (const char *type
);
183 const char *GetType ();
186 virtual ~TimelineMarker ();
190 /* @Namespace=Mono,Version=2 */
191 /* @ManagedEvents=Manual */
192 class DispatcherTimer
: public Timeline
{
194 /* @GenerateCBinding,GeneratePInvoke,MainThread,Version=2 */
197 /* @GenerateCBinding,GeneratePInvoke,Version=2 */
200 /* @GenerateCBinding,GeneratePInvoke,Version=2 */
203 const static int TickEvent
;
205 bool IsStopped () { return stopped
; }
206 bool IsStarted () { return started
; }
209 virtual Duration
GetNaturalDurationCore (Clock
*clock
);
210 virtual void TeardownClock ();
213 virtual void OnClockCompleted ();
220 #endif /* MOON_TIMELINE_H */