~ubuntu-branches/ubuntu/karmic/moon/karmic

« back to all changes in this revision

Viewing changes to src/trigger.h

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2009-02-14 12:01:08 UTC
  • Revision ID: james.westby@ubuntu.com-20090214120108-06539vb25vhbd8bn
Tags: upstream-1.0
ImportĀ upstreamĀ versionĀ 1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 
2
/*
 
3
 * trigger.h
 
4
 *
 
5
 * Copyright 2007 Novell, Inc. (http://www.novell.com)
 
6
 *
 
7
 * See the LICENSE file included with the distribution for details.
 
8
 * 
 
9
 */
 
10
 
 
11
#ifndef __MOON_TRIGGER_H__
 
12
#define __MOON_TRIGGER_H__
 
13
 
 
14
#include <glib.h>
 
15
 
 
16
#include "dependencyobject.h"
 
17
 
 
18
/* @Namespace=None */
 
19
class TriggerAction : public DependencyObject {
 
20
 public:
 
21
        /* @GenerateCBinding,GeneratePInvoke */
 
22
        TriggerAction () {}
 
23
        
 
24
        virtual Type::Kind GetObjectType () { return Type::TRIGGERACTION; }
 
25
        
 
26
        /* @GenerateCBinding */
 
27
        virtual void Fire () {}
 
28
 
 
29
 protected:
 
30
        virtual ~TriggerAction () {}
 
31
};
 
32
 
 
33
 
 
34
/* @ContentProperty="Actions" */
 
35
/* @Namespace=System.Windows */
 
36
class EventTrigger : public DependencyObject {
 
37
        int registered_event_id;
 
38
        
 
39
        static void event_trigger_fire_actions (EventObject *sender, EventArgs *calldata, gpointer closure);
 
40
        
 
41
 protected:
 
42
        virtual ~EventTrigger ();
 
43
        
 
44
 public:
 
45
        /* @PropertyType=TriggerActionCollection,ManagedFieldAccess=Internal,ManagedSetterAccess=Internal,GenerateAccessors */
 
46
        static DependencyProperty *ActionsProperty;
 
47
        /* @PropertyType=string,ManagedPropertyType=RoutedEvent,ManagedFieldAccess=Internal,GenerateAccessors */
 
48
        static DependencyProperty *RoutedEventProperty;
 
49
        
 
50
        /* @GenerateCBinding,GeneratePInvoke */
 
51
        EventTrigger ();
 
52
        
 
53
        virtual Type::Kind GetObjectType () { return Type::EVENTTRIGGER; }
 
54
 
 
55
        void SetTarget (DependencyObject *target);
 
56
        void RemoveTarget (DependencyObject *target);
 
57
 
 
58
        //
 
59
        // Property Accessors
 
60
        //
 
61
        void SetActions (TriggerActionCollection *value);
 
62
        TriggerActionCollection *GetActions ();
 
63
        
 
64
        void SetRoutedEvent (const char *event);
 
65
        const char *GetRoutedEvent ();
 
66
};
 
67
 
 
68
G_BEGIN_DECLS
 
69
void event_trigger_action_add (EventTrigger *trigger, TriggerAction *action);
 
70
G_END_DECLS
 
71
 
 
72
#endif /* __MOON_TRIGGER_H__ */