IRC client framework (wrapper around libircclient library).
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

IRCClientSessionDelegate.h 6.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. //
  2. // IRCClientSessionDelegate.h
  3. // IRCClient
  4. /*
  5. * Copyright 2015 Said Achmiz (www.saidachmiz.net)
  6. *
  7. * Copyright (C) 2009 Nathan Ollerenshaw chrome@stupendous.net
  8. *
  9. * This library is free software; you can redistribute it and/or modify it
  10. * under the terms of the GNU Lesser General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or (at your
  12. * option) any later version.
  13. *
  14. * This library is distributed in the hope that it will be useful, but WITHOUT
  15. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  16. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
  17. * License for more details.
  18. */
  19. #import <Cocoa/Cocoa.h>
  20. @class IRCClientSession;
  21. @class IRCClientChannel;
  22. /** @brief Receives delegate messages from an IRCClientSession.
  23. *
  24. * Each IRCClientSession object needs a single delegate. Methods are called
  25. * for each event that occurs on an IRC server that the client is connected to.
  26. *
  27. * Note that for any given parameter, it may be optional, in which case a nil
  28. * object may be supplied instead of the given parameter.
  29. */
  30. @protocol IRCClientSessionDelegate <NSObject>
  31. /** The client has successfully connected to the IRC server. */
  32. @required
  33. - (void)connectionSucceeded:(IRCClientSession *)sender;
  34. /** An IRC client on a channel that this client is connected to has changed nickname,
  35. * or this IRC client has changed nicknames.
  36. *
  37. * @param nick the new nickname
  38. * @param oldNick the old nickname
  39. * @param wasItUs did our nick change, or someone else's?
  40. */
  41. @required
  42. - (void)nickChangedFrom:(NSData *)oldNick to:(NSData *)newNick own:(BOOL)wasItUs session:(IRCClientSession *)sender;
  43. /** An IRC client on a channel that this client is connected to has quit IRC.
  44. *
  45. * @param nick the nickname of the client that quit.
  46. * @param reason (optional) the quit message, if any.
  47. */
  48. @required
  49. - (void)userQuit:(NSData *)nick withReason:(NSData *)reason session:(IRCClientSession *)sender;
  50. /** The IRC client has joined (connected) successfully to a new channel. This
  51. * event creates an IRCClientChannel object, which you are expected to assign a
  52. * delegate to, to handle events from the channel.
  53. *
  54. * For example, on receipt of this message, a graphical IRC client would most
  55. * likely open a new window, create an IRCClientChannelDelegate for the window,
  56. * set the new IRCClientChannel's delegate to the new delegate, and then hook
  57. * it up so that new events sent to the IRCClientChannelDelegate are sent to
  58. * the window.
  59. *
  60. * @param channel the IRCClientChannel object for the newly joined channel.
  61. */
  62. @required
  63. - (void)joinedNewChannel:(IRCClientChannel *)channel session:(IRCClientSession *)sender;
  64. /** The client has changed it's user mode.
  65. *
  66. * @param mode the new mode.
  67. */
  68. @required
  69. - (void)modeSet:(NSData *)mode by:(NSData *)nick session:(IRCClientSession *)sender;
  70. /** The client has received a private PRIVMSG from another IRC client.
  71. *
  72. * @param message the text of the message
  73. * @param nick the other IRC Client that sent the message.
  74. */
  75. @required
  76. - (void)privateMessageReceived:(NSData *)message fromUser:(NSData *)nick session:(IRCClientSession *)sender;
  77. /** The client has received a private NOTICE from another client.
  78. *
  79. * @param notice the text of the message
  80. * @param nick the nickname of the other IRC client that sent the message.
  81. */
  82. @required
  83. - (void)privateNoticeReceived:(NSData *)notice fromUser:(NSData *)nick session:(IRCClientSession *)sender;
  84. /** The client has received a private PRIVMSG from the server.
  85. *
  86. * @param origin the sender of the message
  87. * @param params the parameters of the message
  88. */
  89. @required
  90. - (void)serverMessageReceivedFrom:(NSData *)origin params:(NSArray *)params session:(IRCClientSession *)sender;
  91. /** The client has received a private NOTICE from the server.
  92. *
  93. * @param origin the sender of the notice
  94. * @param params the parameters of the notice
  95. */
  96. @required
  97. - (void)serverNoticeReceivedFrom:(NSData *)origin params:(NSArray *)params session:(IRCClientSession *)sender;
  98. /** The IRC client has been invited to a channel.
  99. *
  100. * @param channel the channel for the invitation.
  101. * @param nick the nickname of the user that sent the invitation.
  102. */
  103. @required
  104. - (void)invitedToChannel:(NSData *)channelName by:(NSData *)nick session:(IRCClientSession *)sender;
  105. /** A private CTCP request was sent to the IRC client.
  106. *
  107. * @param request the CTCP request string (after the type)
  108. * @param type the CTCP request type
  109. * @param nick the nickname of the user that sent the request.
  110. */
  111. @optional
  112. - (void)CTCPRequestReceived:(NSData *)request ofType:(NSData *)type fromUser:(NSData *)nick session:(IRCClientSession *)sender;
  113. /** A private CTCP reply was sent to the IRC client.
  114. *
  115. * @param reply an NSData containing the raw C string of the reply.
  116. * @param nick the nickname of the user that sent the reply.
  117. */
  118. @optional
  119. - (void)CTCPReplyReceived:(NSData *)reply fromUser:(NSData *)nick session:(IRCClientSession *)sender;
  120. /** A private CTCP ACTION was sent to the IRC client.
  121. *
  122. * CTCP ACTION is not limited to channels; it may also be sent directly to other users.
  123. *
  124. * @param action the action message text.
  125. * @param nick the nickname of the client that sent the action.
  126. */
  127. @required
  128. - (void)privateCTCPActionReceived:(NSData *)action fromUser:(NSData *)nick session:(IRCClientSession *)sender;
  129. /** An unhandled numeric was received from the IRC server
  130. *
  131. * @param event the unknown event number
  132. * @param origin the sender of the event
  133. * @param params an NSArray of NSData objects that are the raw C strings of the event.
  134. */
  135. @optional
  136. - (void)numericEventReceived:(NSUInteger)event from:(NSData *)origin params:(NSArray *)params session:(IRCClientSession *)sender;
  137. /** An unhandled event was received from the IRC server.
  138. *
  139. * @param event the unknown event name
  140. * @param origin the sender of the event
  141. * @param params an NSArray of NSData objects that are the raw C strings of the event.
  142. */
  143. @optional
  144. - (void)unknownEventReceived:(NSData *)event from:(NSData *)origin params:(NSArray *)params session:(IRCClientSession *)sender;
  145. @end