Browse Source

Rewrote callback system.

To add a callback now, use: myIRCParser.getCallbackManager().addCallback("OnDebugInfo", this[, "#channel"])
(the channel parameter is taken only by Channel callbacks - excluding ChannelSelfJoin)


git-svn-id: http://svn.dmdirc.com/trunk@204 00569f92-eb28-0410-84fd-f71c24880f
tags/0.1
Shane Mc Cormack 17 years ago
parent
commit
2b851bd7d3
75 changed files with 4170 additions and 2218 deletions
  1. 202
    0
      src/uk/org/ownage/dmdirc/parser/CallbackManager.java
  2. 35
    0
      src/uk/org/ownage/dmdirc/parser/CallbackNotFound.java
  3. 88
    0
      src/uk/org/ownage/dmdirc/parser/CallbackObject.java
  4. 71
    0
      src/uk/org/ownage/dmdirc/parser/CallbackObjectSpecific.java
  5. 57
    0
      src/uk/org/ownage/dmdirc/parser/CallbackOnChannelAction.java
  6. 58
    0
      src/uk/org/ownage/dmdirc/parser/CallbackOnChannelCTCP.java
  7. 58
    0
      src/uk/org/ownage/dmdirc/parser/CallbackOnChannelCTCPReply.java
  8. 54
    0
      src/uk/org/ownage/dmdirc/parser/CallbackOnChannelGotNames.java
  9. 55
    0
      src/uk/org/ownage/dmdirc/parser/CallbackOnChannelJoin.java
  10. 58
    0
      src/uk/org/ownage/dmdirc/parser/CallbackOnChannelKick.java
  11. 57
    0
      src/uk/org/ownage/dmdirc/parser/CallbackOnChannelMessage.java
  12. 57
    0
      src/uk/org/ownage/dmdirc/parser/CallbackOnChannelModeChanged.java
  13. 58
    0
      src/uk/org/ownage/dmdirc/parser/CallbackOnChannelNotice.java
  14. 56
    0
      src/uk/org/ownage/dmdirc/parser/CallbackOnChannelPart.java
  15. 56
    0
      src/uk/org/ownage/dmdirc/parser/CallbackOnChannelQuit.java
  16. 51
    0
      src/uk/org/ownage/dmdirc/parser/CallbackOnChannelSelfJoin.java
  17. 55
    0
      src/uk/org/ownage/dmdirc/parser/CallbackOnChannelTopic.java
  18. 58
    0
      src/uk/org/ownage/dmdirc/parser/CallbackOnChannelUserModeChanged.java
  19. 51
    0
      src/uk/org/ownage/dmdirc/parser/CallbackOnDataIn.java
  20. 52
    0
      src/uk/org/ownage/dmdirc/parser/CallbackOnDataOut.java
  21. 52
    0
      src/uk/org/ownage/dmdirc/parser/CallbackOnDebugInfo.java
  22. 53
    0
      src/uk/org/ownage/dmdirc/parser/CallbackOnErrorInfo.java
  23. 50
    0
      src/uk/org/ownage/dmdirc/parser/CallbackOnMOTDEnd.java
  24. 52
    0
      src/uk/org/ownage/dmdirc/parser/CallbackOnNickChanged.java
  25. 50
    0
      src/uk/org/ownage/dmdirc/parser/CallbackOnNickInUse.java
  26. 53
    0
      src/uk/org/ownage/dmdirc/parser/CallbackOnPrivateAction.java
  27. 54
    0
      src/uk/org/ownage/dmdirc/parser/CallbackOnPrivateCTCP.java
  28. 54
    0
      src/uk/org/ownage/dmdirc/parser/CallbackOnPrivateCTCPReply.java
  29. 53
    0
      src/uk/org/ownage/dmdirc/parser/CallbackOnPrivateMessage.java
  30. 53
    0
      src/uk/org/ownage/dmdirc/parser/CallbackOnPrivateNotice.java
  31. 52
    0
      src/uk/org/ownage/dmdirc/parser/CallbackOnQuit.java
  32. 50
    0
      src/uk/org/ownage/dmdirc/parser/CallbackOnServerReady.java
  33. 54
    0
      src/uk/org/ownage/dmdirc/parser/CallbackOnUnknownAction.java
  34. 55
    0
      src/uk/org/ownage/dmdirc/parser/CallbackOnUnknownCTCP.java
  35. 55
    0
      src/uk/org/ownage/dmdirc/parser/CallbackOnUnknownCTCPReply.java
  36. 54
    0
      src/uk/org/ownage/dmdirc/parser/CallbackOnUnknownMessage.java
  37. 54
    0
      src/uk/org/ownage/dmdirc/parser/CallbackOnUnknownNotice.java
  38. 52
    0
      src/uk/org/ownage/dmdirc/parser/CallbackOnUserModeChanged.java
  39. 30
    0
      src/uk/org/ownage/dmdirc/parser/ICallbackInterface.java
  40. 48
    0
      src/uk/org/ownage/dmdirc/parser/IChannelAction.java
  41. 49
    0
      src/uk/org/ownage/dmdirc/parser/IChannelCTCP.java
  42. 49
    0
      src/uk/org/ownage/dmdirc/parser/IChannelCTCPReply.java
  43. 41
    0
      src/uk/org/ownage/dmdirc/parser/IChannelGotNames.java
  44. 44
    0
      src/uk/org/ownage/dmdirc/parser/IChannelJoin.java
  45. 47
    0
      src/uk/org/ownage/dmdirc/parser/IChannelKick.java
  46. 48
    0
      src/uk/org/ownage/dmdirc/parser/IChannelMessage.java
  47. 48
    0
      src/uk/org/ownage/dmdirc/parser/IChannelModeChanged.java
  48. 48
    0
      src/uk/org/ownage/dmdirc/parser/IChannelNotice.java
  49. 45
    0
      src/uk/org/ownage/dmdirc/parser/IChannelPart.java
  50. 45
    0
      src/uk/org/ownage/dmdirc/parser/IChannelQuit.java
  51. 43
    0
      src/uk/org/ownage/dmdirc/parser/IChannelSelfJoin.java
  52. 44
    0
      src/uk/org/ownage/dmdirc/parser/IChannelTopic.java
  53. 47
    0
      src/uk/org/ownage/dmdirc/parser/IChannelUserModeChanged.java
  54. 41
    0
      src/uk/org/ownage/dmdirc/parser/IDataIn.java
  55. 42
    0
      src/uk/org/ownage/dmdirc/parser/IDataOut.java
  56. 42
    0
      src/uk/org/ownage/dmdirc/parser/IDebugInfo.java
  57. 42
    0
      src/uk/org/ownage/dmdirc/parser/IErrorInfo.java
  58. 40
    0
      src/uk/org/ownage/dmdirc/parser/IMOTDEnd.java
  59. 44
    0
      src/uk/org/ownage/dmdirc/parser/INickChanged.java
  60. 40
    0
      src/uk/org/ownage/dmdirc/parser/INickInUse.java
  61. 47
    0
      src/uk/org/ownage/dmdirc/parser/IPrivateAction.java
  62. 48
    0
      src/uk/org/ownage/dmdirc/parser/IPrivateCTCP.java
  63. 48
    0
      src/uk/org/ownage/dmdirc/parser/IPrivateCTCPReply.java
  64. 47
    0
      src/uk/org/ownage/dmdirc/parser/IPrivateMessage.java
  65. 47
    0
      src/uk/org/ownage/dmdirc/parser/IPrivateNotice.java
  66. 44
    0
      src/uk/org/ownage/dmdirc/parser/IQuit.java
  67. 353
    2214
      src/uk/org/ownage/dmdirc/parser/IRCParser.java
  68. 40
    0
      src/uk/org/ownage/dmdirc/parser/IServerReady.java
  69. 48
    0
      src/uk/org/ownage/dmdirc/parser/IUnknownAction.java
  70. 49
    0
      src/uk/org/ownage/dmdirc/parser/IUnknownCTCP.java
  71. 49
    0
      src/uk/org/ownage/dmdirc/parser/IUnknownCTCPReply.java
  72. 48
    0
      src/uk/org/ownage/dmdirc/parser/IUnknownMessage.java
  73. 48
    0
      src/uk/org/ownage/dmdirc/parser/IUnknownNotice.java
  74. 46
    0
      src/uk/org/ownage/dmdirc/parser/IUserModeChanged.java
  75. 4
    4
      src/uk/org/ownage/dmdirc/parser/ParserError.java

+ 202
- 0
src/uk/org/ownage/dmdirc/parser/CallbackManager.java View File

@@ -0,0 +1,202 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+import java.util.Hashtable;
28
+import java.util.Enumeration;
29
+
30
+/**
31
+ * IRC Parser Callback Manager.
32
+ * Manages adding/removing/calling callbacks.
33
+ *
34
+ * @author            Shane Mc Cormack
35
+ * @version           $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
36
+ */
37
+public class CallbackManager {
38
+	/** Reference to the parser object that owns this CallbackManager*/
39
+	IRCParser myParser = null;
40
+			
41
+	/** Constructor to create a CallbackManager */
42
+	public CallbackManager(IRCParser parser) {
43
+		myParser = parser;
44
+		// Add callbacks
45
+		addCallbackType(new CallbackOnChannelAction(myParser, this));
46
+		addCallbackType(new CallbackOnChannelCTCP(myParser, this));
47
+		addCallbackType(new CallbackOnChannelCTCPReply(myParser, this));
48
+		addCallbackType(new CallbackOnChannelGotNames(myParser, this));
49
+		addCallbackType(new CallbackOnChannelJoin(myParser, this));
50
+		addCallbackType(new CallbackOnChannelKick(myParser, this));
51
+		addCallbackType(new CallbackOnChannelMessage(myParser, this));
52
+		addCallbackType(new CallbackOnChannelModeChanged(myParser, this));
53
+		addCallbackType(new CallbackOnChannelNotice(myParser, this));
54
+		addCallbackType(new CallbackOnChannelPart(myParser, this));
55
+		addCallbackType(new CallbackOnChannelQuit(myParser, this));
56
+		addCallbackType(new CallbackOnChannelSelfJoin(myParser, this));
57
+		addCallbackType(new CallbackOnChannelTopic(myParser, this));
58
+		addCallbackType(new CallbackOnChannelUserModeChanged(myParser, this));
59
+		addCallbackType(new CallbackOnDataIn(myParser, this));
60
+		addCallbackType(new CallbackOnDataOut(myParser, this));
61
+		addCallbackType(new CallbackOnDebugInfo(myParser, this));
62
+		addCallbackType(new CallbackOnErrorInfo(myParser, this));
63
+		addCallbackType(new CallbackOnMOTDEnd(myParser, this));
64
+		addCallbackType(new CallbackOnNickChanged(myParser, this));
65
+		addCallbackType(new CallbackOnNickInUse(myParser, this));
66
+		addCallbackType(new CallbackOnPrivateAction(myParser, this));
67
+		addCallbackType(new CallbackOnPrivateCTCP(myParser, this));
68
+		addCallbackType(new CallbackOnPrivateCTCPReply(myParser, this));
69
+		addCallbackType(new CallbackOnPrivateMessage(myParser, this));
70
+		addCallbackType(new CallbackOnPrivateNotice(myParser, this));
71
+		addCallbackType(new CallbackOnQuit(myParser, this));
72
+		addCallbackType(new CallbackOnServerReady(myParser, this));
73
+		addCallbackType(new CallbackOnUnknownAction(myParser, this));
74
+		addCallbackType(new CallbackOnUnknownCTCP(myParser, this));
75
+		addCallbackType(new CallbackOnUnknownCTCPReply(myParser, this));
76
+		addCallbackType(new CallbackOnUnknownMessage(myParser, this));
77
+		addCallbackType(new CallbackOnUnknownNotice(myParser, this));
78
+		addCallbackType(new CallbackOnUserModeChanged(myParser, this));
79
+	}
80
+	
81
+	/** Don't allow cloning to get more copies of the CallbackManager */
82
+	public Object clone() throws CloneNotSupportedException {
83
+		throw new CloneNotSupportedException();
84
+	}
85
+	
86
+	private Hashtable<String,CallbackObject> callbackHash = new Hashtable<String,CallbackObject>();
87
+	/**
88
+	 * Add new callback type.
89
+	 *
90
+	 * @param callback CallbackObject subclass for the callback.
91
+	 * @return if adding succeeded or not.
92
+	 */
93
+	public boolean addCallbackType(CallbackObject callback) {
94
+		if (!callbackHash.containsKey(callback.getLowerName())) {
95
+			callbackHash.put(callback.getLowerName(), callback);
96
+			return true;
97
+		}
98
+		return false;
99
+	}
100
+		
101
+	/**
102
+	 * Remove a callback type.
103
+	 *
104
+	 * @param callback CallbackObject subclass to remove.
105
+	 * @return if removal succeeded or not.
106
+	 */
107
+	public boolean delCallbackType(CallbackObject callback) {
108
+		if (callbackHash.containsKey(callback.getLowerName())) {
109
+			callbackHash.remove(callback.getLowerName());
110
+			return true;
111
+		}
112
+		return false;
113
+	}
114
+		
115
+	/**
116
+	 * Get reference to callback object
117
+	 *
118
+	 * @param callbackName Name of callback object.
119
+	 */
120
+	public CallbackObject getCallbackType(String callbackName) {
121
+		if (callbackHash.containsKey(callbackName.toLowerCase())) {
122
+			CallbackObject res = callbackHash.get(callbackName.toLowerCase());
123
+			return res;
124
+		}
125
+		return null;
126
+	}
127
+	
128
+	/**
129
+	 * Remove all callbacks.
130
+	 *
131
+	 * @param o instance of ICallbackInterface to remove.
132
+	 */
133
+	public void delAllCallback(ICallbackInterface o) {
134
+		CallbackObject cb = null;
135
+		for (Enumeration e = callbackHash.keys(); e.hasMoreElements();) {
136
+			cb = callbackHash.get(e.nextElement());
137
+			if (cb != null) { cb.del(o); }
138
+		}
139
+	}
140
+	
141
+	/**
142
+	 * Add all callbacks.
143
+	 *
144
+	 * @param o instance of ICallbackInterface to add.
145
+	 */
146
+	public void addAllCallback(ICallbackInterface o) {
147
+		CallbackObject cb = null;
148
+		for (Enumeration e = callbackHash.keys(); e.hasMoreElements();) {
149
+			cb = callbackHash.get(e.nextElement());
150
+			if (cb != null) { cb.add(o); }
151
+		}
152
+	}
153
+	
154
+	/**
155
+	 * Add a callback
156
+	 *
157
+	 * @param callbackName Name of callback object.
158
+	 * @param o instance of ICallbackInterface to add.
159
+	 */
160
+	public void addCallback(String callbackName, ICallbackInterface o) {
161
+		CallbackObject cb = getCallbackType(callbackName);
162
+		if (cb != null) { cb.add(o); }
163
+	}
164
+	
165
+	/**
166
+	 * Add a critical callback.
167
+	 * This method will throw a CallbackNotFound Exception if the callback does not exist.
168
+	 * This should be used if a callback is essential for execution
169
+	 *
170
+	 * @param callbackName Name of callback object.
171
+	 * @param o instance of ICallbackInterface to add.
172
+	 */
173
+	public void addCriticalCallback(String callbackName, ICallbackInterface o) throws CallbackNotFound {
174
+		CallbackObject cb = getCallbackType(callbackName);
175
+		if (cb != null) { cb.add(o); }
176
+		else { throw new CallbackNotFound("Callback '"+callbackName+"' could not be found.");  }
177
+	}
178
+	
179
+	/**
180
+	 * Remove a callback
181
+	 *
182
+	 * @param callbackName Name of callback object.
183
+	 * @param o instance of ICallbackInterface to remove.
184
+	 */
185
+	public void delCallback(String callbackName, ICallbackInterface o) {
186
+		CallbackObject cb = getCallbackType(callbackName);
187
+		if (cb != null) { cb.del(o); }
188
+	}
189
+	
190
+	/**
191
+	 * Add a callback with a specific target
192
+	 *
193
+	 * @param callbackName Name of callback object.
194
+	 * @param o instance of ICallbackInterface to add.
195
+	 * @param specific instance of ICallbackInterface to add.
196
+	 */
197
+	public void addCallback(String callbackName, ICallbackInterface o, String target) {
198
+		CallbackObjectSpecific cb = (CallbackObjectSpecific)getCallbackType(callbackName);
199
+		if (cb != null) { cb.add(o,target); }
200
+	}
201
+
202
+}

+ 35
- 0
src/uk/org/ownage/dmdirc/parser/CallbackNotFound.java View File

@@ -0,0 +1,35 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/**
28
+ * IRC Parser Callback Exception.
29
+ *
30
+ * @author            Shane Mc Cormack
31
+ * @version           $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
32
+ */
33
+public class CallbackNotFound extends Exception {
34
+	public CallbackNotFound(String message) { super(message); }
35
+}

+ 88
- 0
src/uk/org/ownage/dmdirc/parser/CallbackObject.java View File

@@ -0,0 +1,88 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+import java.util.Hashtable;
28
+import java.util.ArrayList;
29
+/**
30
+ * CallbackObject.
31
+ * Superclass for all callback types.
32
+ *
33
+ * @author            Shane Mc Cormack
34
+ * @version           $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
35
+ */
36
+public abstract class CallbackObject {
37
+	/**
38
+	 * Arraylist for storing callback information related to the callback.
39
+	 */
40
+	protected ArrayList<ICallbackInterface> callbackInfo = new ArrayList<ICallbackInterface>();
41
+	
42
+	/** Add a callback pointer to the appropriate ArrayList. */
43
+	protected void addCallback(ICallbackInterface eMethod) {
44
+		for (int i = 0; i < callbackInfo.size(); i++) {
45
+			if (eMethod.equals(callbackInfo.get(i))) { return; }
46
+		}
47
+		callbackInfo.add((ICallbackInterface)eMethod);
48
+	}
49
+	/** Delete a callback pointer from the appropriate ArrayList. */
50
+	protected void delCallback(ICallbackInterface eMethod) {
51
+		for (int i = 0; i < callbackInfo.size(); i++) {
52
+			if (eMethod.equals(callbackInfo.get(i))) { callbackInfo.remove(i); break; }
53
+		}
54
+	}
55
+	
56
+	protected boolean callErrorInfo(ParserError errorInfo) {
57
+		CallbackOnErrorInfo cb = (CallbackOnErrorInfo)myManager.getCallbackType("ErrorInfo");
58
+		if (cb != null) { return cb.call(errorInfo); }
59
+		return false;
60
+	}
61
+	
62
+	protected CallbackObject (IRCParser parser, CallbackManager manager) {
63
+		this.myParser = parser;
64
+		this.myManager = manager;
65
+	}
66
+	
67
+	IRCParser myParser = null;
68
+	CallbackManager myManager = null;
69
+	
70
+	public void add(ICallbackInterface eMethod) { addCallback(eMethod); }
71
+	public void del(ICallbackInterface eMethod) { delCallback(eMethod); }
72
+	
73
+	/** Get the name for this callback - must be overridden */
74
+//	public abstract String getName();
75
+	public String getName() {
76
+		Package thisPackage = this.getClass().getPackage();
77
+		int packageLength = 0;
78
+		if (thisPackage != null) {
79
+			packageLength = thisPackage.getName().length()+1;
80
+		}
81
+		return this.getClass().getName().substring(packageLength+8); // 8 is the length of "Callback"
82
+	}
83
+	
84
+	/** Get the name for this callback in lowercase */
85
+	public String getLowerName() {
86
+		return this.getName().toLowerCase();
87
+	}
88
+}

+ 71
- 0
src/uk/org/ownage/dmdirc/parser/CallbackObjectSpecific.java View File

@@ -0,0 +1,71 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+import java.util.Hashtable;
28
+import java.util.ArrayList;
29
+/**
30
+ * CallbackObjectSpecific.
31
+ * Superclass for all callback types that have a "specific" target.
32
+ *
33
+ * @author            Shane Mc Cormack
34
+ * @version           $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
35
+ */
36
+public abstract class CallbackObjectSpecific extends CallbackObject {
37
+	/**
38
+	 * Hashtable for storing specific information for callback.
39
+	 */	
40
+	protected Hashtable<ICallbackInterface,String> specificData = new Hashtable<ICallbackInterface,String>();
41
+	
42
+	/** Used to check if a channel matches the specificData */
43
+	protected boolean isValidChan(ICallbackInterface eMethod, ChannelInfo cChannel) {
44
+		if (specificData.containsKey(eMethod)) { 
45
+			if (!cChannel.getName().equalsIgnoreCase(specificData.get(eMethod))) { return false; }
46
+		}
47
+		return true;
48
+	}
49
+	
50
+	// We override the default add method to make sure that any add with no
51
+	// specifics will have the specific data removed.
52
+	public void add(ICallbackInterface eMethod) {
53
+		addCallback(eMethod);
54
+		if (specificData.containsKey(eMethod)) { specificData.remove(eMethod); }
55
+	}
56
+	
57
+	public void add(ICallbackInterface eMethod, String channelName) {
58
+		add(eMethod);
59
+		if (!channelName.equals("")) {
60
+			specificData.put(eMethod,channelName);
61
+		}
62
+	}
63
+	
64
+	public void del(ICallbackInterface eMethod) {
65
+		delCallback(eMethod);
66
+		if (specificData.containsKey(eMethod)) { specificData.remove(eMethod); }
67
+	}
68
+	
69
+	// Stupid lack of Constructor inheritance...
70
+	public CallbackObjectSpecific (IRCParser parser, CallbackManager manager) { super(parser, manager); }
71
+}

+ 57
- 0
src/uk/org/ownage/dmdirc/parser/CallbackOnChannelAction.java View File

@@ -0,0 +1,57 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+public class CallbackOnChannelAction extends CallbackObjectSpecific {
28
+	/**
29
+	 * Callback to all objects implementing the IChannelAction Interface.
30
+	 *
31
+	 * @see IChannelAction
32
+	 * @param cChannel Channel where the action was sent to
33
+	 * @param cChannelClient ChannelClient who sent the action (may be null if server)
34
+	 * @param sMessage action contents
35
+	 * @param sHost Hostname of sender (or servername)
36
+	 */
37
+	protected boolean call(ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sMessage, String sHost) {
38
+		boolean bResult = false;
39
+		IChannelAction eMethod = null;
40
+		for (int i = 0; i < callbackInfo.size(); i++) {
41
+			eMethod = (IChannelAction)callbackInfo.get(i);
42
+			if (!this.isValidChan(eMethod, cChannel)) { continue; }
43
+			try {
44
+				eMethod.onChannelAction(myParser, cChannel, cChannelClient, sMessage, sHost);
45
+			} catch (Exception e) {
46
+				ParserError ei = new ParserError(ParserError.errError, "Exception in onChannelAction");
47
+				ei.setException(e);
48
+				callErrorInfo(ei);
49
+			}
50
+			bResult = true;
51
+		}
52
+		return bResult;
53
+	}	
54
+
55
+	// Stupid lack of Constructor inheritance...
56
+	public CallbackOnChannelAction (IRCParser parser, CallbackManager manager) { super(parser, manager); }
57
+}

+ 58
- 0
src/uk/org/ownage/dmdirc/parser/CallbackOnChannelCTCP.java View File

@@ -0,0 +1,58 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+public class CallbackOnChannelCTCP extends CallbackObjectSpecific {
28
+	/**
29
+	 * Callback to all objects implementing the IChannelCTCP Interface.
30
+	 *
31
+	 * @see IChannelCTCP
32
+	 * @param cChannel Channel where CTCP was sent
33
+	 * @param cChannelClient ChannelClient who sent the message (may be null if server)
34
+	 * @param sType Type of CTCP (VERSION, TIME etc)
35
+	 * @param sMessage Additional contents
36
+	 * @param sHost Hostname of sender (or servername)
37
+	 */
38
+	protected boolean call(ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sType, String sMessage, String sHost) {
39
+		boolean bResult = false;
40
+		IChannelCTCP eMethod = null;
41
+		for (int i = 0; i < callbackInfo.size(); i++) {
42
+			eMethod = (IChannelCTCP)callbackInfo.get(i);
43
+			if (!this.isValidChan(eMethod, cChannel)) { continue; }
44
+			try {
45
+				eMethod.onChannelCTCP(myParser, cChannel, cChannelClient, sType, sMessage, sHost);
46
+			} catch (Exception e) {
47
+				ParserError ei = new ParserError(ParserError.errError, "Exception in onChannelCTCP");
48
+				ei.setException(e);
49
+				callErrorInfo(ei);
50
+			}
51
+			bResult = true;
52
+		}
53
+		return bResult;
54
+	}	
55
+		
56
+	// Stupid lack of Constructor inheritance...
57
+	public CallbackOnChannelCTCP (IRCParser parser, CallbackManager manager) { super(parser, manager); }
58
+}

+ 58
- 0
src/uk/org/ownage/dmdirc/parser/CallbackOnChannelCTCPReply.java View File

@@ -0,0 +1,58 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+public class CallbackOnChannelCTCPReply extends CallbackObjectSpecific {
28
+	/**
29
+	 * Callback to all objects implementing the IChannelCTCPReply Interface.
30
+	 *
31
+	 * @see IChannelCTCPReply
32
+	 * @param cChannel Channel where CTCPReply was sent
33
+	 * @param cChannelClient ChannelClient who sent the message (may be null if server)
34
+	 * @param sType Type of CTCPRReply (VERSION, TIME etc)
35
+	 * @param sMessage Reply Contents
36
+	 * @param sHost Hostname of sender (or servername)
37
+	 */
38
+	protected boolean call(ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sType, String sMessage, String sHost) {
39
+		boolean bResult = false;
40
+		IChannelCTCPReply eMethod = null;
41
+		for (int i = 0; i < callbackInfo.size(); i++) {
42
+			eMethod = (IChannelCTCPReply)callbackInfo.get(i);
43
+			if (!this.isValidChan(eMethod, cChannel)) { continue; }
44
+			try {
45
+				eMethod.onChannelCTCPReply(myParser, cChannel, cChannelClient, sType, sMessage, sHost);
46
+			} catch (Exception e) {
47
+				ParserError ei = new ParserError(ParserError.errError, "Exception in onChannelCTCPReply");
48
+				ei.setException(e);
49
+				callErrorInfo(ei);
50
+			}
51
+			bResult = true;
52
+		}
53
+		return bResult;
54
+	}	
55
+	
56
+	// Stupid lack of Constructor inheritance...
57
+	public CallbackOnChannelCTCPReply (IRCParser parser, CallbackManager manager) { super(parser, manager); }
58
+}

+ 54
- 0
src/uk/org/ownage/dmdirc/parser/CallbackOnChannelGotNames.java View File

@@ -0,0 +1,54 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+public class CallbackOnChannelGotNames extends CallbackObjectSpecific {
28
+	/**
29
+	 * Callback to all objects implementing the IChannelGotNames Interface.
30
+	 *
31
+	 * @see IChannelGotNames
32
+	 * @param cChannel Channel which the names reply is for
33
+	 */
34
+	protected boolean call(ChannelInfo cChannel) {
35
+		boolean bResult = false;
36
+		IChannelGotNames eMethod = null;
37
+		for (int i = 0; i < callbackInfo.size(); i++) {
38
+			eMethod = (IChannelGotNames)callbackInfo.get(i);
39
+			if (!this.isValidChan(eMethod, cChannel)) { continue; }
40
+			try {
41
+				eMethod.onChannelGotNames(myParser, cChannel);
42
+			} catch (Exception e) {
43
+				ParserError ei = new ParserError(ParserError.errError, "Exception in onChannelGotNames");
44
+				ei.setException(e);
45
+				callErrorInfo(ei);
46
+			}
47
+			bResult = true;
48
+		}
49
+		return bResult;
50
+	}	
51
+	
52
+	// Stupid lack of Constructor inheritance...
53
+	public CallbackOnChannelGotNames (IRCParser parser, CallbackManager manager) { super(parser, manager); }
54
+}

+ 55
- 0
src/uk/org/ownage/dmdirc/parser/CallbackOnChannelJoin.java View File

@@ -0,0 +1,55 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+public class CallbackOnChannelJoin extends CallbackObjectSpecific {
28
+	/**
29
+	 * Callback to all objects implementing the IChannelJoin Interface.
30
+	 *
31
+	 * @see IChannelJoin
32
+	 * @param cChannel Channel Object
33
+	 * @param cChannelClient ChannelClient object for new person
34
+	 */
35
+	protected boolean call(ChannelInfo cChannel, ChannelClientInfo cChannelClient) {
36
+		boolean bResult = false;
37
+		IChannelJoin eMethod = null;
38
+		for (int i = 0; i < callbackInfo.size(); i++) {
39
+			eMethod = (IChannelJoin)callbackInfo.get(i);
40
+			if (!this.isValidChan(eMethod, cChannel)) { continue; }
41
+			try {
42
+				eMethod.onChannelJoin(myParser, cChannel, cChannelClient);
43
+			} catch (Exception e) {
44
+				ParserError ei = new ParserError(ParserError.errError, "Exception in onChannelJoin");
45
+				ei.setException(e);
46
+				callErrorInfo(ei);
47
+			}
48
+			bResult = true;
49
+		}
50
+		return bResult;
51
+	}	
52
+		
53
+	// Stupid lack of Constructor inheritance...
54
+	public CallbackOnChannelJoin (IRCParser parser, CallbackManager manager) { super(parser, manager); }
55
+}

+ 58
- 0
src/uk/org/ownage/dmdirc/parser/CallbackOnChannelKick.java View File

@@ -0,0 +1,58 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+public class CallbackOnChannelKick extends CallbackObjectSpecific {
28
+	/**
29
+	 * Callback to all objects implementing the IChannelKick Interface.
30
+	 *
31
+	 * @see IChannelKick
32
+	 * @param cChannel Channel where the kick took place
33
+	 * @param cKickedClient ChannelClient that got kicked
34
+	 * @param cKickedByClient ChannelClient that did the kicking (may be null if server)
35
+	 * @param sReason Reason for kick (may be "")
36
+	 * @param sKickedByHost Hostname of Kicker (or servername)
37
+	 */
38
+	protected boolean call(ChannelInfo cChannel, ChannelClientInfo cKickedClient, ChannelClientInfo cKickedByClient, String sReason, String sKickedByHost) {
39
+		boolean bResult = false;
40
+		IChannelKick eMethod = null;
41
+		for (int i = 0; i < callbackInfo.size(); i++) {
42
+			eMethod = (IChannelKick)callbackInfo.get(i);
43
+			if (!this.isValidChan(eMethod, cChannel)) { continue; }
44
+			try {
45
+				eMethod.onChannelKick(myParser, cChannel, cKickedClient, cKickedByClient, sReason, sKickedByHost);
46
+			} catch (Exception e) {
47
+				ParserError ei = new ParserError(ParserError.errError, "Exception in onChannelKick");
48
+				ei.setException(e);
49
+				callErrorInfo(ei);
50
+			}
51
+			bResult = true;
52
+		}
53
+		return bResult;
54
+	}	
55
+	
56
+	// Stupid lack of Constructor inheritance...
57
+	public CallbackOnChannelKick (IRCParser parser, CallbackManager manager) { super(parser, manager); }
58
+}

+ 57
- 0
src/uk/org/ownage/dmdirc/parser/CallbackOnChannelMessage.java View File

@@ -0,0 +1,57 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+public class CallbackOnChannelMessage extends CallbackObjectSpecific {
28
+	/**
29
+	 * Callback to all objects implementing the IChannelMessage Interface.
30
+	 *
31
+	 * @see IChannelMessage
32
+	 * @param cChannel Channel where the message was sent to
33
+	 * @param cChannelClient ChannelClient who sent the message (may be null if server)
34
+	 * @param sMessage Message contents
35
+	 * @param sHost Hostname of sender (or servername)
36
+	 */
37
+	protected boolean call(ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sMessage, String sHost) {
38
+		boolean bResult = false;
39
+		IChannelMessage eMethod = null;
40
+		for (int i = 0; i < callbackInfo.size(); i++) {
41
+			eMethod = (IChannelMessage)callbackInfo.get(i);
42
+			if (!this.isValidChan(eMethod, cChannel)) { continue; }
43
+			try {
44
+				eMethod.onChannelMessage(myParser, cChannel, cChannelClient, sMessage, sHost);
45
+			} catch (Exception e) {
46
+				ParserError ei = new ParserError(ParserError.errError, "Exception in onChannelMessage");
47
+				ei.setException(e);
48
+				callErrorInfo(ei);
49
+			}
50
+			bResult = true;
51
+		}
52
+		return bResult;
53
+	}	
54
+	
55
+	// Stupid lack of Constructor inheritance...
56
+	public CallbackOnChannelMessage (IRCParser parser, CallbackManager manager) { super(parser, manager); }
57
+}

+ 57
- 0
src/uk/org/ownage/dmdirc/parser/CallbackOnChannelModeChanged.java View File

@@ -0,0 +1,57 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+public class CallbackOnChannelModeChanged extends CallbackObjectSpecific {
28
+	/**
29
+	 * Callback to all objects implementing the IChannelModeChanged Interface.
30
+	 *
31
+	 * @see IChannelModeChanged
32
+	 * @param cChannel Channel where modes were changed
33
+	 * @param cChannelClient Client chaning the modes (null if server)
34
+	 * @param sHost Host doing the mode changing (User host or server name)
35
+	 * @param sModes Exact String parsed
36
+	 */
37
+	protected boolean call(ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sHost, String sModes) {
38
+		boolean bResult = false;
39
+		IChannelModeChanged eMethod = null;
40
+		for (int i = 0; i < callbackInfo.size(); i++) {
41
+			eMethod = (IChannelModeChanged)callbackInfo.get(i);
42
+			if (!this.isValidChan(eMethod, cChannel)) { continue; }
43
+			try {
44
+				eMethod.onChannelModeChanged(myParser, cChannel, cChannelClient, sHost, sModes);
45
+			} catch (Exception e) {
46
+				ParserError ei = new ParserError(ParserError.errError, "Exception in onChannelModeChanged");
47
+				ei.setException(e);
48
+				callErrorInfo(ei);
49
+			}
50
+			bResult = true;
51
+		}
52
+		return bResult;
53
+	}	
54
+	
55
+	// Stupid lack of Constructor inheritance...
56
+	public CallbackOnChannelModeChanged (IRCParser parser, CallbackManager manager) { super(parser, manager); }
57
+}

+ 58
- 0
src/uk/org/ownage/dmdirc/parser/CallbackOnChannelNotice.java View File

@@ -0,0 +1,58 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+public class CallbackOnChannelNotice extends CallbackObjectSpecific {
28
+	/**
29
+	 * Callback to all objects implementing the IChannelNotice Interface.
30
+	 *
31
+	 * @see IChannelNotice
32
+	 * @param cChannel Channel where the notice was sent to
33
+	 * @param cChannelClient ChannelClient who sent the notice (may be null if server)
34
+	 * @param sMessage notice contents
35
+	 * @param sHost Hostname of sender (or servername)
36
+	 */
37
+	protected boolean call(ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sMessage, String sHost) {
38
+		boolean bResult = false;
39
+		IChannelNotice eMethod = null;
40
+		for (int i = 0; i < callbackInfo.size(); i++) {
41
+			eMethod = (IChannelNotice)callbackInfo.get(i);
42
+			if (!this.isValidChan(eMethod, cChannel)) { continue; }
43
+			try {
44
+				eMethod.onChannelNotice(myParser, cChannel, cChannelClient, sMessage, sHost);
45
+			} catch (Exception e) {
46
+				ParserError ei = new ParserError(ParserError.errError, "Exception in onChannelNotice");
47
+				ei.setException(e);
48
+				callErrorInfo(ei);
49
+			}
50
+			bResult = true;
51
+		}
52
+		return bResult;
53
+	}
54
+	
55
+	
56
+	// Stupid lack of Constructor inheritance...
57
+	public CallbackOnChannelNotice (IRCParser parser, CallbackManager manager) { super(parser, manager); }
58
+}

+ 56
- 0
src/uk/org/ownage/dmdirc/parser/CallbackOnChannelPart.java View File

@@ -0,0 +1,56 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+public class CallbackOnChannelPart extends CallbackObjectSpecific {
28
+	/**
29
+	 * Callback to all objects implementing the IChannelPart Interface.
30
+	 *
31
+	 * @see IChannelPart
32
+	 * @param cChannel Channel that the user parted
33
+	 * @param cChannelClient Client that parted
34
+	 * @param sReason Reason given for parting (May be "")
35
+	 */
36
+	protected boolean call(ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sReason) {
37
+		boolean bResult = false;
38
+		IChannelPart eMethod = null;
39
+		for (int i = 0; i < callbackInfo.size(); i++) {
40
+			eMethod = (IChannelPart)callbackInfo.get(i);
41
+			if (!this.isValidChan(eMethod, cChannel)) { continue; }
42
+			try {
43
+				eMethod.onChannelPart(myParser, cChannel, cChannelClient, sReason);
44
+			} catch (Exception e) {
45
+				ParserError ei = new ParserError(ParserError.errError, "Exception in onChannelPart");
46
+				ei.setException(e);
47
+				callErrorInfo(ei);
48
+			}
49
+			bResult = true;
50
+		}
51
+		return bResult;
52
+	}
53
+	
54
+	// Stupid lack of Constructor inheritance...
55
+	public CallbackOnChannelPart (IRCParser parser, CallbackManager manager) { super(parser, manager); }
56
+}

+ 56
- 0
src/uk/org/ownage/dmdirc/parser/CallbackOnChannelQuit.java View File

@@ -0,0 +1,56 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+public class CallbackOnChannelQuit extends CallbackObjectSpecific {
28
+	/**
29
+	 * Callback to all objects implementing the IChannelQuit Interface.
30
+	 *
31
+	 * @see IChannelQuit
32
+	 * @param cChannel Channel that user was on
33
+	 * @param cChannelClient User thats quitting
34
+	 * @param sReason Quit reason
35
+	 */
36
+	protected boolean call(ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sReason) {
37
+		boolean bResult = false;
38
+		IChannelQuit eMethod = null;
39
+		for (int i = 0; i < callbackInfo.size(); i++) {
40
+			eMethod = (IChannelQuit)callbackInfo.get(i);
41
+			if (!this.isValidChan(eMethod, cChannel)) { continue; }
42
+			try {
43
+				eMethod.onChannelQuit(myParser, cChannel, cChannelClient, sReason);
44
+			} catch (Exception e) {
45
+				ParserError ei = new ParserError(ParserError.errError, "Exception in onChannelQuit");
46
+				ei.setException(e);
47
+				callErrorInfo(ei);
48
+			}
49
+			bResult = true;
50
+		}
51
+		return bResult;
52
+	}	
53
+	
54
+	// Stupid lack of Constructor inheritance...
55
+	public CallbackOnChannelQuit (IRCParser parser, CallbackManager manager) { super(parser, manager); }
56
+}

+ 51
- 0
src/uk/org/ownage/dmdirc/parser/CallbackOnChannelSelfJoin.java View File

@@ -0,0 +1,51 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+public class CallbackOnChannelSelfJoin extends CallbackObject {
28
+	/**
29
+	 * Callback to all objects implementing the IChannelSelfJoin Interface.
30
+	 *
31
+	 * @see IChannelSelfJoin
32
+	 * @param cChannel Channel Object
33
+	 */
34
+	protected boolean call(ChannelInfo cChannel) {
35
+		boolean bResult = false;
36
+		for (int i = 0; i < callbackInfo.size(); i++) {
37
+			try {
38
+				((IChannelSelfJoin)callbackInfo.get(i)).onChannelSelfJoin(myParser, cChannel);
39
+			} catch (Exception e) {
40
+				ParserError ei = new ParserError(ParserError.errError, "Exception in onChannelSelfJoin");
41
+				ei.setException(e);
42
+				callErrorInfo(ei);
43
+			}
44
+			bResult = true;
45
+		}
46
+		return bResult;
47
+	}	
48
+	
49
+	// Stupid lack of Constructor inheritance...
50
+	public CallbackOnChannelSelfJoin (IRCParser parser, CallbackManager manager) { super(parser, manager); }
51
+}

+ 55
- 0
src/uk/org/ownage/dmdirc/parser/CallbackOnChannelTopic.java View File

@@ -0,0 +1,55 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+public class CallbackOnChannelTopic extends CallbackObjectSpecific {
28
+	/**
29
+	 * Callback to all objects implementing the IChannelTopic Interface.
30
+	 *
31
+	 * @see IChannelTopic
32
+	 * @param cChannel Channel that topic was set on
33
+	 * @param bIsJoinTopic True when getting topic on join, false if set by user/server
34
+	 */
35
+	protected boolean call(ChannelInfo cChannel, boolean bIsJoinTopic) {
36
+		boolean bResult = false;
37
+		IChannelTopic eMethod = null;
38
+		for (int i = 0; i < callbackInfo.size(); i++) {
39
+			eMethod = (IChannelTopic)callbackInfo.get(i);
40
+			if (!this.isValidChan(eMethod, cChannel)) { continue; }
41
+			try {
42
+				eMethod.onChannelTopic(myParser, cChannel, bIsJoinTopic);
43
+			} catch (Exception e) {
44
+				ParserError ei = new ParserError(ParserError.errError, "Exception in onChannelTopic");
45
+				ei.setException(e);
46
+				callErrorInfo(ei);
47
+			}
48
+			bResult = true;
49
+		}
50
+		return bResult;
51
+	}
52
+	
53
+	// Stupid lack of Constructor inheritance...
54
+	public CallbackOnChannelTopic (IRCParser parser, CallbackManager manager) { super(parser, manager); }
55
+}

+ 58
- 0
src/uk/org/ownage/dmdirc/parser/CallbackOnChannelUserModeChanged.java View File

@@ -0,0 +1,58 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+public class CallbackOnChannelUserModeChanged extends CallbackObjectSpecific {
28
+	/**
29
+	 * Callback to all objects implementing the IChannelUserModeChanged Interface.
30
+	 *
31
+	 * @see IChannelUserModeChanged
32
+	 * @param cChannel Channel where modes were changed
33
+	 * @param cChangedClient Client being changed
34
+	 * @param cSetByClient Client chaning the modes (null if server)
35
+	 * @param sMode String representing mode change (ie +o)
36
+	 * @param sHost Host doing the mode changing (User host or server name)
37
+	 */
38
+	protected boolean call(ChannelInfo cChannel, ChannelClientInfo cChangedClient, ChannelClientInfo cSetByClient, String sHost, String sMode) {
39
+		boolean bResult = false;
40
+		IChannelUserModeChanged eMethod = null;
41
+		for (int i = 0; i < callbackInfo.size(); i++) {
42
+			eMethod = (IChannelUserModeChanged)callbackInfo.get(i);
43
+			if (!this.isValidChan(eMethod, cChannel)) { continue; }
44
+			try {
45
+				eMethod.onChannelUserModeChanged(myParser, cChannel, cChangedClient, cSetByClient, sHost, sMode);
46
+			} catch (Exception e) {
47
+				ParserError ei = new ParserError(ParserError.errError, "Exception in onChannelUserModeChanged");
48
+				ei.setException(e);
49
+				callErrorInfo(ei);
50
+			}
51
+			bResult = true;
52
+		}
53
+		return bResult;
54
+	}	
55
+	
56
+	// Stupid lack of Constructor inheritance...
57
+	public CallbackOnChannelUserModeChanged (IRCParser parser, CallbackManager manager) { super(parser, manager); }
58
+}

+ 51
- 0
src/uk/org/ownage/dmdirc/parser/CallbackOnDataIn.java View File

@@ -0,0 +1,51 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+public class CallbackOnDataIn extends CallbackObject {
28
+	/**
29
+	 * Callback to all objects implementing the IDataIn Interface.
30
+	 *
31
+	 * @see IDataIn
32
+	 * @param data Incomming Line.
33
+	 */
34
+	protected boolean call(String data) {
35
+		boolean bResult = false;
36
+		for (int i = 0; i < callbackInfo.size(); i++) {
37
+			try {
38
+				((IDataIn)callbackInfo.get(i)).onDataIn(myParser, data);
39
+			} catch (Exception e) {
40
+				ParserError ei = new ParserError(ParserError.errError, "Exception in onDataIn");
41
+				ei.setException(e);
42
+				callErrorInfo(ei);
43
+			}
44
+			bResult = true;
45
+		}
46
+		return bResult;
47
+	}
48
+	
49
+	// Stupid lack of Constructor inheritance...
50
+	public CallbackOnDataIn (IRCParser parser, CallbackManager manager) { super(parser, manager); }
51
+}

+ 52
- 0
src/uk/org/ownage/dmdirc/parser/CallbackOnDataOut.java View File

@@ -0,0 +1,52 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+public class CallbackOnDataOut extends CallbackObject {
28
+	/**
29
+	 * Callback to all objects implementing the IDataOut Interface.
30
+	 *
31
+	 * @see IDataOut
32
+	 * @param data Outgoing Data
33
+	 * @param FromParser True if parser sent the data, false if sent using .sendLine	 
34
+	 */
35
+	protected boolean call(String data, boolean FromParser) {
36
+		boolean bResult = false;
37
+		for (int i = 0; i < callbackInfo.size(); i++) {
38
+			try {
39
+				((IDataOut)callbackInfo.get(i)).onDataOut(myParser, data, FromParser);
40
+			} catch (Exception e) {
41
+				ParserError ei = new ParserError(ParserError.errError, "Exception in onDataOut");
42
+				ei.setException(e);
43
+				callErrorInfo(ei);
44
+			}
45
+			bResult = true;
46
+		}
47
+		return bResult;
48
+	}
49
+	
50
+	// Stupid lack of Constructor inheritance...
51
+	public CallbackOnDataOut (IRCParser parser, CallbackManager manager) { super(parser, manager); }
52
+}

+ 52
- 0
src/uk/org/ownage/dmdirc/parser/CallbackOnDebugInfo.java View File

@@ -0,0 +1,52 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+public class CallbackOnDebugInfo extends CallbackObject {
28
+	/**
29
+	 * Callback to all objects implementing the IDebugInfo Interface.
30
+	 *
31
+	 * @see IDebugInfo
32
+	 * @param level Debugging Level (ndInfo, ndSocket etc)
33
+	 * @param data Debugging Information
34
+	 */
35
+	protected boolean call(int level, String data) {
36
+		boolean bResult = false;
37
+		for (int i = 0; i < callbackInfo.size(); i++) {
38
+			try {
39
+				((IDebugInfo)callbackInfo.get(i)).onDebugInfo(myParser, level, data);
40
+			} catch (Exception e) {
41
+				ParserError ei = new ParserError(ParserError.errError, "Exception in onDebugInfo");
42
+				ei.setException(e);
43
+				callErrorInfo(ei);
44
+			}
45
+			bResult = true;
46
+		}
47
+		return bResult;
48
+	}
49
+	
50
+	// Stupid lack of Constructor inheritance...
51
+	public CallbackOnDebugInfo (IRCParser parser, CallbackManager manager) { super(parser, manager); }
52
+}

+ 53
- 0
src/uk/org/ownage/dmdirc/parser/CallbackOnErrorInfo.java View File

@@ -0,0 +1,53 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+public class CallbackOnErrorInfo extends CallbackObject {
28
+	/**
29
+	 * Callback to all objects implementing the IErrorInfo Interface.
30
+	 *
31
+	 * @see IErrorInfo
32
+	 * @param level Debugging Level (errFatal, errWarning etc)
33
+	 * @param data Error Information
34
+	 */
35
+	protected boolean call(ParserError errorInfo) {
36
+		if (IRCParser.bDebug) { myParser.doDebug("[ERROR] {%d} %s\n", errorInfo.getLevel(), errorInfo.getData()); }
37
+		boolean bResult = false;
38
+		for (int i = 0; i < callbackInfo.size(); i++) {
39
+			try {
40
+				((IErrorInfo)callbackInfo.get(i)).onErrorInfo(myParser, errorInfo);
41
+			} catch (Exception e) {
42
+				// This will not callErrorInfo or we would get an infinite loop!
43
+				System.out.println("Exception in onError Callback. ["+e.getMessage()+"]");
44
+				e.printStackTrace();
45
+			}
46
+			bResult = true;
47
+		}
48
+		return bResult;
49
+	}	
50
+	
51
+	// Stupid lack of Constructor inheritance...
52
+	public CallbackOnErrorInfo (IRCParser parser, CallbackManager manager) { super(parser, manager); }
53
+}

+ 50
- 0
src/uk/org/ownage/dmdirc/parser/CallbackOnMOTDEnd.java View File

@@ -0,0 +1,50 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+public class CallbackOnMOTDEnd extends CallbackObject {
28
+	/**
29
+	 * Callback to all objects implementing the IMotdEnd Interface.
30
+	 *
31
+	 * @see IMOTDEnd
32
+	 */
33
+	protected boolean call() {
34
+		boolean bResult = false;
35
+		for (int i = 0; i < callbackInfo.size(); i++) {
36
+			try {
37
+				((IMOTDEnd)callbackInfo.get(i)).onMOTDEnd(myParser);
38
+			} catch (Exception e) {
39
+				ParserError ei = new ParserError(ParserError.errError, "Exception in onMOTDEnd");
40
+				ei.setException(e);
41
+				callErrorInfo(ei);
42
+			}
43
+			bResult = true;
44
+		}
45
+		return bResult;
46
+	}
47
+	
48
+	// Stupid lack of Constructor inheritance...
49
+	public CallbackOnMOTDEnd (IRCParser parser, CallbackManager manager) { super(parser, manager); }
50
+}

+ 52
- 0
src/uk/org/ownage/dmdirc/parser/CallbackOnNickChanged.java View File

@@ -0,0 +1,52 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+public class CallbackOnNickChanged extends CallbackObject {
28
+	/**
29
+	 * Callback to all objects implementing the INickChanged Interface.
30
+	 *
31
+	 * @see INickChanged
32
+	 * @param cClient Client changing nickname
33
+	 * @param sOldNick Nickname before change
34
+	 */
35
+	protected boolean call(ClientInfo cClient, String sOldNick) {
36
+		boolean bResult = false;
37
+		for (int i = 0; i < callbackInfo.size(); i++) {
38
+			try {
39
+				((INickChanged)callbackInfo.get(i)).onNickChanged(myParser, cClient, sOldNick);
40
+			} catch (Exception e) {
41
+				ParserError ei = new ParserError(ParserError.errError, "Exception in onNickChanged");
42
+				ei.setException(e);
43
+				callErrorInfo(ei);
44
+			}
45
+			bResult = true;
46
+		}
47
+		return bResult;
48
+	}	
49
+	
50
+	// Stupid lack of Constructor inheritance...
51
+	public CallbackOnNickChanged (IRCParser parser, CallbackManager manager) { super(parser, manager); }
52
+}

+ 50
- 0
src/uk/org/ownage/dmdirc/parser/CallbackOnNickInUse.java View File

@@ -0,0 +1,50 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+public class CallbackOnNickInUse extends CallbackObject {
28
+	/**
29
+	 * Callback to all objects implementing the INickInUse Interface.
30
+	 *
31
+	 * @see INickInUse
32
+	 */
33
+	protected boolean call() {
34
+		boolean bResult = false;
35
+		for (int i = 0; i < callbackInfo.size(); i++) {
36
+			try {
37
+				((INickInUse)callbackInfo.get(i)).onNickInUse(myParser);
38
+			} catch (Exception e) {
39
+				ParserError ei = new ParserError(ParserError.errError, "Exception in onNickInUse");
40
+				ei.setException(e);
41
+				callErrorInfo(ei);
42
+			}
43
+			bResult = true;
44
+		}
45
+		return bResult;
46
+	}
47
+	
48
+	// Stupid lack of Constructor inheritance...
49
+	public CallbackOnNickInUse (IRCParser parser, CallbackManager manager) { super(parser, manager); }
50
+}

+ 53
- 0
src/uk/org/ownage/dmdirc/parser/CallbackOnPrivateAction.java View File

@@ -0,0 +1,53 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+public class CallbackOnPrivateAction extends CallbackObject {
28
+	/**
29
+	 * Callback to all objects implementing the IPrivateAction Interface.
30
+	 *
31
+	 * @see IPrivateAction
32
+ 	 * @param cClient Client who sent the action (may be null if no common channels or server)
33
+	 * @param sMessage action contents
34
+	 * @param sHost Hostname of sender (or servername)
35
+	 */
36
+	protected boolean call(ClientInfo cClient, String sMessage, String sHost) {
37
+		boolean bResult = false;
38
+		for (int i = 0; i < callbackInfo.size(); i++) {
39
+			try {
40
+				((IPrivateAction)callbackInfo.get(i)).onPrivateAction(myParser, cClient, sMessage, sHost);
41
+			} catch (Exception e) {
42
+				ParserError ei = new ParserError(ParserError.errError, "Exception in onPrivateAction");
43
+				ei.setException(e);
44
+				callErrorInfo(ei);
45
+			}
46
+			bResult = true;
47
+		}
48
+		return bResult;
49
+	}	
50
+	
51
+	// Stupid lack of Constructor inheritance...
52
+	public CallbackOnPrivateAction (IRCParser parser, CallbackManager manager) { super(parser, manager); }
53
+}

+ 54
- 0
src/uk/org/ownage/dmdirc/parser/CallbackOnPrivateCTCP.java View File

@@ -0,0 +1,54 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+public class CallbackOnPrivateCTCP extends CallbackObject {
28
+	/**
29
+	 * Callback to all objects implementing the IPrivateCTCP Interface.
30
+	 *
31
+	 * @see IPrivateCTCP
32
+ 	 * @param cClient Client who sent the CTCP (may be null if no common channels or server)
33
+	 * @param sType Type of CTCP (VERSION, TIME etc)
34
+	 * @param sMessage Additional contents
35
+	 * @param sHost Hostname of sender (or servername)
36
+	 */
37
+	protected boolean call(ClientInfo cClient, String sType, String sMessage, String sHost) {
38
+		boolean bResult = false;
39
+		for (int i = 0; i < callbackInfo.size(); i++) {
40
+			try {
41
+				((IPrivateCTCP)callbackInfo.get(i)).onPrivateCTCP(myParser, cClient, sType, sMessage, sHost);
42
+			} catch (Exception e) {
43
+				ParserError ei = new ParserError(ParserError.errError, "Exception in onPrivateCTCP");
44
+				ei.setException(e);
45
+				callErrorInfo(ei);
46
+			}
47
+			bResult = true;
48
+		}
49
+		return bResult;
50
+	}	
51
+	
52
+	// Stupid lack of Constructor inheritance...
53
+	public CallbackOnPrivateCTCP (IRCParser parser, CallbackManager manager) { super(parser, manager); }
54
+}

+ 54
- 0
src/uk/org/ownage/dmdirc/parser/CallbackOnPrivateCTCPReply.java View File

@@ -0,0 +1,54 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+public class CallbackOnPrivateCTCPReply extends CallbackObject {
28
+	/**
29
+	 * Callback to all objects implementing the IPrivateCTCPReply Interface.
30
+	 *
31
+	 * @see IPrivateCTCPReply
32
+ 	 * @param cClient Client who sent the CTCPReply (may be null if no common channels or server)
33
+	 * @param sType Type of CTCPRReply (VERSION, TIME etc)
34
+	 * @param sMessage Reply Contents
35
+	 * @param sHost Hostname of sender (or servername)
36
+	 */
37
+	protected boolean call(ClientInfo cClient, String sType, String sMessage, String sHost) {
38
+		boolean bResult = false;
39
+		for (int i = 0; i < callbackInfo.size(); i++) {
40
+			try {
41
+				((IPrivateCTCPReply)callbackInfo.get(i)).onPrivateCTCPReply(myParser, cClient, sType, sMessage, sHost);
42
+			} catch (Exception e) {
43
+				ParserError ei = new ParserError(ParserError.errError, "Exception in onPrivateCTCPReply");
44
+				ei.setException(e);
45
+				callErrorInfo(ei);
46
+			}
47
+			bResult = true;
48
+		}
49
+		return bResult;
50
+	}	
51
+	
52
+	// Stupid lack of Constructor inheritance...
53
+	public CallbackOnPrivateCTCPReply (IRCParser parser, CallbackManager manager) { super(parser, manager); }
54
+}

+ 53
- 0
src/uk/org/ownage/dmdirc/parser/CallbackOnPrivateMessage.java View File

@@ -0,0 +1,53 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+public class CallbackOnPrivateMessage extends CallbackObject {
28
+	/**
29
+	 * Callback to all objects implementing the IPrivateMessage Interface.
30
+	 *
31
+	 * @see IPrivateMessage
32
+	 * @param cClient Client who sent the message (may be null if no common channels or server)
33
+	 * @param sMessage Message contents
34
+	 * @param sHost Hostname of sender (or servername)
35
+	 */
36
+	protected boolean call(ClientInfo cClient, String sMessage, String sHost) {
37
+		boolean bResult = false;
38
+		for (int i = 0; i < callbackInfo.size(); i++) {
39
+			try {
40
+				((IPrivateMessage)callbackInfo.get(i)).onPrivateMessage(myParser, cClient, sMessage, sHost);
41
+			} catch (Exception e) {
42
+				ParserError ei = new ParserError(ParserError.errError, "Exception in onPrivateMessage");
43
+				ei.setException(e);
44
+				callErrorInfo(ei);
45
+			}
46
+			bResult = true;
47
+		}
48
+		return bResult;
49
+	}	
50
+	
51
+	// Stupid lack of Constructor inheritance...
52
+	public CallbackOnPrivateMessage (IRCParser parser, CallbackManager manager) { super(parser, manager); }
53
+}

+ 53
- 0
src/uk/org/ownage/dmdirc/parser/CallbackOnPrivateNotice.java View File

@@ -0,0 +1,53 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+public class CallbackOnPrivateNotice extends CallbackObject {
28
+	/**
29
+	 * Callback to all objects implementing the IPrivateNotice Interface.
30
+	 *
31
+	 * @see IPrivateNotice
32
+	 * @param cClient Client who sent the notice (may be null if no common channels or server)
33
+	 * @param sMessage Notice contents
34
+	 * @param sHost Hostname of sender (or servername)
35
+	 */
36
+	protected boolean call(ClientInfo cClient, String sMessage, String sHost) {
37
+		boolean bResult = false;
38
+		for (int i = 0; i < callbackInfo.size(); i++) {
39
+			try {
40
+				((IPrivateNotice)callbackInfo.get(i)).onPrivateNotice(myParser, cClient, sMessage, sHost);
41
+			} catch (Exception e) {
42
+				ParserError ei = new ParserError(ParserError.errError, "Exception in onPrivateNotice");
43
+				ei.setException(e);
44
+				callErrorInfo(ei);
45
+			}
46
+			bResult = true;
47
+		}
48
+		return bResult;
49
+	}		
50
+	
51
+	// Stupid lack of Constructor inheritance...
52
+	public CallbackOnPrivateNotice (IRCParser parser, CallbackManager manager) { super(parser, manager); }
53
+}

+ 52
- 0
src/uk/org/ownage/dmdirc/parser/CallbackOnQuit.java View File

@@ -0,0 +1,52 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+public class CallbackOnQuit extends CallbackObject {
28
+	/**
29
+	 * Callback to all objects implementing the IQuit Interface.
30
+	 *
31
+	 * @see IQuit
32
+	 * @param cClient Client Quitting
33
+	 * @param sReason Reason for quitting (may be "")
34
+	 */
35
+	protected boolean call(ClientInfo cClient, String sReason) {
36
+		boolean bResult = false;
37
+		for (int i = 0; i < callbackInfo.size(); i++) {
38
+			try {
39
+				((IQuit)callbackInfo.get(i)).onQuit(myParser, cClient, sReason);
40
+			} catch (Exception e) {
41
+				ParserError ei = new ParserError(ParserError.errError, "Exception in onQuit");
42
+				ei.setException(e);
43
+				callErrorInfo(ei);
44
+			}
45
+			bResult = true;
46
+		}
47
+		return bResult;
48
+	}
49
+	
50
+	// Stupid lack of Constructor inheritance...
51
+	public CallbackOnQuit (IRCParser parser, CallbackManager manager) { super(parser, manager); }
52
+}

+ 50
- 0
src/uk/org/ownage/dmdirc/parser/CallbackOnServerReady.java View File

@@ -0,0 +1,50 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+public class CallbackOnServerReady extends CallbackObject {
28
+	/**
29
+	 * Callback to all objects implementing the IServerReady Interface.
30
+	 *
31
+	 * @see IServerReady
32
+	 */	
33
+	protected boolean call() {
34
+		boolean bResult = false;
35
+		for (int i = 0; i < callbackInfo.size(); i++) {
36
+			try {
37
+				((IServerReady)callbackInfo.get(i)).onServerReady(myParser);
38
+			} catch (Exception e) {
39
+				ParserError ei = new ParserError(ParserError.errError, "Exception in onServerReady");
40
+				ei.setException(e);
41
+				callErrorInfo(ei);
42
+			}
43
+			bResult = true;
44
+		}
45
+		return bResult;
46
+	}
47
+	
48
+	// Stupid lack of Constructor inheritance...
49
+	public CallbackOnServerReady (IRCParser parser, CallbackManager manager) { super(parser, manager); }
50
+}

+ 54
- 0
src/uk/org/ownage/dmdirc/parser/CallbackOnUnknownAction.java View File

@@ -0,0 +1,54 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+public class CallbackOnUnknownAction extends CallbackObject {
28
+	/**
29
+	 * Callback to all objects implementing the IUnknownAction Interface.
30
+	 *
31
+	 * @see IUnknownAction
32
+	 * @param cClient Client who sent the action (may be null if no common channels or server)
33
+	 * @param sMessage Action contents
34
+	 * @param sTarget Actual target of action
35
+	 * @param sHost Hostname of sender (or servername)
36
+	 */
37
+	protected boolean call(ClientInfo cClient, String sMessage, String sTarget, String sHost) {
38
+		boolean bResult = false;
39
+		for (int i = 0; i < callbackInfo.size(); i++) {
40
+			try {
41
+				((IUnknownAction)callbackInfo.get(i)).onUnknownAction(myParser, cClient, sMessage, sTarget, sHost);
42
+			} catch (Exception e) {
43
+				ParserError ei = new ParserError(ParserError.errError, "Exception in onUnknownAction");
44
+				ei.setException(e);
45
+				callErrorInfo(ei);
46
+			}
47
+			bResult = true;
48
+		}
49
+		return bResult;
50
+	}	
51
+	
52
+	// Stupid lack of Constructor inheritance...
53
+	public CallbackOnUnknownAction (IRCParser parser, CallbackManager manager) { super(parser, manager); }
54
+}

+ 55
- 0
src/uk/org/ownage/dmdirc/parser/CallbackOnUnknownCTCP.java View File

@@ -0,0 +1,55 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+public class CallbackOnUnknownCTCP extends CallbackObject {
28
+	/**
29
+	 * Callback to all objects implementing the IUnknownCTCP Interface.
30
+	 *
31
+	 * @see IUnknownCTCP
32
+ 	 * @param cClient Client who sent the CTCP (may be null if no common channels or server)
33
+	 * @param sType Type of CTCP (VERSION, TIME etc)
34
+	 * @param sMessage Additional contents
35
+	 * @param sTarget Actual Target of CTCP
36
+	 * @param sHost Hostname of sender (or servername)
37
+	 */
38
+	protected boolean call(ClientInfo cClient, String sType, String sMessage, String sTarget, String sHost) {
39
+		boolean bResult = false;
40
+		for (int i = 0; i < callbackInfo.size(); i++) {
41
+			try {
42
+				((IUnknownCTCP)callbackInfo.get(i)).onUnknownCTCP(myParser, cClient, sType, sMessage, sTarget, sHost);
43
+			} catch (Exception e) {
44
+				ParserError ei = new ParserError(ParserError.errError, "Exception in onUnknownCTCP");
45
+				ei.setException(e);
46
+				callErrorInfo(ei);
47
+			}
48
+			bResult = true;
49
+		}
50
+		return bResult;
51
+	}	
52
+	
53
+	// Stupid lack of Constructor inheritance...
54
+	public CallbackOnUnknownCTCP (IRCParser parser, CallbackManager manager) { super(parser, manager); }
55
+}

+ 55
- 0
src/uk/org/ownage/dmdirc/parser/CallbackOnUnknownCTCPReply.java View File

@@ -0,0 +1,55 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+public class CallbackOnUnknownCTCPReply extends CallbackObject {
28
+	/**
29
+	 * Callback to all objects implementing the IUnknownCTCPReply Interface.
30
+	 *
31
+	 * @see IUnknownCTCPReply
32
+ 	 * @param cClient Client who sent the CTCPReply (may be null if no common channels or server)
33
+	 * @param sType Type of CTCPRReply (VERSION, TIME etc)
34
+	 * @param sMessage Reply Contents
35
+	 * @param sTarget Actual Target of CTCPReply
36
+	 * @param sHost Hostname of sender (or servername)
37
+	 */
38
+	protected boolean call(ClientInfo cClient, String sType, String sMessage, String sTarget, String sHost) {
39
+		boolean bResult = false;
40
+		for (int i = 0; i < callbackInfo.size(); i++) {
41
+			try {
42
+				((IUnknownCTCPReply)callbackInfo.get(i)).onUnknownCTCPReply(myParser, cClient, sType, sMessage, sTarget, sHost);
43
+			} catch (Exception e) {
44
+				ParserError ei = new ParserError(ParserError.errError, "Exception in onUnknownCTCPReply");
45
+				ei.setException(e);
46
+				callErrorInfo(ei);
47
+			}
48
+			bResult = true;
49
+		}
50
+		return bResult;
51
+	}		
52
+	
53
+	// Stupid lack of Constructor inheritance...
54
+	public CallbackOnUnknownCTCPReply (IRCParser parser, CallbackManager manager) { super(parser, manager); }
55
+}

+ 54
- 0
src/uk/org/ownage/dmdirc/parser/CallbackOnUnknownMessage.java View File

@@ -0,0 +1,54 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+public class CallbackOnUnknownMessage extends CallbackObject {
28
+	/**
29
+	 * Callback to all objects implementing the IUnknownMessage Interface.
30
+	 *
31
+	 * @see IUnknownMessage
32
+	 * @param cClient Client who sent the message (may be null if no common channels or server)
33
+	 * @param sMessage Message contents
34
+	 * @param sTarget Actual target of message
35
+	 * @param sHost Hostname of sender (or servername)
36
+	 */
37
+	protected boolean call(ClientInfo cClient, String sMessage, String sTarget, String sHost) {
38
+		boolean bResult = false;
39
+		for (int i = 0; i < callbackInfo.size(); i++) {
40
+			try {
41
+				((IUnknownMessage)callbackInfo.get(i)).onUnknownMessage(myParser, cClient, sMessage, sTarget, sHost);
42
+			} catch (Exception e) {
43
+				ParserError ei = new ParserError(ParserError.errError, "Exception in onUnknownMessage");
44
+				ei.setException(e);
45
+				callErrorInfo(ei);
46
+			}
47
+			bResult = true;
48
+		}
49
+		return bResult;
50
+	}	
51
+	
52
+	// Stupid lack of Constructor inheritance...
53
+	public CallbackOnUnknownMessage (IRCParser parser, CallbackManager manager) { super(parser, manager); }
54
+}

+ 54
- 0
src/uk/org/ownage/dmdirc/parser/CallbackOnUnknownNotice.java View File

@@ -0,0 +1,54 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+public class CallbackOnUnknownNotice extends CallbackObject {
28
+	/**
29
+	 * Callback to all objects implementing the IUnknownNotice Interface.
30
+	 *
31
+	 * @see IUnknownNotice
32
+	 * @param cClient Client who sent the notice (may be null if no common channels or server)
33
+	 * @param sMessage Notice contents
34
+	 * @param sTarget Actual target of notice
35
+	 * @param sHost Hostname of sender (or servername)
36
+	 */
37
+	protected boolean call(ClientInfo cClient, String sMessage, String sTarget, String sHost) {
38
+		boolean bResult = false;
39
+		for (int i = 0; i < callbackInfo.size(); i++) {
40
+			try {
41
+				((IUnknownNotice)callbackInfo.get(i)).onUnknownNotice(myParser, cClient, sMessage, sTarget, sHost);
42
+			} catch (Exception e) {
43
+				ParserError ei = new ParserError(ParserError.errError, "Exception in onUnknownNotice");
44
+				ei.setException(e);
45
+				callErrorInfo(ei);
46
+			}
47
+			bResult = true;
48
+		}
49
+		return bResult;
50
+	}	
51
+	
52
+	// Stupid lack of Constructor inheritance...
53
+	public CallbackOnUnknownNotice (IRCParser parser, CallbackManager manager) { super(parser, manager); }
54
+}

+ 52
- 0
src/uk/org/ownage/dmdirc/parser/CallbackOnUserModeChanged.java View File

@@ -0,0 +1,52 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+public class CallbackOnUserModeChanged extends CallbackObject {
28
+	/**
29
+	 * Callback to all objects implementing the IUserModeChanged Interface.
30
+	 *
31
+	 * @see IUserModeChanged
32
+	 * @param cClient Client that had the mode changed (almost always us)
33
+	 * @param sSetby Host that set the mode (us or servername)
34
+	 */
35
+	protected boolean call(ClientInfo cClient, String sSetby) {
36
+		boolean bResult = false;
37
+		for (int i = 0; i < callbackInfo.size(); i++) {
38
+			try {
39
+				((IUserModeChanged)callbackInfo.get(i)).onUserModeChanged(myParser, cClient, sSetby);
40
+			} catch (Exception e) {
41
+				ParserError ei = new ParserError(ParserError.errError, "Exception in onUserModeChanged");
42
+				ei.setException(e);
43
+				callErrorInfo(ei);
44
+			}
45
+			bResult = true;
46
+		}
47
+		return bResult;
48
+	}	
49
+	
50
+	// Stupid lack of Constructor inheritance...
51
+	public CallbackOnUserModeChanged (IRCParser parser, CallbackManager manager) { super(parser, manager); }
52
+}

+ 30
- 0
src/uk/org/ownage/dmdirc/parser/ICallbackInterface.java View File

@@ -0,0 +1,30 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/**
28
+ * "SuperInterface" for all callbacks
29
+ */
30
+public interface ICallbackInterface { }

+ 48
- 0
src/uk/org/ownage/dmdirc/parser/IChannelAction.java View File

@@ -0,0 +1,48 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/**
28
+ * Called when a person does an action in a channel.
29
+ * sHost is the hostname of the person sending the action. (Can be a server or a person)<br>
30
+ * cChannelClient is null if user is a server, or not on the channel.
31
+ */
32
+public interface IChannelAction extends ICallbackInterface {
33
+	/**
34
+	 * Called when a person does an action in a channel.
35
+	 * sHost is the hostname of the person sending the action. (Can be a server or a person)<br>
36
+	 * cChannelClient is null if user is a server, or not on the channel.
37
+	 * 
38
+	 * @param tParser Reference to the parser object that made the callback.
39
+	 * @param cChannel Channel where the action was sent to
40
+	 * @param cChannelClient ChannelClient who sent the action (may be null if server)
41
+	 * @param sMessage action contents
42
+	 * @param sHost Hostname of sender (or servername)
43
+	 * @see IRCParser#addChannelAction
44
+	 * @see IRCParser#delChannelAction
45
+	 * @see IRCParser#callChannelAction
46
+	 */
47
+	public void onChannelAction(IRCParser tParser, ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sMessage, String sHost );
48
+}

+ 49
- 0
src/uk/org/ownage/dmdirc/parser/IChannelCTCP.java View File

@@ -0,0 +1,49 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/**
28
+ * Called when a person sends a CTCP to a channel.
29
+ * sHost is the hostname of the person sending the CTCP. (Can be a server or a person)<br>
30
+ * cChannelClient is null if user is a server.
31
+ */
32
+public interface IChannelCTCP extends ICallbackInterface {
33
+	/**
34
+	 * Called when a person sends a CTCP to a channel.
35
+	 * sHost is the hostname of the person sending the CTCP. (Can be a server or a person)<br>
36
+	 * cChannelClient is null if user is a server.
37
+	 * 
38
+	 * @param tParser Reference to the parser object that made the callback.
39
+	 * @param cChannel Channel where CTCP was sent
40
+	 * @param cChannelClient ChannelClient who sent the message (may be null if server)
41
+	 * @param sType Type of CTCP (VERSION, TIME etc)
42
+	 * @param sMessage Additional contents
43
+	 * @param sHost Hostname of sender (or servername)
44
+	 * @see IRCParser#addChannelCTCP
45
+	 * @see IRCParser#delChannelCTCP
46
+	 * @see IRCParser#callChannelCTCP
47
+	 */
48
+	public void onChannelCTCP(IRCParser tParser, ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sType, String sMessage, String sHost );
49
+}

+ 49
- 0
src/uk/org/ownage/dmdirc/parser/IChannelCTCPReply.java View File

@@ -0,0 +1,49 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/**
28
+ * Called when a person sends a CTCPRReply to a channel.
29
+ * sHost is the hostname of the person sending the CTCPReply. (Can be a server or a person)<br>
30
+ * cChannelClient is null if user is a server.
31
+ */
32
+public interface IChannelCTCPReply extends ICallbackInterface {
33
+	/**
34
+	 * Called when a person sends a CTCPRReply to a channel.
35
+	 * sHost is the hostname of the person sending the CTCPReply. (Can be a server or a person)<br>
36
+	 * cChannelClient is null if user is a server.
37
+	 * 
38
+	 * @param tParser Reference to the parser object that made the callback.
39
+	 * @param cChannel Channel where CTCPReply was sent
40
+	 * @param cChannelClient ChannelClient who sent the message (may be null if server)
41
+	 * @param sType Type of CTCPRReply (VERSION, TIME etc)
42
+	 * @param sMessage Reply Contents
43
+	 * @param sHost Hostname of sender (or servername)
44
+	 * @see IRCParser#addChannelCTCPReply
45
+	 * @see IRCParser#delChannelCTCPReply
46
+	 * @see IRCParser#callChannelCTCPReply
47
+	 */
48
+	public void onChannelCTCPReply(IRCParser tParser, ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sType, String sMessage, String sHost );
49
+}

+ 41
- 0
src/uk/org/ownage/dmdirc/parser/IChannelGotNames.java View File

@@ -0,0 +1,41 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/**
28
+ * Called when a names reply is parsed.
29
+ */
30
+public interface IChannelGotNames extends ICallbackInterface {
31
+	/**
32
+	 * Called when a names reply is parsed.
33
+	 *
34
+	 * @param tParser Reference to the parser object that made the callback.
35
+	 * @param cChannel Channel which the names reply is for
36
+	 * @see IRCParser#addChannelGotNames
37
+	 * @see IRCParser#delChannelGotNames
38
+	 * @see IRCParser#callChannelGotNames
39
+	 */
40
+	public void onChannelGotNames(IRCParser tParser, ChannelInfo cChannel);
41
+}

+ 44
- 0
src/uk/org/ownage/dmdirc/parser/IChannelJoin.java View File

@@ -0,0 +1,44 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/** 
28
+ * Called When we, or another client joins a channel.
29
+ * This is called AFTER client has been added to channel as a ChannelClientInfo
30
+ */
31
+public interface IChannelJoin extends ICallbackInterface {
32
+	/**
33
+	 * Called When another client joins a channel.
34
+	 * This is called AFTER client has been added to channel as a ChannelClientInfo
35
+	 * 
36
+	 * @param tParser Reference to the parser object that made the callback.
37
+	 * @param cChannel Channel Object
38
+	 * @param cChannelClient ChannelClient object for new person
39
+	 * @see IRCParser#addChannelJoin
40
+	 * @see IRCParser#delChannelJoin
41
+	 * @see IRCParser#callChannelJoin
42
+	 */
43
+	public void onChannelJoin(IRCParser tParser, ChannelInfo cChannel, ChannelClientInfo cChannelClient );
44
+}

+ 47
- 0
src/uk/org/ownage/dmdirc/parser/IChannelKick.java View File

@@ -0,0 +1,47 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/**
28
+ * Called when a person is kicked.
29
+ * cKickedByClient can be null if kicked by a server. sKickedByHost is the hostname of the person/server doing the kicking.
30
+ */
31
+public interface IChannelKick extends ICallbackInterface {
32
+	/**
33
+	 * Called when a person is kicked.
34
+	 * cKickedByClient can be null if kicked by a server. sKickedByHost is the hostname of the person/server doing the kicking.
35
+	 *
36
+	 * @param tParser Reference to the parser object that made the callback.
37
+	 * @param cChannel Channel where the kick took place
38
+	 * @param cKickedClient ChannelClient that got kicked
39
+	 * @param cKickedByClient ChannelClient that did the kicking (may be null if server)
40
+	 * @param sReason Reason for kick (may be "")
41
+	 * @param sKickedByHost Hostname of Kicker (or servername)
42
+	 * @see IRCParser#addChannelKick
43
+	 * @see IRCParser#delChannelKick
44
+	 * @see IRCParser#callChannelKick
45
+	 */
46
+	public void onChannelKick(IRCParser tParser, ChannelInfo cChannel, ChannelClientInfo cKickedClient, ChannelClientInfo cKickedByClient, String sReason, String sKickedByHost);
47
+}

+ 48
- 0
src/uk/org/ownage/dmdirc/parser/IChannelMessage.java View File

@@ -0,0 +1,48 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/**
28
+ * Called when a person sends a message to a channel.
29
+ * sHost is the hostname of the person sending the message. (Can be a server or a person)<br>
30
+ * cChannelClient is null if user is a server, or not on the channel.
31
+ */
32
+public interface IChannelMessage extends ICallbackInterface {
33
+	/**
34
+	 * Called when a person sends a message to a channel.
35
+	 * sHost is the hostname of the person sending the message. (Can be a server or a person)<br>
36
+	 * cChannelClient is null if user is a server, or not on the channel.
37
+	 *
38
+	 * @param tParser Reference to the parser object that made the callback.
39
+	 * @param cChannel Channel where the message was sent to
40
+	 * @param cChannelClient ChannelClient who sent the message (may be null if server)
41
+	 * @param sMessage Message contents
42
+	 * @param sHost Hostname of sender (or servername)
43
+	 * @see IRCParser#addChannelMessage
44
+	 * @see IRCParser#delChannelMessage
45
+	 * @see IRCParser#callChannelMessage
46
+	 */
47
+	public void onChannelMessage(IRCParser tParser, ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sMessage, String sHost );
48
+}

+ 48
- 0
src/uk/org/ownage/dmdirc/parser/IChannelModeChanged.java View File

@@ -0,0 +1,48 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/** 
28
+ * Called when the channel modes are changed or discovered.
29
+ * cChannelClient is null if the modes were found from raw 324 (/MODE #Chan reply) or if a server set the mode.<br>
30
+ * If a Server set the mode, sHost is the servers name, else it is the full host of the user who set it
31
+ */
32
+public interface IChannelModeChanged extends ICallbackInterface {
33
+	/**
34
+	 * Called when the channel modes are changed or discovered.
35
+	 * cChannelClient is null if the modes were found from raw 324 (/MODE #Chan reply) or if a server set the mode.<br>
36
+	 * If a Server set the mode, sHost is the servers name, else it is the full host of the user who set it
37
+	 * 
38
+	 * @param tParser Reference to the parser object that made the callback.
39
+	 * @param cChannel Channel where modes were changed
40
+	 * @param cChannelClient Client chaning the modes (null if server)
41
+	 * @param sHost Host doing the mode changing (User host or server name)
42
+	 * @param sModes String showing the exact mode change parsed.
43
+	 * @see IRCParser#addChannelModeChanged
44
+	 * @see IRCParser#delChannelModeChanged
45
+	 * @see IRCParser#callChannelModeChanged
46
+	 */
47
+	public void onChannelModeChanged(IRCParser tParser, ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sHost, String sModes);
48
+}

+ 48
- 0
src/uk/org/ownage/dmdirc/parser/IChannelNotice.java View File

@@ -0,0 +1,48 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/**
28
+ * Called when a person sends a notice to a channel.
29
+ * sHost is the hostname of the person sending the notice. (Can be a server or a person)<br>
30
+ * cChannelClient is null if user is a server, or not on the channel.
31
+ */
32
+public interface IChannelNotice extends ICallbackInterface {
33
+	/**
34
+	 * Called when a person sends a notice to a channel.
35
+	 * sHost is the hostname of the person sending the notice. (Can be a server or a person)<br>
36
+	 * cChannelClient is null if user is a server, or not on the channel.
37
+	 * 
38
+	 * @param tParser Reference to the parser object that made the callback.
39
+	 * @param cChannel Channel where the notice was sent to
40
+	 * @param cChannelClient ChannelClient who sent the notice (may be null if server)
41
+	 * @param sMessage notice contents
42
+	 * @param sHost Hostname of sender (or servername)
43
+	 * @see IRCParser#addChannelNotice
44
+	 * @see IRCParser#delChannelNotice
45
+	 * @see IRCParser#callChannelNotice
46
+	 */
47
+	public void onChannelNotice(IRCParser tParser, ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sMessage, String sHost );
48
+}

+ 45
- 0
src/uk/org/ownage/dmdirc/parser/IChannelPart.java View File

@@ -0,0 +1,45 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/** 
28
+ * Called When we, or another client parts a channel.
29
+ * This is called BEFORE client has been removed from the channel.
30
+ */
31
+public interface IChannelPart extends ICallbackInterface {
32
+	/**
33
+	 * Called When we, or another client parts a channel.
34
+	 * This is called BEFORE client has been removed from the channel.
35
+	 * 
36
+	 * @param tParser Reference to the parser object that made the callback.
37
+	 * @param cChannel Channel that the user parted
38
+	 * @param cChannelClient Client that parted
39
+	 * @param sReason Reason given for parting (May be "")
40
+	 * @see IRCParser#addChannelPart
41
+	 * @see IRCParser#delChannelPart
42
+	 * @see IRCParser#callChannelPart
43
+	 */
44
+	public void onChannelPart(IRCParser tParser, ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sReason );
45
+}

+ 45
- 0
src/uk/org/ownage/dmdirc/parser/IChannelQuit.java View File

@@ -0,0 +1,45 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/** 
28
+ * Called When we, or another client quits IRC (Called once per channel the user was on).
29
+ * This is called BEFORE client has been removed from the channel.
30
+ */
31
+public interface IChannelQuit extends ICallbackInterface {
32
+	/**
33
+	 * Called When we, or another client quits IRC (Called once per channel the user was on).
34
+	 * This is called BEFORE client has been removed from the channel.
35
+	 * 
36
+	 * @param tParser Reference to the parser object that made the callback.
37
+	 * @param cChannel Channel that user was on
38
+	 * @param cChannelClient User thats quitting
39
+	 * @param sReason Quit reason
40
+	 * @see IRCParser#addChannelQuit
41
+	 * @see IRCParser#delChannelQuit
42
+	 * @see IRCParser#callChannelQuit
43
+	 */
44
+	public void onChannelQuit(IRCParser tParser, ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sReason );
45
+}

+ 43
- 0
src/uk/org/ownage/dmdirc/parser/IChannelSelfJoin.java View File

@@ -0,0 +1,43 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/** 
28
+ * Called When we join a channel.
29
+ * We are NOT added as a channelclient until after the names reply
30
+ */
31
+public interface IChannelSelfJoin extends ICallbackInterface {
32
+	/**
33
+	 * Called When we join a channel.
34
+	 * We are NOT added as a channelclient until after the names reply
35
+	 * 
36
+	 * @param tParser Reference to the parser object that made the callback.
37
+	 * @param cChannel Channel Object
38
+	 * @see IRCParser#addChannelSelfJoin
39
+	 * @see IRCParser#delChannelSelfJoin
40
+	 * @see IRCParser#callChannelSelfJoin
41
+	 */
42
+	public void onChannelSelfJoin(IRCParser tParser, ChannelInfo cChannel);
43
+}

+ 44
- 0
src/uk/org/ownage/dmdirc/parser/IChannelTopic.java View File

@@ -0,0 +1,44 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/** 
28
+ * Called when the topic is changed or discovered for the first time.
29
+ * bIsNewTopic is true if someone sets the topic, false if the topic is discovered on join
30
+ */
31
+public interface IChannelTopic extends ICallbackInterface {
32
+	/**
33
+	 * Called when the topic is changed or discovered for the first time.
34
+	 * bIsNewTopic is true if someone sets the topic, false if the topic is discovered on join
35
+	 * 
36
+	 * @param tParser Reference to the parser object that made the callback.
37
+	 * @param cChannel Channel that topic was set on
38
+	 * @param bIsJoinTopic True when getting topic on join, false if set by user/server
39
+	 * @see IRCParser#addChannelTopic
40
+	 * @see IRCParser#delChannelTopic
41
+	 * @see IRCParser#callChannelTopic
42
+	 */
43
+	public void onChannelTopic(IRCParser tParser, ChannelInfo cChannel, boolean bIsJoinTopic);
44
+}

+ 47
- 0
src/uk/org/ownage/dmdirc/parser/IChannelUserModeChanged.java View File

@@ -0,0 +1,47 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/** 
28
+ * Called when a users channel mode is changed.
29
+ */
30
+public interface IChannelUserModeChanged extends ICallbackInterface {
31
+	/**
32
+	 * Called when a users channel mode is changed.
33
+	 * cChannelClient is null if the modes were found from raw 324 (/MODE #Chan reply) or if a server set the mode.<br>
34
+	 * If a Server set the mode, sHost is the servers name, else it is the full host of the user who set it
35
+	 * 
36
+	 * @param tParser Reference to the parser object that made the callback.
37
+	 * @param cChannel Channel where modes were changed
38
+	 * @param cChangedClient Client being changed
39
+	 * @param cSetByClient Client chaning the modes (null if server)
40
+	 * @param sHost Host doing the mode changing (User host or server name)
41
+	 * @param sMode String representing mode change (ie +o)
42
+	 * @see IRCParser#addChannelUserModeChanged
43
+	 * @see IRCParser#delChannelUserModeChanged
44
+	 * @see IRCParser#callChannelUserModeChanged
45
+	 */
46
+	public void onChannelUserModeChanged(IRCParser tParser, ChannelInfo cChannel, ChannelClientInfo cChangedClient, ChannelClientInfo cSetByClient, String sHost, String sMode);
47
+}

+ 41
- 0
src/uk/org/ownage/dmdirc/parser/IDataIn.java View File

@@ -0,0 +1,41 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/**
28
+ * Interface Used to give Debug Information.
29
+ */
30
+public interface IDataIn extends ICallbackInterface {
31
+	/**
32
+	 * Called on every incomming line BEFORE parsing.
33
+	 * 
34
+	 * @param tParser Reference to the parser object that made the callback.
35
+	 * @param sData Incomming Line.
36
+	 * @see IRCParser#addDataIn
37
+	 * @see IRCParser#delDataIn
38
+	 * @see IRCParser#callDataIn
39
+	 */
40
+	public void onDataIn(IRCParser tParser, String sData);
41
+}

+ 42
- 0
src/uk/org/ownage/dmdirc/parser/IDataOut.java View File

@@ -0,0 +1,42 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/**
28
+ * Called on every incomming line BEFORE being sent.
29
+ */
30
+public interface IDataOut extends ICallbackInterface {
31
+	/**
32
+	 * Called on every incomming line BEFORE being sent.
33
+	 * 
34
+	 * @param tParser Reference to the parser object that made the callback.
35
+	 * @param sData Outgoing Data
36
+	 * @param bFromParser True if parser sent the data, false if sent using .sendLine
37
+	 * @see IRCParser#addDataOut
38
+	 * @see IRCParser#delDataOut
39
+	 * @see IRCParser#callDataOut
40
+	 */
41
+	public void onDataOut(IRCParser tParser, String sData, boolean bFromParser);
42
+}

+ 42
- 0
src/uk/org/ownage/dmdirc/parser/IDebugInfo.java View File

@@ -0,0 +1,42 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/**
28
+ * Interface Used to give Debug Information.
29
+ */
30
+public interface IDebugInfo extends ICallbackInterface { 
31
+	/**
32
+	 * This callback is used to provide occasional debug information from the parser.
33
+	 *
34
+	 * @param tParser Reference to the parser object that made the callback.
35
+	 * @param nLevel Debugging Level (ndInfo, ndSocket etc)
36
+	 * @param sData Debugging Information
37
+	 * @see IRCParser#addDebugInfo
38
+	 * @see IRCParser#delDebugInfo
39
+	 * @see IRCParser#callDebugInfo
40
+	 */
41
+	public void onDebugInfo(IRCParser tParser, int nLevel, String sData);
42
+}

+ 42
- 0
src/uk/org/ownage/dmdirc/parser/IErrorInfo.java View File

@@ -0,0 +1,42 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/**
28
+ * Called to give Error Information.
29
+ */
30
+public interface IErrorInfo extends ICallbackInterface {
31
+	/**
32
+	 * Called to give Error Information.
33
+	 * 
34
+	 * @param tParser Reference to the parser object that made the callback.
35
+	 * @param nLevel Debugging Level (errFatal, errWarning etc)
36
+	 * @param sData Error Information
37
+	 * @see IRCParser#addErrorInfo
38
+	 * @see IRCParser#delErrorInfo
39
+	 * @see IRCParser#callErrorInfo
40
+	 */
41
+	public void onErrorInfo(IRCParser tParser, ParserError errorInfo);
42
+}

+ 40
- 0
src/uk/org/ownage/dmdirc/parser/IMOTDEnd.java View File

@@ -0,0 +1,40 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/**
28
+	* Called when "End of MOTD" or "No MOTD" is received.
29
+	*/
30
+public interface IMOTDEnd extends ICallbackInterface { 
31
+	/**
32
+		* Called when "End of MOTD" or "No MOTD".
33
+		* 
34
+		* @param tParser Reference to the parser object that made the callback.
35
+		* @see IRCParser#addMOTDEnd
36
+		* @see IRCParser#delMOTDEnd
37
+		* @see IRCParser#callMOTDEnd
38
+		*/
39
+	public void onMOTDEnd(IRCParser tParser);
40
+}

+ 44
- 0
src/uk/org/ownage/dmdirc/parser/INickChanged.java View File

@@ -0,0 +1,44 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/**
28
+ * Called when we or another user change nickname.
29
+ * This is called after the nickname change has been done internally
30
+ */
31
+public interface INickChanged extends ICallbackInterface {
32
+	/**
33
+	 * Called when we or another user change nickname.
34
+	 * This is called after the nickname change has been done internally
35
+	 * 
36
+	 * @param tParser Reference to the parser object that made the callback.
37
+	 * @param cClient Client changing nickname
38
+	 * @param sOldNick Nickname before change
39
+	 * @see IRCParser#addNickChanged
40
+	 * @see IRCParser#delNickChanged
41
+	 * @see IRCParser#callNickChanged
42
+	 */
43
+	public void onNickChanged(IRCParser tParser, ClientInfo cClient, String sOldNick);
44
+}

+ 40
- 0
src/uk/org/ownage/dmdirc/parser/INickInUse.java View File

@@ -0,0 +1,40 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/**
28
+ * Called when requested nickname is in use.
29
+ */
30
+public interface INickInUse extends ICallbackInterface {
31
+	/**
32
+	 * Called when requested nickname is in use.
33
+	 * 
34
+	 * @param tParser Reference to the parser object that made the callback.
35
+	 * @see IRCParser#addNickInUse
36
+	 * @see IRCParser#delNickInUse
37
+	 * @see IRCParser#callNickInUse
38
+	 */
39
+	public void onNickInUse(IRCParser tParser);
40
+}

+ 47
- 0
src/uk/org/ownage/dmdirc/parser/IPrivateAction.java View File

@@ -0,0 +1,47 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/**
28
+ * Called when a person does an action to you (PM).
29
+ * sHost is the hostname of the person sending the action. (Can be a server or a person)<br>
30
+ * cClient is null if user is a server, or not on any common channel.
31
+ */
32
+public interface IPrivateAction extends ICallbackInterface {
33
+	/**
34
+	 * Called when a person does an action to you (PM).
35
+	 * sHost is the hostname of the person sending the action. (Can be a server or a person)<br>
36
+	 * cClient is null if user is a server, or not on any common channel.
37
+	 * 
38
+	 * @param tParser Reference to the parser object that made the callback.
39
+ 	 * @param cClient Client who sent the action (may be null if no common channels or server)
40
+	 * @param sMessage action contents
41
+	 * @param sHost Hostname of sender (or servername)
42
+	 * @see IRCParser#addPrivateAction
43
+	 * @see IRCParser#delPrivateAction
44
+	 * @see IRCParser#callPrivateAction
45
+	 */
46
+	public void onPrivateAction(IRCParser tParser, ClientInfo cClient, String sMessage, String sHost );
47
+}

+ 48
- 0
src/uk/org/ownage/dmdirc/parser/IPrivateCTCP.java View File

@@ -0,0 +1,48 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/**
28
+ * Called when a person sends a CTCP to you directly.
29
+ * sHost is the hostname of the person sending the CTCP. (Can be a server or a person)<br>
30
+ * cClient is null if user is a server, or not on any common channels.
31
+ */
32
+public interface IPrivateCTCP extends ICallbackInterface {
33
+	/**
34
+	 * Called when a person sends a CTCP to you directly.
35
+	 * sHost is the hostname of the person sending the CTCP. (Can be a server or a person)<br>
36
+	 * cClient is null if user is a server, or not on any common channels.
37
+	 * 
38
+	 * @param tParser Reference to the parser object that made the callback.
39
+ 	 * @param cClient Client who sent the CTCP (may be null if no common channels or server)
40
+	 * @param sType Type of CTCP (VERSION, TIME etc)
41
+	 * @param sMessage Additional contents
42
+	 * @param sHost Hostname of sender (or servername)
43
+	 * @see IRCParser#addPrivateCTCP
44
+	 * @see IRCParser#delPrivateCTCP
45
+	 * @see IRCParser#callPrivateCTCP
46
+	 */
47
+	public void onPrivateCTCP(IRCParser tParser, ClientInfo cClient, String sType, String sMessage, String sHost );
48
+}

+ 48
- 0
src/uk/org/ownage/dmdirc/parser/IPrivateCTCPReply.java View File

@@ -0,0 +1,48 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/**
28
+ * Called when a person sends a CTCPRReply to you directly.
29
+ * sHost is the hostname of the person sending the CTCPRReply. (Can be a server or a person)<br>
30
+ * cClient is null if user is a server, or not on any common channels.
31
+ */
32
+public interface IPrivateCTCPReply extends ICallbackInterface {
33
+	/**
34
+	 * Called when a person sends a CTCPRReply to you directly.
35
+	 * sHost is the hostname of the person sending the CTCPRReply. (Can be a server or a person)<br>
36
+	 * cClient is null if user is a server, or not on any common channels.
37
+	 * 
38
+	 * @param tParser Reference to the parser object that made the callback.
39
+	 * @param cClient Client who sent the CTCPReply (may be null if no common channels or server)
40
+	 * @param sType Type of CTCPRReply (VERSION, TIME etc)
41
+	 * @param sMessage Reply Contents
42
+	 * @param sHost Hostname of sender (or servername)
43
+	 * @see IRCParser#addPrivateCTCPReply
44
+	 * @see IRCParser#delPrivateCTCPReply
45
+	 * @see IRCParser#callPrivateCTCPReply
46
+	 */
47
+	public void onPrivateCTCPReply(IRCParser tParser, ClientInfo cClient, String sType, String sMessage, String sHost );
48
+}

+ 47
- 0
src/uk/org/ownage/dmdirc/parser/IPrivateMessage.java View File

@@ -0,0 +1,47 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/**
28
+ * Called when a person sends a message to you directly (PM). 
29
+ * sHost is the hostname of the person sending the message. (Can be a server or a person)<br>
30
+ * cClient is null if user is a server, or not on any common channel.
31
+ */
32
+public interface IPrivateMessage extends ICallbackInterface {
33
+	/**
34
+	 * Called when a person sends a message to you directly (PM). 
35
+	 * sHost is the hostname of the person sending the message. (Can be a server or a person)<br>
36
+	 * cClient is null if user is a server, or not on any common channel.
37
+	 * 
38
+	 * @param tParser Reference to the parser object that made the callback.
39
+	 * @param cClient Client who sent the message (may be null if no common channels or server)
40
+	 * @param sMessage Message contents
41
+	 * @param sHost Hostname of sender (or servername)
42
+	 * @see IRCParser#addPrivateMessage
43
+	 * @see IRCParser#delPrivateMessage
44
+	 * @see IRCParser#callPrivateMessage
45
+	 */
46
+	public void onPrivateMessage(IRCParser tParser, ClientInfo cClient, String sMessage, String sHost );
47
+}

+ 47
- 0
src/uk/org/ownage/dmdirc/parser/IPrivateNotice.java View File

@@ -0,0 +1,47 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/**
28
+ * Called when a person sends a notice to you.
29
+ * sHost is the hostname of the person sending the notice. (Can be a server or a person)<br>
30
+ * cClient is null if user is a server, or not on any common channel.
31
+ */
32
+public interface IPrivateNotice extends ICallbackInterface {
33
+	/**
34
+	 * Called when a person sends a notice to you.
35
+	 * sHost is the hostname of the person sending the notice. (Can be a server or a person)<br>
36
+	 * cClient is null if user is a server, or not on any common channel.
37
+	 * 
38
+	 * @param tParser Reference to the parser object that made the callback.
39
+	 * @param cClient Client who sent the notice (may be null if no common channels or server)
40
+	 * @param sMessage Notice contents
41
+	 * @param sHost Hostname of sender (or servername)
42
+	 * @see IRCParser#addPrivateNotice
43
+	 * @see IRCParser#delPrivateNotice
44
+	 * @see IRCParser#callPrivateNotice
45
+	 */
46
+	public void onPrivateNotice(IRCParser tParser, ClientInfo cClient, String sMessage, String sHost );
47
+}

+ 44
- 0
src/uk/org/ownage/dmdirc/parser/IQuit.java View File

@@ -0,0 +1,44 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/** 
28
+ * Called When we, or another client quits IRC (Called once in total).
29
+ * This is called BEFORE client has been removed from the channel.
30
+ */
31
+public interface IQuit extends ICallbackInterface {
32
+	/**
33
+	 * Called When we, or another client quits IRC (Called once in total).
34
+	 * This is called BEFORE client has been removed from the channel.
35
+	 *
36
+	 * @param tParser Reference to the parser object that made the callback.
37
+	 * @param cClient Client Quitting
38
+	 * @param sReason Reason for quitting (may be "")
39
+	 * @see IRCParser#addQuit
40
+	 * @see IRCParser#delQuit
41
+	 * @see IRCParser#callQuit
42
+	 */
43
+	public void onQuit(IRCParser tParser, ClientInfo cClient, String sReason );
44
+}

+ 353
- 2214
src/uk/org/ownage/dmdirc/parser/IRCParser.java
File diff suppressed because it is too large
View File


+ 40
- 0
src/uk/org/ownage/dmdirc/parser/IServerReady.java View File

@@ -0,0 +1,40 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/**
28
+ * Called after 001.
29
+ */
30
+public interface IServerReady extends ICallbackInterface {
31
+	/**
32
+	 * Called after 001.
33
+	 * 
34
+	 * @param tParser Reference to the parser object that made the callback.
35
+	 * @see IRCParser#addServerReady
36
+	 * @see IRCParser#delServerReady
37
+	 * @see IRCParser#callServerReady
38
+	 */
39
+	public void onServerReady(IRCParser tParser);
40
+}

+ 48
- 0
src/uk/org/ownage/dmdirc/parser/IUnknownAction.java View File

@@ -0,0 +1,48 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/**
28
+ * Called when a person sends an action not aimed specifically at you or a channel (ie $*).
29
+ * sHost is the hostname of the person sending the message. (Can be a server or a person)<br>
30
+ * cClient is null if user is a server, or not on any common channel.
31
+ */
32
+public interface IUnknownAction extends ICallbackInterface {
33
+	/**
34
+	 * Called when a person sends an action not aimed specifically at you or a channel (ie $*).
35
+	 * sHost is the hostname of the person sending the message. (Can be a server or a person)<br>
36
+	 * cClient is null if user is a server, or not on any common channel.
37
+	 * 
38
+	 * @param tParser Reference to the parser object that made the callback.
39
+	 * @param cClient Client who sent the action (may be null if no common channels or server)
40
+	 * @param sMessage Action contents
41
+	 * @param sTarget Actual target of action
42
+	 * @param sHost Hostname of sender (or servername)
43
+	 * @see IRCParser#addUnknownAction
44
+	 * @see IRCParser#delUnknownAction
45
+	 * @see IRCParser#callUnknownAction
46
+	 */
47
+	public void onUnknownAction(IRCParser tParser, ClientInfo cClient, String sMessage, String sTarget, String sHost );
48
+}

+ 49
- 0
src/uk/org/ownage/dmdirc/parser/IUnknownCTCP.java View File

@@ -0,0 +1,49 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/**
28
+ * Called when a person sends a CTCP not aimed at you or a channel (ie $*).
29
+ * sHost is the hostname of the person sending the CTCP. (Can be a server or a person)<br>
30
+ * cClient is null if user is a server, or not on any common channels.
31
+ */
32
+public interface IUnknownCTCP extends ICallbackInterface {
33
+	/**
34
+	 * Called when a person sends a CTCP not aimed at you or a channel (ie $*).
35
+	 * sHost is the hostname of the person sending the CTCP. (Can be a server or a person)<br>
36
+	 * cClient is null if user is a server, or not on any common channels.
37
+	 * 
38
+	 * @param tParser Reference to the parser object that made the callback.
39
+ 	 * @param cClient Client who sent the CTCP (may be null if no common channels or server)
40
+	 * @param sType Type of CTCP (VERSION, TIME etc)
41
+	 * @param sMessage Additional contents
42
+	 * @param sTarget Actual Target of CTCP
43
+	 * @param sHost Hostname of sender (or servername)
44
+	 * @see IRCParser#addUnknownCTCP
45
+	 * @see IRCParser#delUnknownCTCP
46
+	 * @see IRCParser#callUnknownCTCP
47
+	 */
48
+	public void onUnknownCTCP(IRCParser tParser, ClientInfo cClient, String sType, String sMessage, String sTarget, String sHost );
49
+}

+ 49
- 0
src/uk/org/ownage/dmdirc/parser/IUnknownCTCPReply.java View File

@@ -0,0 +1,49 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/**
28
+ * Called when a person sends a CTCP not aimed at you or a channel (ie $*).
29
+ * sHost is the hostname of the person sending the CTCP. (Can be a server or a person)<br>
30
+ * cClient is null if user is a server, or not on any common channels.
31
+ */
32
+public interface IUnknownCTCPReply extends ICallbackInterface {
33
+	/**
34
+	 * Called when a person sends a CTCP not aimed at you or a channel (ie $*).
35
+	 * sHost is the hostname of the person sending the CTCP. (Can be a server or a person)<br>
36
+	 * cClient is null if user is a server, or not on any common channels.
37
+	 *
38
+	 * @param tParser Reference to the parser object that made the callback.
39
+	 * @param cClient Client who sent the CTCPReply (may be null if no common channels or server)
40
+	 * @param sType Type of CTCPRReply (VERSION, TIME etc)
41
+	 * @param sMessage Reply Contents
42
+	 * @param sTarget Actual Target of CTCPReply
43
+	 * @param sHost Hostname of sender (or servername)
44
+	 * @see IRCParser#addUnknownCTCPReply
45
+	 * @see IRCParser#delUnknownCTCPReply
46
+	 * @see IRCParser#callUnknownCTCPReply
47
+	 */
48
+	public void onUnknownCTCPReply(IRCParser tParser, ClientInfo cClient, String sType, String sMessage, String sTarget, String sHost );
49
+}

+ 48
- 0
src/uk/org/ownage/dmdirc/parser/IUnknownMessage.java View File

@@ -0,0 +1,48 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/**
28
+ * Called when a person sends a message not aimed specifically at you or a channel (ie $*).
29
+ * sHost is the hostname of the person sending the message. (Can be a server or a person)<br>
30
+ * cClient is null if user is a server, or not on any common channel.
31
+ */
32
+public interface IUnknownMessage extends ICallbackInterface {
33
+	/**
34
+	 * Called when a person sends a message not aimed specifically at you or a channel (ie $*).
35
+	 * sHost is the hostname of the person sending the message. (Can be a server or a person)<br>
36
+	 * cClient is null if user is a server, or not on any common channel.
37
+	 * 
38
+	 * @param tParser Reference to the parser object that made the callback.
39
+	 * @param cClient Client who sent the message (may be null if no common channels or server)
40
+	 * @param sMessage Message contents
41
+	 * @param sTarget Actual target of message
42
+	 * @param sHost Hostname of sender (or servername)
43
+	 * @see IRCParser#addUnknownMessage
44
+	 * @see IRCParser#delUnknownMessage
45
+	 * @see IRCParser#callUnknownMessage
46
+	 */
47
+	public void onUnknownMessage(IRCParser tParser, ClientInfo cClient, String sMessage, String sTarget, String sHost );
48
+}

+ 48
- 0
src/uk/org/ownage/dmdirc/parser/IUnknownNotice.java View File

@@ -0,0 +1,48 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/**
28
+ * Called when a person sends a notice not aimed specifically at you or a channel (ie $*).
29
+ * sHost is the hostname of the person sending the message. (Can be a server or a person)<br>
30
+ * cClient is null if user is a server, or not on any common channel.
31
+ */
32
+public interface IUnknownNotice extends ICallbackInterface { 
33
+	/**
34
+	 * Called when a person sends a notice not aimed specifically at you or a channel (ie $*).
35
+	 * sHost is the hostname of the person sending the message. (Can be a server or a person)<br>
36
+	 * cClient is null if user is a server, or not on any common channel.
37
+	 * 
38
+	 * @param tParser Reference to the parser object that made the callback.
39
+	 * @param cClient Client who sent the notice (may be null if no common channels or server)
40
+	 * @param sMessage Notice contents
41
+	 * @param sTarget Actual target of notice
42
+	 * @param sHost Hostname of sender (or servername)
43
+	 * @see IRCParser#addUnknownNotice
44
+	 * @see IRCParser#delUnknownNotice
45
+	 * @see IRCParser#callUnknownNotice
46
+	 */
47
+	public void onUnknownNotice(IRCParser tParser, ClientInfo cClient, String sMessage, String sTarget, String sHost );
48
+}

+ 46
- 0
src/uk/org/ownage/dmdirc/parser/IUserModeChanged.java View File

@@ -0,0 +1,46 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
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
+ * SVN: $Id: IRCParser.java 178 2007-02-28 20:36:16Z ShaneMcC $
23
+ */
24
+
25
+package uk.org.ownage.dmdirc.parser;
26
+
27
+/** 
28
+ * Called when user modes are changed.
29
+ * cClient represents the user who's modes were changed (should ALWAYS be us)<br>
30
+ * sSetby is the host of the person who set the mode (usually us, may be an oper or server in some cases)
31
+ */
32
+public interface IUserModeChanged extends ICallbackInterface {
33
+	/**
34
+	 * Called when user modes are changed.
35
+	 * cClient represents the user who's modes were changed (should ALWAYS be us)<br>
36
+	 * sSetby is the host of the person who set the mode (usually us, may be an oper or server in some cases)
37
+	 * 
38
+	 * @param tParser Reference to the parser object that made the callback.
39
+	 * @param cClient Client that had the mode changed (almost always us)
40
+	 * @param sSetBy Host that set the mode (us or servername)
41
+	 * @see IRCParser#addUserModeChanged
42
+	 * @see IRCParser#delUserModeChanged
43
+	 * @see IRCParser#callUserModeChanged
44
+	 */
45
+	public void onUserModeChanged(IRCParser tParser, ClientInfo cClient, String sSetBy);
46
+}

+ 4
- 4
src/uk/org/ownage/dmdirc/parser/ParserError.java View File

@@ -32,13 +32,13 @@ package uk.org.ownage.dmdirc.parser;
32 32
  */
33 33
 public class ParserError {
34 34
 	/** Error is potentially Fatal, Desync 99% Guarenteed! */
35
-	protected static final int errFatal = 1;
35
+	public static final int errFatal = 1;
36 36
 	/** Error is not fatal, but is more severe than a warning. */
37
-	protected static final int errError = 2;
37
+	public static final int errError = 2;
38 38
 	/** Error was an unexpected occurance, but shouldn't be anything to worry about. */
39
-	protected static final int errWarning = 4;
39
+	public static final int errWarning = 4;
40 40
 	/** Error was an exception from elsewhere. */
41
-	protected static final int errException = 8;
41
+	public static final int errException = 8;
42 42
 
43 43
 	/** Store the Error level */
44 44
 	protected int errorLevel = 0;

Loading…
Cancel
Save