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.

LocalClientInfo.java 2.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * Copyright (c) 2006-2017 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.parser.interfaces;
  23. /**
  24. * A more specialised type of {@link ClientInfo} which represents a locally
  25. * controlled client, and as such can be modified in various ways.
  26. *
  27. * @author chris
  28. * @since 0.6.3m1
  29. */
  30. public interface LocalClientInfo extends ClientInfo {
  31. /**
  32. * Sets this client's nickname to the specified value.
  33. *
  34. * @param name The new nickname to use
  35. */
  36. void setNickname(String name);
  37. /**
  38. * Retrieves the modes which are currently set on the local client.
  39. *
  40. * @return A string representation of the client's user modes
  41. */
  42. String getModes();
  43. /**
  44. * Marks the local client as being away.
  45. *
  46. * @param reason The reason for being away
  47. */
  48. void setAway(String reason);
  49. /**
  50. * Marks the local client as being back (not away).
  51. */
  52. void setBack();
  53. /**
  54. * Alters the user modes of the local client. This method will queue modes
  55. * to be sent in one go, according to the behaviour/configuration of the
  56. * backend system. If fewer modes are altered than the queue accepts,
  57. * {@link #flushModes()} must be called.
  58. *
  59. * @param add Whether to add or remove the mode
  60. * @param mode Character representation of the mode to be altered
  61. */
  62. void alterMode(boolean add, Character mode);
  63. /**
  64. * Flushes any modes that have been queued by the
  65. * {@link #alterMode(boolean, Character)} method.
  66. */
  67. void flushModes();
  68. }