選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

CoreActionType.java 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. /*
  2. * Copyright (c) 2006-2014 DMDirc Developers
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5. * of this software and associated documentation files (the "Software"), to deal
  6. * in the Software without restriction, including without limitation the rights
  7. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. * copies of the Software, and to permit persons to whom the Software is
  9. * furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  20. * SOFTWARE.
  21. */
  22. package com.dmdirc.actions;
  23. import com.dmdirc.actions.metatypes.ActionEvents;
  24. import com.dmdirc.actions.metatypes.ChannelEvents;
  25. import com.dmdirc.actions.metatypes.ClientEvents;
  26. import com.dmdirc.actions.metatypes.LinkEvents;
  27. import com.dmdirc.actions.metatypes.PluginEvents;
  28. import com.dmdirc.actions.metatypes.QueryEvents;
  29. import com.dmdirc.actions.metatypes.ServerEvents;
  30. import com.dmdirc.interfaces.actions.ActionMetaType;
  31. import com.dmdirc.interfaces.actions.ActionType;
  32. /**
  33. * An enumeration of actions that are raised by the core.
  34. */
  35. public enum CoreActionType implements ActionType {
  36. /** Client opened. */
  37. @Deprecated
  38. CLIENT_OPENED(ClientEvents.CLIENT_EVENT, "Client opened"),
  39. /** Client closed. */
  40. @Deprecated
  41. CLIENT_CLOSED(ClientEvents.CLIENT_EVENT, "Client closed"),
  42. /** Client closing. */
  43. @Deprecated
  44. CLIENT_CLOSING(ClientEvents.CLIENT_EVENT, "Client closing"),
  45. /** Client minimised. */
  46. @Deprecated
  47. CLIENT_MINIMISED(ClientEvents.CLIENT_EVENT, "Client minimised"),
  48. /** Client unminimised. */
  49. @Deprecated
  50. CLIENT_UNMINIMISED(ClientEvents.CLIENT_EVENT, "Client unminimised"),
  51. /** Client lost focus. */
  52. @Deprecated
  53. CLIENT_FOCUS_LOST(ClientEvents.CLIENT_EVENT, "Client lost focus"),
  54. /** Client gained focus. */
  55. @Deprecated
  56. CLIENT_FOCUS_GAINED(ClientEvents.CLIENT_EVENT, "Client gained focus"),
  57. /** Function key pressed. */
  58. @Deprecated
  59. CLIENT_KEY_PRESSED(ClientEvents.CLIENT_EVENT_WITH_KEY, "Function key pressed"),
  60. /** Frame changed. */
  61. @Deprecated
  62. CLIENT_FRAME_CHANGED(ClientEvents.WINDOW_EVENT, "Frame changed"),
  63. /** User input. */
  64. @Deprecated
  65. CLIENT_USER_INPUT(ClientEvents.CLIENT_EVENT_WITH_BUFFER, "User input"),
  66. /** Line added. */
  67. @Deprecated
  68. CLIENT_LINE_ADDED(ClientEvents.WINDOW_EVENT_WITH_MESSAGE, "Line added to a window"),
  69. /** Popup generated. */
  70. @Deprecated
  71. CLIENT_POPUP_GENERATED(ClientEvents.POPUP_EVENT, "Popup menu generated"),
  72. /** Prefs dialog opened. */
  73. @Deprecated
  74. CLIENT_PREFS_OPENED(ClientEvents.CLIENT_EVENT_WITH_PREFS, "Preferences dialog opened"),
  75. /** Context-specific prefs requested. */
  76. @Deprecated
  77. CLIENT_PREFS_REQUESTED(ClientEvents.CLIENT_EVENT_WITH_PREFS_CAT, "Preferences requested"),
  78. /** Prefs dialog closed. */
  79. @Deprecated
  80. CLIENT_PREFS_CLOSED(ClientEvents.CLIENT_EVENT, "Preferences dialog opened"),
  81. /** Unknown command. */
  82. UNKNOWN_COMMAND(ClientEvents.UNKNOWN_COMMAND, "Unknown command entered"),
  83. /** Server numeric received. */
  84. @Deprecated
  85. SERVER_NUMERIC(ServerEvents.SERVER_NUMERIC, "Numeric event received"),
  86. /** Server connected. */
  87. @Deprecated
  88. SERVER_CONNECTED(ServerEvents.SERVER_EVENT, "Server connected"),
  89. /** Server connecting. */
  90. @Deprecated
  91. SERVER_CONNECTING(ServerEvents.SERVER_EVENT, "Server connecting"),
  92. /** Server connection error. */
  93. @Deprecated
  94. SERVER_CONNECTERROR(ServerEvents.SERVER_EVENT_WITH_ARG, "Server connection error"),
  95. /** Server disconnected. */
  96. @Deprecated
  97. SERVER_DISCONNECTED(ServerEvents.SERVER_EVENT, "Server disconnected"),
  98. /** Marked as away. */
  99. SERVER_BACK(ServerEvents.SERVER_EVENT, "Marked as 'back'"),
  100. /** Marked as back. */
  101. SERVER_AWAY(ServerEvents.SERVER_EVENT_WITH_ARG, "Marked as 'away'"),
  102. /** Error. */
  103. SERVER_ERROR(ServerEvents.SERVER_EVENT_WITH_ARG, "Server error"),
  104. /** Auth notice received. */
  105. SERVER_AUTHNOTICE(ServerEvents.SERVER_EVENT_WITH_ARG, "Received auth notice"),
  106. /** Unknown action received. */
  107. SERVER_UNKNOWNACTION(ServerEvents.SERVER_UNKNOWN_EVENT, "Received unknown action"),
  108. /** Unknown notice received. */
  109. SERVER_UNKNOWNNOTICE(ServerEvents.SERVER_UNKNOWN_EVENT, "Received unknown notice"),
  110. /** Unknown message received. */
  111. SERVER_UNKNOWNMESSAGE(ServerEvents.SERVER_UNKNOWN_EVENT, "Received unknown message"),
  112. /** User modes changed. */
  113. SERVER_USERMODES(ServerEvents.SERVER_SOURCED_EVENT_WITH_ARG, "User modes changed"),
  114. /** Private CTCP received. */
  115. SERVER_CTCP(ServerEvents.SERVER_CTCP_EVENT, "CTCP received"),
  116. /** Private CTCPR received. */
  117. SERVER_CTCPR(ServerEvents.SERVER_CTCP_EVENT, "CTCP reply received"),
  118. /** Private notice received. */
  119. SERVER_NOTICE(ServerEvents.SERVER_SOURCED_EVENT_WITH_ARG, "Notice received"),
  120. /** Private server notice received. */
  121. SERVER_SERVERNOTICE(ServerEvents.SERVER_SOURCED_EVENT_WITH_ARG, "Server notice received"),
  122. /** MOTD starting. */
  123. SERVER_MOTDSTART(ServerEvents.SERVER_EVENT_WITH_ARG, "Start of MOTD received"),
  124. /** MOTD ended. */
  125. SERVER_MOTDEND(ServerEvents.SERVER_EVENT_WITH_ARG, "End of MOTD received"),
  126. /** MOTD line. */
  127. SERVER_MOTDLINE(ServerEvents.SERVER_EVENT_WITH_ARG, "MOTD line received"),
  128. /** Ping reply received. */
  129. SERVER_GOTPING(ServerEvents.SERVER_PING, "Received server ping reply"),
  130. /** Missed server ping reply. */
  131. SERVER_NOPING(ServerEvents.SERVER_PING, "Missed server ping reply"),
  132. /** Ping sent. */
  133. SERVER_PINGSENT(ServerEvents.SERVER_EVENT, "Ping request sent"),
  134. /** Invite received. */
  135. SERVER_INVITERECEIVED(ServerEvents.SERVER_INVITE, "Invite received"),
  136. /** Wallops. */
  137. SERVER_WALLOPS(ServerEvents.SERVER_SOURCED_EVENT_WITH_ARG, "Wallop received"),
  138. /** Wallusers. */
  139. SERVER_WALLUSERS(ServerEvents.SERVER_SOURCED_EVENT_WITH_ARG, "Walluser received"),
  140. /** Walldesync. */
  141. SERVER_WALLDESYNC(ServerEvents.SERVER_SOURCED_EVENT_WITH_ARG, "Walldesync received"),
  142. /** Nick change. */
  143. SERVER_NICKCHANGE(ServerEvents.SERVER_NICKCHANGE, "My nickname changed"),
  144. /** Channel window opened. */
  145. CHANNEL_OPENED(ChannelEvents.CHANNEL_EVENT, "Channel window opened"),
  146. /** Channel window closed. */
  147. CHANNEL_CLOSED(ChannelEvents.CHANNEL_EVENT, "Channel window closed"),
  148. /** Names reply received. */
  149. CHANNEL_GOTNAMES(ChannelEvents.CHANNEL_EVENT, "Channel names reply received"),
  150. /** Channel topic is not set. */
  151. CHANNEL_NOTOPIC(ChannelEvents.CHANNEL_EVENT, "Channel topic is not set"),
  152. /** Channel topic received. */
  153. CHANNEL_GOTTOPIC(ChannelEvents.CHANNEL_TOPICEVENT, "Channel topic received"),
  154. /** Channel message sent. */
  155. CHANNEL_SELF_MESSAGE(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_ARG, "Channel message sent"),
  156. /** Channel action sent. */
  157. CHANNEL_SELF_ACTION(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_ARG, "Channel action sent"),
  158. /** Channel message received. */
  159. CHANNEL_MESSAGE(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_ARG, "Channel message received"),
  160. /** Channel actions received. */
  161. CHANNEL_ACTION(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_ARG, "Channel action received"),
  162. /** Channel notice received. */
  163. CHANNEL_NOTICE(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_ARG, "Channel notice received"),
  164. /** Channel mode notice received.
  165. *
  166. * @since 0.6.3m2 */
  167. CHANNEL_MODE_NOTICE(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_CHARARG,
  168. "Channel mode notice received"),
  169. /** Channel CTCP received. */
  170. CHANNEL_CTCP(ChannelEvents.CHANNEL_CTCP, "Channel CTCP received"),
  171. /** Someone joined a channel. */
  172. CHANNEL_JOIN(ChannelEvents.CHANNEL_SOURCED_EVENT, "Someone joined a channel"),
  173. /** Someone left a channel. */
  174. CHANNEL_PART(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_ARG, "Someone left a channel"),
  175. /** Someone quit. */
  176. CHANNEL_QUIT(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_ARG, "Someone quit IRC"),
  177. /** Someone was kicked. */
  178. CHANNEL_KICK(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_VICTIM, "Someone kicked someone"),
  179. /** Someone marked as away. */
  180. @Deprecated
  181. CHANNEL_USERAWAY(ChannelEvents.CHANNEL_SOURCED_EVENT, "Someone is marked as 'away'"),
  182. /** Someone marked as back. */
  183. @Deprecated
  184. CHANNEL_USERBACK(ChannelEvents.CHANNEL_SOURCED_EVENT, "Someone is marked as 'back'"),
  185. /** Channel list mode retrieved.
  186. *
  187. * @since 0.6.3 */
  188. CHANNEL_LISTMODERETRIEVED(ChannelEvents.CHANNEL_LISTMODEEVENT,
  189. "Channel list mode value retrieved"),
  190. /** Channel mode discovered. */
  191. CHANNEL_MODESDISCOVERED(ChannelEvents.CHANNEL_MODEEVENT, "Channel modes discovered"),
  192. /** Channel mode changes. */
  193. CHANNEL_MODECHANGE(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_ARG, "Someone changed channel modes"),
  194. /** Someone changed someone else's user modes. */
  195. CHANNEL_USERMODECHANGE(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_VICTIM,
  196. "Someone changed someone else's modes"),
  197. /** Someone changed nickname. */
  198. CHANNEL_NICKCHANGE(ChannelEvents.CHANNEL_NICKEVENT, "Someone changed nicknames"),
  199. /** Someone changed a topic. */
  200. CHANNEL_TOPICCHANGE(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_ARG,
  201. "Someone changed channel topic"),
  202. /** Query opened. */
  203. QUERY_OPENED(QueryEvents.QUERY_EVENT, "Query window opened"),
  204. /** Query closed. */
  205. QUERY_CLOSED(QueryEvents.QUERY_EVENT, "Query window closed"),
  206. /** Query message received. */
  207. QUERY_MESSAGE(QueryEvents.QUERY_SOURCED_EVENT_WITH_ARG, "Private message received"),
  208. /** Query action received. */
  209. QUERY_ACTION(QueryEvents.QUERY_SOURCED_EVENT_WITH_ARG, "Private action received"),
  210. /** Query message sent. */
  211. QUERY_SELF_MESSAGE(QueryEvents.QUERY_SOURCED_EVENT_WITH_ARG, "Private message sent"),
  212. /** Query action sent. */
  213. QUERY_SELF_ACTION(QueryEvents.QUERY_SOURCED_EVENT_WITH_ARG, "Private action sent"),
  214. /** Query quit event. */
  215. QUERY_QUIT(QueryEvents.QUERY_EVENT_WITH_ARG, "Query: user quit"),
  216. /** Query nick change. */
  217. QUERY_NICKCHANGE(QueryEvents.QUERY_EVENT_WITH_ARG, "Query: user changed nicks"),
  218. /** Plugin loaded. */
  219. @Deprecated
  220. PLUGIN_LOADED(PluginEvents.PLUGIN_EVENT, "Plugin loaded"),
  221. /** Plugin unloaded. */
  222. @Deprecated
  223. PLUGIN_UNLOADED(PluginEvents.PLUGIN_EVENT, "Plugin unloaded"),
  224. /** Plugins have been refreshed. */
  225. PLUGIN_REFRESH(PluginEvents.PLUGIN_EVENT, "Plugins refreshed"),
  226. /** Action created. */
  227. ACTION_CREATED(ActionEvents.ACTION_EVENT, "Action created"),
  228. /** Action updated. */
  229. ACTION_UPDATED(ActionEvents.ACTION_EVENT, "Action updated"),
  230. /** Action deleted. */
  231. ACTION_DELETED(ActionEvents.ACTION_DELETED, "Action deleted"),
  232. /** Channel clicked. */
  233. @Deprecated
  234. LINK_CHANNEL_CLICKED(LinkEvents.CHANNEL_CLICKED, "A channel link was clicked"),
  235. /** Channel clicked. */
  236. @Deprecated
  237. LINK_NICKNAME_CLICKED(LinkEvents.NICKNAME_CLICKED, "A nickname link was clicked"),
  238. /** Link clicked. */
  239. @Deprecated
  240. LINK_URL_CLICKED(LinkEvents.LINK_CLICKED, "A Link was clicked");
  241. /** The type of this action. */
  242. private final ActionMetaType type;
  243. /** The name of this action. */
  244. private final String name;
  245. /**
  246. * Constructs a new core action.
  247. *
  248. * @param type The type of this action
  249. * @param name The name of this action
  250. */
  251. CoreActionType(final ActionMetaType type, final String name) {
  252. this.type = type;
  253. this.name = name;
  254. }
  255. @Override
  256. public ActionMetaType getType() {
  257. return type;
  258. }
  259. @Override
  260. public String getName() {
  261. return name;
  262. }
  263. }