1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
5 * Copyright 2007 Novell, Inc. (http://www.novell.com)
7 * See the LICENSE file included with the distribution for details.
11 #ifndef __MOON_TRIGGER_H__
12 #define __MOON_TRIGGER_H__
16 #include "dependencyobject.h"
18 /* @Namespace=System.Windows */
19 class TriggerBase
: public DependencyObject
{
21 /* @GenerateCBinding,GeneratePInvoke,ManagedAccess=Internal */
22 TriggerBase () { SetObjectType (Type::TRIGGERBASE
); }
25 /* @Namespace=System.Windows */
26 class TriggerAction
: public DependencyObject
{
28 /* @GenerateCBinding,GeneratePInvoke,ManagedAccess=Internal */
29 TriggerAction () { SetObjectType (Type::TRIGGERACTION
); }
31 /* @GenerateCBinding */
32 virtual void Fire () {}
35 virtual ~TriggerAction () {}
39 /* @ContentProperty="Actions" */
40 /* @Namespace=System.Windows */
41 class EventTrigger
: public TriggerBase
{
42 int registered_event_id
;
44 static void event_trigger_fire_actions (EventObject
*sender
, EventArgs
*calldata
, gpointer closure
);
47 virtual ~EventTrigger ();
50 /* @PropertyType=TriggerActionCollection,AutoCreateValue,ManagedFieldAccess=Internal,ManagedSetterAccess=Internal,GenerateAccessors */
51 const static int ActionsProperty
;
52 /* @PropertyType=string,ManagedPropertyType=RoutedEvent,ManagedFieldAccess=Internal,GenerateAccessors */
53 const static int RoutedEventProperty
;
55 /* @GenerateCBinding,GeneratePInvoke */
58 void SetTarget (DependencyObject
*target
);
59 void RemoveTarget (DependencyObject
*target
);
64 void SetActions (TriggerActionCollection
*value
);
65 TriggerActionCollection
*GetActions ();
67 void SetRoutedEvent (const char *event
);
68 const char *GetRoutedEvent ();
72 void event_trigger_action_add (EventTrigger
*trigger
, TriggerAction
*action
);
75 #endif /* __MOON_TRIGGER_H__ */