You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

GroupChat.java 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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.interfaces;
  23. import com.dmdirc.Topic;
  24. import com.google.common.base.Optional;
  25. import com.dmdirc.DMDircMBassador;
  26. import java.util.List;
  27. /**
  28. * A chat containing multiple participants.
  29. */
  30. public interface GroupChat extends Chat {
  31. /**
  32. * Adds a nicklist listener to this channel.
  33. *
  34. * @param listener The listener to notify about nicklist changes.
  35. */
  36. void addNicklistListener(final NicklistListener listener);
  37. /**
  38. * Adds a topic change listener to this channel.
  39. *
  40. * @param listener The listener to notify about topic changes.
  41. */
  42. void addTopicChangeListener(final TopicChangeListener listener);
  43. /**
  44. * Returns the current topic for this channel.
  45. *
  46. * @return Current channel topic
  47. */
  48. Optional<Topic> getCurrentTopic();
  49. /**
  50. * Gets an event bus which will only contain events generated in relation to this channel.
  51. *
  52. * @return An event bus scoped to this channel.
  53. */
  54. DMDircMBassador getEventBus();
  55. /**
  56. * Retrieves the maximum length that a topic on this channel can be.
  57. *
  58. * @return The maximum length that this channel's topic may be
  59. */
  60. int getMaxTopicLength();
  61. /**
  62. * Retrieve the topics that have been seen on this channel.
  63. *
  64. * @return A list of topics that have been seen on this channel, including the current one.
  65. */
  66. List<Topic> getTopics();
  67. /**
  68. * Determines if we are currently joined to the chat.
  69. *
  70. * @return True if joined, false otherwise.
  71. */
  72. boolean isOnChannel();
  73. /**
  74. * Joins the specified channel. This only makes sense if used after a call to part().
  75. */
  76. void join();
  77. /**
  78. * Parts this channel with the specified message. Parting does NOT close the channel window.
  79. *
  80. * @param reason The reason for parting the channel
  81. */
  82. void part(final String reason);
  83. /**
  84. * Removes a nicklist listener from this channel.
  85. *
  86. * @param listener The listener to be removed.
  87. */
  88. void removeNicklistListener(final NicklistListener listener);
  89. /**
  90. * Removes a topic change listener from this channel.
  91. *
  92. * @param listener The listener to be removed.
  93. */
  94. void removeTopicChangeListener(final TopicChangeListener listener);
  95. /**
  96. * Requests all available list modes for this channel.
  97. */
  98. void retrieveListModes();
  99. /**
  100. * Attempts to set the topic of this channel.
  101. *
  102. * @param topic The new topic to be used. An empty string will clear the current topic
  103. */
  104. void setTopic(final String topic);
  105. }