Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

WindowModel.java 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. /*
  2. * Copyright (c) 2006-2015 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.events.eventbus.EventBus;
  24. import com.dmdirc.config.provider.AggregateConfigProvider;
  25. import com.dmdirc.ui.messages.BackBuffer;
  26. import com.dmdirc.ui.messages.UnreadStatusManager;
  27. import java.util.Optional;
  28. import java.util.Set;
  29. /**
  30. * Models the state of a window.
  31. */
  32. public interface WindowModel {
  33. /**
  34. * Gets a unique ID that identifies this window.
  35. *
  36. * @return This window's unique ID.
  37. */
  38. String getId();
  39. /**
  40. * Sets the ID for this window. This may only be called once; attempting to overwrite a
  41. * previous ID will throw an exception.
  42. *
  43. * @param id The new ID for this window.
  44. */
  45. void setId(String id);
  46. String getIcon();
  47. String getName();
  48. String getTitle();
  49. AggregateConfigProvider getConfigManager();
  50. EventBus getEventBus();
  51. /**
  52. * Changes the name of this container.
  53. *
  54. * @param name The new name for this frame.
  55. */
  56. void setName(String name);
  57. /**
  58. * Changes the title of this container.
  59. *
  60. * @param title The new title for this frame.
  61. */
  62. void setTitle(String title);
  63. /**
  64. * Returns the collection of UI component identifiers that this frame container requires for its
  65. * display.
  66. *
  67. * @since 0.6.6
  68. * @return Collection of UI component identifiers
  69. */
  70. Set<String> getComponents();
  71. /**
  72. * Adds a new component to this container.
  73. *
  74. * @since 0.6.6
  75. * @param component The component to be added
  76. */
  77. void addComponent(String component);
  78. /**
  79. * Removes a component from this container.
  80. *
  81. * @since 0.6.6
  82. * @param component The component to be removed
  83. */
  84. void removeComponent(String component);
  85. /**
  86. * Closes this container (and its associated frame).
  87. */
  88. void close();
  89. /**
  90. * Returns the connection that this container is associated with.
  91. *
  92. * @return the associated connection.
  93. */
  94. Optional<Connection> getConnection();
  95. /**
  96. * Sets the icon to be used by this window.
  97. *
  98. * @param icon The new icon to be used
  99. */
  100. void setIcon(String icon);
  101. /**
  102. * Gets the back buffer for this container.
  103. *
  104. * @return This container's back buffer.
  105. */
  106. BackBuffer getBackBuffer();
  107. /**
  108. * Returns the model used to define input parameters for this window.
  109. *
  110. * @return If this window accepts input, the input model to use, otherwise an empty optional.
  111. */
  112. Optional<InputModel> getInputModel();
  113. /**
  114. * Returns the manager tracking this window's unread messages.
  115. *
  116. * @return The unread status manager for this window.
  117. */
  118. UnreadStatusManager getUnreadStatusManager();
  119. }