comparison dwt/internal/cocoa/DOMEvent.d @ 0:380af2bdd8e5

Upload of whole dwt tree
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Sat, 09 Aug 2008 17:00:02 +0200
parents
children f565d3a95c0a
comparison
equal deleted inserted replaced
-1:000000000000 0:380af2bdd8e5
1 /*******************************************************************************
2 * Port to the D Programming language:
3 * Jacob Carlborg <jacob.carlborg@gmail.com>
4 *******************************************************************************/
5 module dwt.internal.cocoa.DOMEvent;
6
7 import dwt.internal.cocoa.NSObject;
8 import dwt.internal.cocoa.NSString;
9 import dwt.internal.cocoa.OS;
10 import objc = dwt.internal.objc.objc : id;
11
12 public class DOMEvent : NSObject {
13
14 public this () {
15 super();
16 }
17
18 public this (objc.id id) {
19 super(id);
20 }
21
22 public bool bubbles () {
23 return OS.objc_msgSend(this.id, OS.sel_bubbles) !is null;
24 }
25
26 public bool cancelable () {
27 return OS.objc_msgSend(this.id, OS.sel_cancelable) !is null;
28 }
29
30 public id currentTarget () {
31 objc.id result = OS.objc_msgSend(this.id, OS.sel_currentTarget);
32 return result !is null ? new id(result) : null;
33 }
34
35 public short eventPhase () {
36 return cast(short) OS.objc_msgSend(this.id, OS.sel_eventPhase);
37 }
38
39 public void initEvent___ (NSString initEvent, bool canBubbleArg, bool cancelableArg) {
40 OS.objc_msgSend(this.id, OS.sel_initEvent_1_1_1, initEvent !is null ? initEvent.id : null, canBubbleArg, cancelableArg);
41 }
42
43 public void initEvent_canBubbleArg_cancelableArg_ (NSString eventTypeArg, bool canBubbleArg, bool cancelableArg) {
44 OS.objc_msgSend(this.id, OS.sel_initEvent_1canBubbleArg_1cancelableArg_1, eventTypeArg !is null ? eventTypeArg.id : null, canBubbleArg,
45 cancelableArg);
46 }
47
48 public void preventDefault () {
49 OS.objc_msgSend(this.id, OS.sel_preventDefault);
50 }
51
52 public void stopPropagation () {
53 OS.objc_msgSend(this.id, OS.sel_stopPropagation);
54 }
55
56 public id target () {
57 objc.id result = OS.objc_msgSend(this.id, OS.sel_target);
58 return result !is null ? new id(result) : null;
59 }
60
61 public long timeStamp () {
62 return cast(long) OS.objc_msgSend(this.id, OS.sel_timeStamp);
63 }
64
65 public NSString type () {
66 objc.id result = OS.objc_msgSend(this.id, OS.sel_type);
67 return result !is null ? new NSString(result) : null;
68 }
69 }