event.h (5872B)
1 /* 2 This file is part of GNUnet. 3 Copyright (C) 2021--2024 GNUnet e.V. 4 5 GNUnet is free software: you can redistribute it and/or modify it 6 under the terms of the GNU Affero General Public License as published 7 by the Free Software Foundation, either version 3 of the License, 8 or (at your option) any later version. 9 10 GNUnet is distributed in the hope that it will be useful, but 11 WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 Affero General Public License for more details. 14 15 You should have received a copy of the GNU Affero General Public License 16 along with this program. If not, see <http://www.gnu.org/licenses/>. 17 18 SPDX-License-Identifier: AGPL3.0-or-later 19 */ 20 /* 21 * @author Tobias Frisch 22 * @file event.h 23 */ 24 25 #ifndef EVENT_H_ 26 #define EVENT_H_ 27 28 #include "application.h" 29 30 /** 31 * Event for the UI to be called whenever the application 32 * causes any issue in back-end throwing a warning. This 33 * might be specific to a given context or none if its 34 * a general warning. 35 * 36 * @param app Messenger application 37 * @param context Chat context or NULL 38 * @param msg Warning message 39 */ 40 void 41 event_handle_warning(MESSENGER_Application *app, 42 struct GNUNET_CHAT_Context *context, 43 struct GNUNET_CHAT_Message *msg); 44 45 /** 46 * Event for the UI to be called whenever the accounts 47 * might add or remove an account from their list. 48 * 49 * @param app Messenger application 50 */ 51 void 52 event_refresh_accounts(MESSENGER_Application *app); 53 54 /** 55 * Event for the UI to be called whenever the user 56 * updates their information. 57 * 58 * @param app Messenger application 59 */ 60 void 61 event_update_profile(MESSENGER_Application *app); 62 63 /** 64 * Event for the UI to be called whenever the user 65 * disconnects the current account. 66 * 67 * @param app Messenger application 68 */ 69 void 70 event_cleanup_profile(MESSENGER_Application *app); 71 72 /** 73 * Event for the UI to be called whenever a the user 74 * creates or updates an account. 75 * 76 * @param app Messenger application 77 * @param context Chat context 78 * @param msg Create/Update message 79 */ 80 void 81 event_select_profile(MESSENGER_Application *app, 82 struct GNUNET_CHAT_Context *context, 83 struct GNUNET_CHAT_Message *msg); 84 85 /** 86 * Event for the UI to be called whenever a the user 87 * joins or leaves a chat (context) via message. 88 * 89 * @param app Messenger application 90 * @param context Chat context 91 * @param msg Join/Leave message 92 */ 93 void 94 event_update_chats(MESSENGER_Application *app, 95 struct GNUNET_CHAT_Context *context, 96 struct GNUNET_CHAT_Message *msg); 97 98 /** 99 * Event for the UI to be called whenever a contact 100 * joins or leaves a given context via message. 101 * 102 * @param app Messenger application 103 * @param context Chat context 104 * @param msg Join/Leave message 105 */ 106 void 107 event_presence_contact(MESSENGER_Application *app, 108 struct GNUNET_CHAT_Context *context, 109 struct GNUNET_CHAT_Message *msg); 110 111 /** 112 * Event for the UI to be called whenever a contact 113 * updates their information with a message in a 114 * given context. 115 * 116 * @param app Messenger application 117 * @param context Chat context 118 * @param msg Update message 119 */ 120 void 121 event_update_contacts(MESSENGER_Application *app, 122 struct GNUNET_CHAT_Context *context, 123 struct GNUNET_CHAT_Message *msg); 124 125 /** 126 * Event for the UI to be called whenever an invitation 127 * message gets received in a given context. 128 * 129 * @param app Messenger application 130 * @param context Chat context 131 * @param msg Invitation message 132 */ 133 void 134 event_invitation(MESSENGER_Application *app, 135 struct GNUNET_CHAT_Context *context, 136 struct GNUNET_CHAT_Message *msg); 137 138 /** 139 * Event for the UI to be called whenever a content 140 * message (text or file) gets received in a given 141 * context. 142 * 143 * @param app Messenger application 144 * @param context Chat context 145 * @param msg Message 146 */ 147 void 148 event_receive_message(MESSENGER_Application *app, 149 struct GNUNET_CHAT_Context *context, 150 struct GNUNET_CHAT_Message *msg); 151 152 /** 153 * Event for the UI to be called whenever a message 154 * gets deleted in a given context. 155 * 156 * @param app Messenger application 157 * @param context Chat context 158 * @param msg Delete message 159 */ 160 void 161 event_delete_message(MESSENGER_Application *app, 162 struct GNUNET_CHAT_Context *context, 163 struct GNUNET_CHAT_Message *msg); 164 165 /** 166 * Event for the UI to be called whenever a message 167 * gets tagged in a given context. 168 * 169 * @param app Messenger application 170 * @param context Chat context 171 * @param msg Tag message 172 */ 173 void 174 event_tag_message(MESSENGER_Application *app, 175 struct GNUNET_CHAT_Context *context, 176 struct GNUNET_CHAT_Message *msg); 177 178 /** 179 * Event for the UI to be called whenever an attribute 180 * gets changed. 181 * 182 * @param app Messenger application 183 */ 184 void 185 event_update_attributes(MESSENGER_Application *app); 186 187 /** 188 * Event for the UI to be called whenever a discourse 189 * message gets received in a given context. 190 * 191 * @param app Messenger application 192 * @param context Chat context 193 * @param msg Discourse message 194 */ 195 void 196 event_discourse(MESSENGER_Application *app, 197 struct GNUNET_CHAT_Context *context, 198 struct GNUNET_CHAT_Message *msg); 199 200 /** 201 * Event for the UI to be called whenever a data 202 * message gets received in a given context. 203 * 204 * @param app Messenger application 205 * @param context Chat context 206 * @param msg Data message 207 */ 208 void 209 event_discourse_data(MESSENGER_Application *app, 210 struct GNUNET_CHAT_Context *context, 211 struct GNUNET_CHAT_Message *msg); 212 213 #endif /* EVENT_H_ */