This repository was archived by the owner on Jun 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 545
Expand file tree
/
Copy pathChatRoomView.kt
More file actions
149 lines (119 loc) · 4.27 KB
/
ChatRoomView.kt
File metadata and controls
149 lines (119 loc) · 4.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
package chat.rocket.android.chatroom.presentation
import chat.rocket.android.chatroom.uimodel.BaseUiModel
import chat.rocket.android.chatroom.uimodel.suggestion.ChatRoomSuggestionUiModel
import chat.rocket.android.chatroom.uimodel.suggestion.CommandSuggestionUiModel
import chat.rocket.android.chatroom.uimodel.suggestion.EmojiSuggestionUiModel
import chat.rocket.android.chatroom.uimodel.suggestion.PeopleSuggestionUiModel
import chat.rocket.android.chatrooms.adapter.model.RoomUiModel
import chat.rocket.android.core.behaviours.LoadingView
import chat.rocket.android.core.behaviours.MessageView
import chat.rocket.core.internal.realtime.socket.model.State
interface ChatRoomView : LoadingView, MessageView {
/**
* Shows the Favorite/Unfavorite chat room icon.
*
* @param isFavorite Shows the favorite icon if true, otherwise shows the unfavorite icon.
*/
fun showFavoriteIcon(isFavorite: Boolean)
/**
* Shows the chat room messages.
*
* @param dataSet The data set to show.
* @param clearDataSet If true it will clear the previous data set.
*/
fun showMessages(dataSet: List<BaseUiModel<*>>, clearDataSet: Boolean)
/**
* Shows the chat room messages in the basis of a search term.
*
* @param dataSet The data set to show.
*/
fun showSearchedMessages(dataSet: List<BaseUiModel<*>>)
/**
* Send a message to a chat room.
*
* @param text The text to send.
*/
fun sendMessage(text: String)
fun sendMessage()
/**
* Shows the username(s) of the user(s) who is/are typing in the chat room.
*
* @param usernameList The list of username to show.
*/
fun showTypingStatus(usernameList: List<String>)
/**
* Hides the typing status view.
*/
fun hideTypingStatusView()
/**
* Perform file selection with the mime type [filter]
*/
fun showFileSelection(filter: Array<String>?)
/**
* Shows a invalid file message.
*/
fun showInvalidFileMessage()
/**
* Shows a (recent) message sent to a chat room.
*
* @param message The (recent) message sent to a chat room.
*/
fun showNewMessage(message: List<BaseUiModel<*>>, isMessageReceived: Boolean)
/**
* Dispatch to the recycler views adapter that we should remove a message.
*
* @param msgId The id of the message to be removed.
*/
fun dispatchDeleteMessage(msgId: String)
/**
* Dispatch a update to the recycler views adapter about a changed message.
*
* @param index The index of the changed message
*/
fun dispatchUpdateMessage(index: Int, message: List<BaseUiModel<*>>)
/**
* Show reply status above the message composer.
*
* @param username The username or name of the user to reply/quote to.
* @param replyMarkdown The markdown of the message reply.
* @param quotedMessage The message to quote.
*/
fun showReplyingAction(username: String, replyMarkdown: String, quotedMessage: String)
/**
* Copy message to clipboard.
*
* @param message The message to copy.
*/
fun copyToClipboard(message: String)
/**
* Show edit status above the message composer.
*/
fun showEditingAction(roomId: String, messageId: String, text: String)
/**
* Disabling the send message button avoids the user tap this button multiple
* times to send a same message.
*/
fun disableSendMessageButton()
/**
* Enables the send message button.
*/
fun enableSendMessageButton()
/**
* Clears the message composition.
*/
fun clearMessageComposition(deleteMessage: Boolean)
fun showInvalidFileSize(fileSize: Int, maxFileSize: Int)
fun showConnectionState(state: State)
fun populatePeopleSuggestions(members: List<PeopleSuggestionUiModel>)
fun populateRoomSuggestions(chatRooms: List<ChatRoomSuggestionUiModel>)
fun populateEmojiSuggestions(emojis: List<EmojiSuggestionUiModel>)
fun onJoined(roomUiModel: RoomUiModel)
fun showReactionsPopup(messageId: String)
/**
* Show list of commands.
*
* @param commands The list of available commands.
*/
fun populateCommandSuggestions(commands: List<CommandSuggestionUiModel>)
fun onRoomUpdated(roomUiModel: RoomUiModel)
}