Sfoglia il codice sorgente

Add some more channel events.

Change-Id: Iec42294582586783733482f96f6b93d8bdf4002c
Reviewed-on: http://gerrit.dmdirc.com/3475
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Chris Smith <chris@dmdirc.com>
pull/1/head
Greg Holmes 10 anni fa
parent
commit
f09f220f3b

+ 50
- 0
src/com/dmdirc/events/ChannelJoinEvent.java Vedi File

@@ -0,0 +1,50 @@
1
+/*
2
+ * Copyright (c) 2006-2014 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.events;
24
+
25
+import com.dmdirc.Channel;
26
+import com.dmdirc.parser.interfaces.ChannelClientInfo;
27
+
28
+/**
29
+ * Fired when a user joins a channel.
30
+ */
31
+public class ChannelJoinEvent extends ChannelDisplayableEvent {
32
+
33
+    private final ChannelClientInfo client;
34
+
35
+    public ChannelJoinEvent(final long timestamp, final Channel channel,
36
+            final ChannelClientInfo client) {
37
+        super(timestamp, channel);
38
+        this.client = client;
39
+    }
40
+
41
+    public ChannelJoinEvent(final Channel channel, final ChannelClientInfo client) {
42
+        super(channel);
43
+        this.client = client;
44
+    }
45
+
46
+    public ChannelClientInfo getClient() {
47
+        return client;
48
+    }
49
+
50
+}

+ 65
- 0
src/com/dmdirc/events/ChannelKickEvent.java Vedi File

@@ -0,0 +1,65 @@
1
+/*
2
+ * Copyright (c) 2006-2014 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.events;
24
+
25
+import com.dmdirc.Channel;
26
+import com.dmdirc.parser.interfaces.ChannelClientInfo;
27
+
28
+/**
29
+ * Fired when a user is kicked from a channel.
30
+ */
31
+public class ChannelKickEvent extends ChannelDisplayableEvent {
32
+
33
+    private final ChannelClientInfo client;
34
+    private final ChannelClientInfo victim;
35
+    private final String reason;
36
+
37
+    public ChannelKickEvent(final long timestamp, final Channel channel,
38
+            final ChannelClientInfo client, final ChannelClientInfo victim, final String reason) {
39
+        super(timestamp, channel);
40
+        this.client = client;
41
+        this.victim = victim;
42
+        this.reason = reason;
43
+    }
44
+
45
+    public ChannelKickEvent(final Channel channel,
46
+            final ChannelClientInfo client, final ChannelClientInfo victim, final String reason) {
47
+        super(channel);
48
+        this.client = client;
49
+        this.victim = victim;
50
+        this.reason = reason;
51
+    }
52
+
53
+    public ChannelClientInfo getClient() {
54
+        return client;
55
+    }
56
+
57
+    public ChannelClientInfo getVictim() {
58
+        return victim;
59
+    }
60
+
61
+    public String getReason() {
62
+        return reason;
63
+    }
64
+
65
+}

+ 58
- 0
src/com/dmdirc/events/ChannelPartEvent.java Vedi File

@@ -0,0 +1,58 @@
1
+/*
2
+ * Copyright (c) 2006-2014 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.events;
24
+
25
+import com.dmdirc.Channel;
26
+import com.dmdirc.parser.interfaces.ChannelClientInfo;
27
+
28
+/**
29
+ * Fired when a user parts a channel.
30
+ */
31
+public class ChannelPartEvent extends ChannelDisplayableEvent {
32
+
33
+    private final ChannelClientInfo client;
34
+    private final String message;
35
+
36
+    public ChannelPartEvent(final long timestamp, final Channel channel,
37
+            final ChannelClientInfo client, final String message) {
38
+        super(timestamp, channel);
39
+        this.client = client;
40
+        this.message = message;
41
+    }
42
+
43
+    public ChannelPartEvent(final Channel channel, final ChannelClientInfo client,
44
+            final String message) {
45
+        super(channel);
46
+        this.client = client;
47
+        this.message = message;
48
+    }
49
+
50
+    public ChannelClientInfo getClient() {
51
+        return client;
52
+    }
53
+
54
+    public String getMessage() {
55
+        return message;
56
+    }
57
+
58
+}

+ 58
- 0
src/com/dmdirc/events/ChannelQuitEvent.java Vedi File

@@ -0,0 +1,58 @@
1
+/*
2
+ * Copyright (c) 2006-2014 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.events;
24
+
25
+import com.dmdirc.Channel;
26
+import com.dmdirc.parser.interfaces.ChannelClientInfo;
27
+
28
+/**
29
+ * Fired when a user quits in a channel.
30
+ */
31
+public class ChannelQuitEvent extends ChannelDisplayableEvent {
32
+
33
+    private final ChannelClientInfo client;
34
+    private final String message;
35
+
36
+    public ChannelQuitEvent(final long timestamp, final Channel channel,
37
+            final ChannelClientInfo client, final String message) {
38
+        super(timestamp, channel);
39
+        this.client = client;
40
+        this.message = message;
41
+    }
42
+
43
+    public ChannelQuitEvent(final Channel channel, final ChannelClientInfo client,
44
+            final String message) {
45
+        super(channel);
46
+        this.client = client;
47
+        this.message = message;
48
+    }
49
+
50
+    public ChannelClientInfo getClient() {
51
+        return client;
52
+    }
53
+
54
+    public String getMessage() {
55
+        return message;
56
+    }
57
+
58
+}

Loading…
Annulla
Salva