aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ui/about.h13
-rw-r--r--src/ui/account_entry.h30
-rw-r--r--src/ui/accounts.h20
-rw-r--r--src/ui/chat.h55
-rw-r--r--src/ui/chat_entry.h33
-rw-r--r--src/ui/contact_entry.h24
-rw-r--r--src/ui/contact_info.h23
-rw-r--r--src/ui/contacts.h13
-rw-r--r--src/ui/delete_messages.h22
-rw-r--r--src/ui/file_load_entry.h14
-rw-r--r--src/ui/invite_contact.h13
-rw-r--r--src/ui/message.h30
-rw-r--r--src/ui/messenger.h31
-rw-r--r--src/ui/new_account.h13
-rw-r--r--src/ui/new_contact.h13
-rw-r--r--src/ui/new_group.h15
-rw-r--r--src/ui/new_lobby.h13
-rw-r--r--src/ui/new_platform.h15
-rw-r--r--src/ui/picker.h17
-rw-r--r--src/ui/send_file.h21
-rw-r--r--src/ui/settings.h15
21 files changed, 437 insertions, 6 deletions
diff --git a/src/ui/about.h b/src/ui/about.h
index 86e7fe0..e96641a 100644
--- a/src/ui/about.h
+++ b/src/ui/about.h
@@ -35,10 +35,23 @@ typedef struct UI_ABOUT_Handle
35 GtkButton *close_button; 35 GtkButton *close_button;
36} UI_ABOUT_Handle; 36} UI_ABOUT_Handle;
37 37
38/**
39 * Initializes a handle for the about dialog of
40 * a given messenger application.
41 *
42 * @param app Messenger application
43 * @param handle About dialog handle
44 */
38void 45void
39ui_about_dialog_init(MESSENGER_Application *app, 46ui_about_dialog_init(MESSENGER_Application *app,
40 UI_ABOUT_Handle *handle); 47 UI_ABOUT_Handle *handle);
41 48
49/**
50 * Cleans up the allocated resources and resets the
51 * state of a given about dialog handle.
52 *
53 * @param handle About dialog handle
54 */
42void 55void
43ui_about_dialog_cleanup(UI_ABOUT_Handle *handle); 56ui_about_dialog_cleanup(UI_ABOUT_Handle *handle);
44 57
diff --git a/src/ui/account_entry.h b/src/ui/account_entry.h
index fa9bc32..ef79fb2 100644
--- a/src/ui/account_entry.h
+++ b/src/ui/account_entry.h
@@ -37,17 +37,47 @@ typedef struct UI_ACCOUNT_ENTRY_Handle
37 GtkLabel *entry_label; 37 GtkLabel *entry_label;
38} UI_ACCOUNT_ENTRY_Handle; 38} UI_ACCOUNT_ENTRY_Handle;
39 39
40/**
41 * Allocates and creates a new account entry
42 * handle to manage an account in a list for
43 * a given messenger application.
44 *
45 * @param app Messenger application
46 * @return New account entry handle
47 */
40UI_ACCOUNT_ENTRY_Handle* 48UI_ACCOUNT_ENTRY_Handle*
41ui_account_entry_new(MESSENGER_Application *app); 49ui_account_entry_new(MESSENGER_Application *app);
42 50
51/**
52 * Sets the content of the given account entry
53 * handle respectively to visually represent a
54 * selected chat account.
55 *
56 * @param handle Account entry handle
57 * @param account Chat account
58 */
43void 59void
44ui_account_entry_set_account(UI_ACCOUNT_ENTRY_Handle* handle, 60ui_account_entry_set_account(UI_ACCOUNT_ENTRY_Handle* handle,
45 const struct GNUNET_CHAT_Account *account); 61 const struct GNUNET_CHAT_Account *account);
46 62
63/**
64 * Sets the content of the given account entry
65 * handle respectively to visually represent a
66 * selected chat contact.
67 *
68 * @param handle Account entry handle
69 * @param contact Chat contact
70 */
47void 71void
48ui_account_entry_set_contact(UI_ACCOUNT_ENTRY_Handle* handle, 72ui_account_entry_set_contact(UI_ACCOUNT_ENTRY_Handle* handle,
49 const struct GNUNET_CHAT_Contact *contact); 73 const struct GNUNET_CHAT_Contact *contact);
50 74
75/**
76 * Frees its resources and destroys a given
77 * account entry handle.
78 *
79 * @param handle Account entry handle
80 */
51void 81void
52ui_account_entry_delete(UI_ACCOUNT_ENTRY_Handle *handle); 82ui_account_entry_delete(UI_ACCOUNT_ENTRY_Handle *handle);
53 83
diff --git a/src/ui/accounts.h b/src/ui/accounts.h
index a71e31e..9bfedff 100644
--- a/src/ui/accounts.h
+++ b/src/ui/accounts.h
@@ -39,14 +39,34 @@ typedef struct UI_ACCOUNTS_Handle
39 GtkButton *close_button; 39 GtkButton *close_button;
40} UI_ACCOUNTS_Handle; 40} UI_ACCOUNTS_Handle;
41 41
42/**
43 * Initializes a handle for the accounts dialog
44 * of a given messenger application.
45 *
46 * @param app Messenger application
47 * @param handle Accounts dialog handle
48 */
42void 49void
43ui_accounts_dialog_init(MESSENGER_Application *app, 50ui_accounts_dialog_init(MESSENGER_Application *app,
44 UI_ACCOUNTS_Handle *handle); 51 UI_ACCOUNTS_Handle *handle);
45 52
53/**
54 * Refreshes a given accounts dialog handle with the
55 * current list of accounts from a messenger application.
56 *
57 * @param app Messenger application
58 * @param handle Accounts dialog handle
59 */
46void 60void
47ui_accounts_dialog_refresh(MESSENGER_Application *app, 61ui_accounts_dialog_refresh(MESSENGER_Application *app,
48 UI_ACCOUNTS_Handle *handle); 62 UI_ACCOUNTS_Handle *handle);
49 63
64/**
65 * Cleans up the allocated resources and resets the
66 * state of a given accounts dialog handle.
67 *
68 * @param handle Accounts dialog handle
69 */
50void 70void
51ui_accounts_dialog_cleanup(UI_ACCOUNTS_Handle *handle); 71ui_accounts_dialog_cleanup(UI_ACCOUNTS_Handle *handle);
52 72
diff --git a/src/ui/chat.h b/src/ui/chat.h
index e28374c..626bd1d 100644
--- a/src/ui/chat.h
+++ b/src/ui/chat.h
@@ -130,31 +130,86 @@ typedef struct UI_CHAT_Handle
130 UI_PICKER_Handle *picker; 130 UI_PICKER_Handle *picker;
131} UI_CHAT_Handle; 131} UI_CHAT_Handle;
132 132
133/**
134 * Allocates and creates a new chat handle
135 * to manage a chat for a given messenger
136 * application.
137 *
138 * @param app Messenger application
139 * @return New chat handle
140 */
133UI_CHAT_Handle* 141UI_CHAT_Handle*
134ui_chat_new(MESSENGER_Application *app); 142ui_chat_new(MESSENGER_Application *app);
135 143
144/**
145 * Updates a given chat handle with the current
146 * state of a messenger application and the chat
147 * context the chat is representing.
148 *
149 * @param handle Chat handle
150 * @param app Messenger application
151 * @param context Chat context
152 */
136void 153void
137ui_chat_update(UI_CHAT_Handle *handle, 154ui_chat_update(UI_CHAT_Handle *handle,
138 MESSENGER_Application *app, 155 MESSENGER_Application *app,
139 struct GNUNET_CHAT_Context* context); 156 struct GNUNET_CHAT_Context* context);
140 157
158/**
159 * Frees its resources and destroys a given
160 * chat handle.
161 *
162 * @param handle Chat handle
163 */
141void 164void
142ui_chat_delete(UI_CHAT_Handle *handle); 165ui_chat_delete(UI_CHAT_Handle *handle);
143 166
167/**
168 * Add a message handle to a given chat handle
169 * to get listed by it for a messenger
170 * application.
171 *
172 * @param handle Chat handle
173 * @param app Messenger application
174 * @param message Message handle
175 */
144void 176void
145ui_chat_add_message(UI_CHAT_Handle *handle, 177ui_chat_add_message(UI_CHAT_Handle *handle,
146 MESSENGER_Application *app, 178 MESSENGER_Application *app,
147 UI_MESSAGE_Handle *message); 179 UI_MESSAGE_Handle *message);
148 180
181/**
182 * Removes a message handle from a given chat
183 * handle to remove it from its list for a
184 * messenger application.
185 *
186 * @param handle Chat handle
187 * @param app Messenger application
188 * @param message Message handle
189 */
149void 190void
150ui_chat_remove_message(UI_CHAT_Handle *handle, 191ui_chat_remove_message(UI_CHAT_Handle *handle,
151 MESSENGER_Application *app, 192 MESSENGER_Application *app,
152 UI_MESSAGE_Handle *message); 193 UI_MESSAGE_Handle *message);
153 194
195/**
196 * Add a file load entry handle to a given chat
197 * handle to get listed by it.
198 *
199 * @param handle Chat handle
200 * @param file_load File load entry handle
201 */
154void 202void
155ui_chat_add_file_load(UI_CHAT_Handle *handle, 203ui_chat_add_file_load(UI_CHAT_Handle *handle,
156 UI_FILE_LOAD_ENTRY_Handle *file_load); 204 UI_FILE_LOAD_ENTRY_Handle *file_load);
157 205
206/**
207 * Removes a file load entry handle from a given
208 * chat handle to remove it from its list.
209 *
210 * @param handle Chat handle
211 * @param file_load File load entry handle
212 */
158void 213void
159ui_chat_remove_file_load(UI_CHAT_Handle *handle, 214ui_chat_remove_file_load(UI_CHAT_Handle *handle,
160 UI_FILE_LOAD_ENTRY_Handle *file_load); 215 UI_FILE_LOAD_ENTRY_Handle *file_load);
diff --git a/src/ui/chat_entry.h b/src/ui/chat_entry.h
index 1e2896f..4eb5431 100644
--- a/src/ui/chat_entry.h
+++ b/src/ui/chat_entry.h
@@ -47,17 +47,50 @@ typedef struct UI_CHAT_ENTRY_Handle
47 GtkImage *read_receipt_image; 47 GtkImage *read_receipt_image;
48} UI_CHAT_ENTRY_Handle; 48} UI_CHAT_ENTRY_Handle;
49 49
50/**
51 * Allocates and creates a new chat entry
52 * handle to manage a chat in a list for
53 * a given messenger application.
54 *
55 * @param app Messenger application
56 * @return New chat entry handle
57 */
50UI_CHAT_ENTRY_Handle* 58UI_CHAT_ENTRY_Handle*
51ui_chat_entry_new(MESSENGER_Application *app); 59ui_chat_entry_new(MESSENGER_Application *app);
52 60
61/**
62 * Updates a given chat entry handle with the
63 * current state of a messenger application and
64 * the chat context the chat entry is
65 * representing.
66 *
67 * @param handle Chat entry handle
68 * @param app Messenger application
69 * @param context Chat context
70 */
53void 71void
54ui_chat_entry_update(UI_CHAT_ENTRY_Handle *handle, 72ui_chat_entry_update(UI_CHAT_ENTRY_Handle *handle,
55 MESSENGER_Application *app, 73 MESSENGER_Application *app,
56 struct GNUNET_CHAT_Context *context); 74 struct GNUNET_CHAT_Context *context);
57 75
76/**
77 * Frees its resources and destroys a given
78 * chat entry handle.
79 *
80 * @param handle Chat entry handle
81 */
58void 82void
59ui_chat_entry_delete(UI_CHAT_ENTRY_Handle *handle); 83ui_chat_entry_delete(UI_CHAT_ENTRY_Handle *handle);
60 84
85/**
86 * Fully disposes all resources and handles
87 * which are linked to a given chat entry
88 * handle by a messenger application. The chat
89 * entry handle will be deleted as well.
90 *
91 * @param handle Chat entry handle
92 * @param app Messenger application
93 */
61void 94void
62ui_chat_entry_dispose(UI_CHAT_ENTRY_Handle *handle, 95ui_chat_entry_dispose(UI_CHAT_ENTRY_Handle *handle,
63 MESSENGER_Application *app); 96 MESSENGER_Application *app);
diff --git a/src/ui/contact_entry.h b/src/ui/contact_entry.h
index a9ff9dd..dc692de 100644
--- a/src/ui/contact_entry.h
+++ b/src/ui/contact_entry.h
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2021 GNUnet e.V. 3 Copyright (C) 2021--2022 GNUnet e.V.
4 4
5 GNUnet is free software: you can redistribute it and/or modify it 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 6 under the terms of the GNU Affero General Public License as published
@@ -39,13 +39,35 @@ typedef struct UI_CONTACT_ENTRY_Handle
39 GtkLabel *subtitle_label; 39 GtkLabel *subtitle_label;
40} UI_CONTACT_ENTRY_Handle; 40} UI_CONTACT_ENTRY_Handle;
41 41
42/**
43 * Allocates and creates a new contact entry
44 * handle to manage a contact in a list for
45 * a given messenger application.
46 *
47 * @param app Messenger application
48 * @return New contact entry handle
49 */
42UI_CONTACT_ENTRY_Handle* 50UI_CONTACT_ENTRY_Handle*
43ui_contact_entry_new(MESSENGER_Application *app); 51ui_contact_entry_new(MESSENGER_Application *app);
44 52
53/**
54 * Sets the content of the given contact entry
55 * handle respectively to visually represent a
56 * selected chat contact.
57 *
58 * @param handle Contact entry handle
59 * @param contact Chat contact
60 */
45void 61void
46ui_contact_entry_set_contact(UI_CONTACT_ENTRY_Handle* handle, 62ui_contact_entry_set_contact(UI_CONTACT_ENTRY_Handle* handle,
47 const struct GNUNET_CHAT_Contact *contact); 63 const struct GNUNET_CHAT_Contact *contact);
48 64
65/**
66 * Frees its resources and destroys a given
67 * contact entry handle.
68 *
69 * @param handle Contact entry handle
70 */
49void 71void
50ui_contact_entry_delete(UI_CONTACT_ENTRY_Handle *handle); 72ui_contact_entry_delete(UI_CONTACT_ENTRY_Handle *handle);
51 73
diff --git a/src/ui/contact_info.h b/src/ui/contact_info.h
index f602073..82f0d43 100644
--- a/src/ui/contact_info.h
+++ b/src/ui/contact_info.h
@@ -63,15 +63,38 @@ typedef struct UI_CONTACT_INFO_Handle
63 QRcode *qr; 63 QRcode *qr;
64} UI_CONTACT_INFO_Handle; 64} UI_CONTACT_INFO_Handle;
65 65
66/**
67 * Initializes a handle for the contact info dialog
68 * of a given messenger application.
69 *
70 * @param app Messenger application
71 * @param handle Contact info dialog handle
72 */
66void 73void
67ui_contact_info_dialog_init(MESSENGER_Application *app, 74ui_contact_info_dialog_init(MESSENGER_Application *app,
68 UI_CONTACT_INFO_Handle *handle); 75 UI_CONTACT_INFO_Handle *handle);
69 76
77/**
78 * Updates a given contact info dialog handle with
79 * current data of a certain chat contact and whether
80 * their identity should be visually revealed in the
81 * dialog.
82 *
83 * @param handle Contact info dialog handle
84 * @param contact Chat contact
85 * @param reveal Flag to reveal QR code of identity key
86 */
70void 87void
71ui_contact_info_dialog_update(UI_CONTACT_INFO_Handle *handle, 88ui_contact_info_dialog_update(UI_CONTACT_INFO_Handle *handle,
72 struct GNUNET_CHAT_Contact *contact, 89 struct GNUNET_CHAT_Contact *contact,
73 gboolean reveal); 90 gboolean reveal);
74 91
92/**
93 * Cleans up the allocated resources and resets the
94 * state of a given contact info dialog handle.
95 *
96 * @param handle Contact info dialog handle
97 */
75void 98void
76ui_contact_info_dialog_cleanup(UI_CONTACT_INFO_Handle *handle); 99ui_contact_info_dialog_cleanup(UI_CONTACT_INFO_Handle *handle);
77 100
diff --git a/src/ui/contacts.h b/src/ui/contacts.h
index 6bb3475..f63b554 100644
--- a/src/ui/contacts.h
+++ b/src/ui/contacts.h
@@ -39,10 +39,23 @@ typedef struct UI_CONTACTS_Handle
39 GtkButton *close_button; 39 GtkButton *close_button;
40} UI_CONTACTS_Handle; 40} UI_CONTACTS_Handle;
41 41
42/**
43 * Initializes a handle for the contacts dialog
44 * of a given messenger application.
45 *
46 * @param app Messenger application
47 * @param handle Contacts dialog handle
48 */
42void 49void
43ui_contacts_dialog_init(MESSENGER_Application *app, 50ui_contacts_dialog_init(MESSENGER_Application *app,
44 UI_CONTACTS_Handle *handle); 51 UI_CONTACTS_Handle *handle);
45 52
53/**
54 * Cleans up the allocated resources and resets the
55 * state of a given contacts dialog handle.
56 *
57 * @param handle Contacts dialog handle
58 */
46void 59void
47ui_contacts_dialog_cleanup(UI_CONTACTS_Handle *handle); 60ui_contacts_dialog_cleanup(UI_CONTACTS_Handle *handle);
48 61
diff --git a/src/ui/delete_messages.h b/src/ui/delete_messages.h
index b0c04e0..4f5474c 100644
--- a/src/ui/delete_messages.h
+++ b/src/ui/delete_messages.h
@@ -50,15 +50,37 @@ typedef struct UI_DELETE_MESSAGES_Handle
50 GtkButton *confirm_button; 50 GtkButton *confirm_button;
51} UI_DELETE_MESSAGES_Handle; 51} UI_DELETE_MESSAGES_Handle;
52 52
53/**
54 * Initializes a handle for the delete messages
55 * dialog of a given messenger application.
56 *
57 * @param app Messenger application
58 * @param handle Delete messages dialog handle
59 */
53void 60void
54ui_delete_messages_dialog_init(MESSENGER_Application *app, 61ui_delete_messages_dialog_init(MESSENGER_Application *app,
55 UI_DELETE_MESSAGES_Handle *handle); 62 UI_DELETE_MESSAGES_Handle *handle);
56 63
64/**
65 * Links a custom list and a callback to a
66 * given delete messages dialog which will be
67 * used to handle the event of deletion.
68 *
69 * @param handle Delete messages dialog handle
70 * @param callback Delete messages callback
71 * @param selected Selected messages
72 */
57void 73void
58ui_delete_messages_dialog_link(UI_DELETE_MESSAGES_Handle *handle, 74ui_delete_messages_dialog_link(UI_DELETE_MESSAGES_Handle *handle,
59 UI_DELETE_MESSAGES_Callback callback, 75 UI_DELETE_MESSAGES_Callback callback,
60 GList *selected); 76 GList *selected);
61 77
78/**
79 * Cleans up the allocated resources and resets the
80 * state of a given delete messages dialog handle.
81 *
82 * @param handle Delete messages dialog handle
83 */
62void 84void
63ui_delete_messages_dialog_cleanup(UI_DELETE_MESSAGES_Handle *handle); 85ui_delete_messages_dialog_cleanup(UI_DELETE_MESSAGES_Handle *handle);
64 86
diff --git a/src/ui/file_load_entry.h b/src/ui/file_load_entry.h
index f24d3d5..dbcea62 100644
--- a/src/ui/file_load_entry.h
+++ b/src/ui/file_load_entry.h
@@ -47,9 +47,23 @@ typedef struct UI_FILE_LOAD_ENTRY_Handle
47 GtkButton *cancel_button; 47 GtkButton *cancel_button;
48} UI_FILE_LOAD_ENTRY_Handle; 48} UI_FILE_LOAD_ENTRY_Handle;
49 49
50/**
51 * Allocates and creates a new file load entry
52 * handle to manage loading files for a given
53 * messenger application.
54 *
55 * @param app Messenger application
56 * @return New file load entry handle
57 */
50UI_FILE_LOAD_ENTRY_Handle* 58UI_FILE_LOAD_ENTRY_Handle*
51ui_file_load_entry_new(MESSENGER_Application *app); 59ui_file_load_entry_new(MESSENGER_Application *app);
52 60
61/**
62 * Frees its resources and destroys a given file
63 * load entry handle.
64 *
65 * @param handle File load entry handle
66 */
53void 67void
54ui_file_load_entry_delete(UI_FILE_LOAD_ENTRY_Handle *handle); 68ui_file_load_entry_delete(UI_FILE_LOAD_ENTRY_Handle *handle);
55 69
diff --git a/src/ui/invite_contact.h b/src/ui/invite_contact.h
index 3c3175a..2630c84 100644
--- a/src/ui/invite_contact.h
+++ b/src/ui/invite_contact.h
@@ -39,10 +39,23 @@ typedef struct UI_INVITE_CONTACT_Handle
39 GtkButton *close_button; 39 GtkButton *close_button;
40} UI_INVITE_CONTACT_Handle; 40} UI_INVITE_CONTACT_Handle;
41 41
42/**
43 * Initializes a handle for the invite contact dialog
44 * of a given messenger application.
45 *
46 * @param app Messenger application
47 * @param handle Invite contact dialog handle
48 */
42void 49void
43ui_invite_contact_dialog_init(MESSENGER_Application *app, 50ui_invite_contact_dialog_init(MESSENGER_Application *app,
44 UI_INVITE_CONTACT_Handle *handle); 51 UI_INVITE_CONTACT_Handle *handle);
45 52
53/**
54 * Cleans up the allocated resources and resets the
55 * state of a given invite contact dialog handle.
56 *
57 * @param handle Invite contact dialog handle
58 */
46void 59void
47ui_invite_contact_dialog_cleanup(UI_INVITE_CONTACT_Handle *handle); 60ui_invite_contact_dialog_cleanup(UI_INVITE_CONTACT_Handle *handle);
48 61
diff --git a/src/ui/message.h b/src/ui/message.h
index f86ac3b..84ec7e8 100644
--- a/src/ui/message.h
+++ b/src/ui/message.h
@@ -84,18 +84,48 @@ typedef struct UI_MESSAGE_Handle
84 guint redraw_animation; 84 guint redraw_animation;
85} UI_MESSAGE_Handle; 85} UI_MESSAGE_Handle;
86 86
87/**
88 * Allocates and creates a new message handle
89 * to represent a message for a given messenger
90 * application by selected message type.
91 *
92 * @param app Messenger application
93 * @param type Message type
94 * @return New message handle
95 */
87UI_MESSAGE_Handle* 96UI_MESSAGE_Handle*
88ui_message_new(MESSENGER_Application *app, 97ui_message_new(MESSENGER_Application *app,
89 UI_MESSAGE_Type type); 98 UI_MESSAGE_Type type);
90 99
100/**
101 * Refreshes the visual state of the read receipt
102 * from a given message handle.
103 *
104 * @param handle Message handle
105 */
91void 106void
92ui_message_refresh(UI_MESSAGE_Handle *handle); 107ui_message_refresh(UI_MESSAGE_Handle *handle);
93 108
109/**
110 * Updates a given message handle with the
111 * current data from a messenger application
112 * and a selected chat message.
113 *
114 * @param handle Message handle
115 * @param app Messenger application
116 * @param message Chat message
117 */
94void 118void
95ui_message_update(UI_MESSAGE_Handle *handle, 119ui_message_update(UI_MESSAGE_Handle *handle,
96 MESSENGER_Application *app, 120 MESSENGER_Application *app,
97 const struct GNUNET_CHAT_Message *message); 121 const struct GNUNET_CHAT_Message *message);
98 122
123/**
124 * Frees its resources and destroys a given
125 * message handle.
126 *
127 * @param handle Message handle
128 */
99void 129void
100ui_message_delete(UI_MESSAGE_Handle *handle); 130ui_message_delete(UI_MESSAGE_Handle *handle);
101 131
diff --git a/src/ui/messenger.h b/src/ui/messenger.h
index 6c36ed9..5088947 100644
--- a/src/ui/messenger.h
+++ b/src/ui/messenger.h
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2021 GNUnet e.V. 3 Copyright (C) 2021--2022 GNUnet e.V.
4 4
5 GNUnet is free software: you can redistribute it and/or modify it 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 6 under the terms of the GNU Affero General Public License as published
@@ -77,18 +77,47 @@ typedef struct UI_MESSENGER_Handle
77 GtkWidget *no_chat_box; 77 GtkWidget *no_chat_box;
78} UI_MESSENGER_Handle; 78} UI_MESSENGER_Handle;
79 79
80/**
81 * Initializes a handle for the messenger main
82 * window of a given messenger application.
83 *
84 * @param app Messenger application
85 * @param handle Messenger window handle
86 */
80void 87void
81ui_messenger_init(MESSENGER_Application *app, 88ui_messenger_init(MESSENGER_Application *app,
82 UI_MESSENGER_Handle *handle); 89 UI_MESSENGER_Handle *handle);
83 90
91/**
92 * Refreshes a given messenger window handle with
93 * the data of the current state from a given
94 * messenger application.
95 *
96 * @param app Messenger application
97 * @param handle Messenger window handle
98 */
84void 99void
85ui_messenger_refresh(MESSENGER_Application *app, 100ui_messenger_refresh(MESSENGER_Application *app,
86 UI_MESSENGER_Handle *handle); 101 UI_MESSENGER_Handle *handle);
87 102
103/**
104 * Returns whether a certain chat context is currently
105 * visually represented via a chat UI handle.
106 *
107 * @param handle Messenger window handle
108 * @param context Chat context
109 * @return true if the context is viewed, otherwise false
110 */
88gboolean 111gboolean
89ui_messenger_is_context_active(UI_MESSENGER_Handle *handle, 112ui_messenger_is_context_active(UI_MESSENGER_Handle *handle,
90 struct GNUNET_CHAT_Context *context); 113 struct GNUNET_CHAT_Context *context);
91 114
115/**
116 * Cleans up the allocated resources and resets the
117 * state of a given messenger window handle.
118 *
119 * @param handle Messenger window handle
120 */
92void 121void
93ui_messenger_cleanup(UI_MESSENGER_Handle *handle); 122ui_messenger_cleanup(UI_MESSENGER_Handle *handle);
94 123
diff --git a/src/ui/new_account.h b/src/ui/new_account.h
index 703f28d..917bf24 100644
--- a/src/ui/new_account.h
+++ b/src/ui/new_account.h
@@ -43,10 +43,23 @@ typedef struct UI_NEW_ACCOUNT_Handle
43 GtkButton *confirm_button; 43 GtkButton *confirm_button;
44} UI_NEW_ACCOUNT_Handle; 44} UI_NEW_ACCOUNT_Handle;
45 45
46/**
47 * Initializes a handle for the new account dialog
48 * of a given messenger application.
49 *
50 * @param app Messenger application
51 * @param handle New account dialog handle
52 */
46void 53void
47ui_new_account_dialog_init(MESSENGER_Application *app, 54ui_new_account_dialog_init(MESSENGER_Application *app,
48 UI_NEW_ACCOUNT_Handle *handle); 55 UI_NEW_ACCOUNT_Handle *handle);
49 56
57/**
58 * Cleans up the allocated resources and resets the
59 * state of a given new account dialog handle.
60 *
61 * @param handle New account dialog handle
62 */
50void 63void
51ui_new_account_dialog_cleanup(UI_NEW_ACCOUNT_Handle *handle); 64ui_new_account_dialog_cleanup(UI_NEW_ACCOUNT_Handle *handle);
52 65
diff --git a/src/ui/new_contact.h b/src/ui/new_contact.h
index 173b674..7a7ff96 100644
--- a/src/ui/new_contact.h
+++ b/src/ui/new_contact.h
@@ -56,10 +56,23 @@ typedef struct UI_NEW_CONTACT_Handle
56 guint idle_processing; 56 guint idle_processing;
57} UI_NEW_CONTACT_Handle; 57} UI_NEW_CONTACT_Handle;
58 58
59/**
60 * Initializes a handle for the new contact dialog
61 * of a given messenger application.
62 *
63 * @param app Messenger application
64 * @param handle New contact dialog handle
65 */
59void 66void
60ui_new_contact_dialog_init(MESSENGER_Application *app, 67ui_new_contact_dialog_init(MESSENGER_Application *app,
61 UI_NEW_CONTACT_Handle *handle); 68 UI_NEW_CONTACT_Handle *handle);
62 69
70/**
71 * Cleans up the allocated resources and resets the
72 * state of a given new contact dialog handle.
73 *
74 * @param handle New contact dialog handle
75 */
63void 76void
64ui_new_contact_dialog_cleanup(UI_NEW_CONTACT_Handle *handle); 77ui_new_contact_dialog_cleanup(UI_NEW_CONTACT_Handle *handle);
65 78
diff --git a/src/ui/new_group.h b/src/ui/new_group.h
index 0b8dd44..dbf6797 100644
--- a/src/ui/new_group.h
+++ b/src/ui/new_group.h
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2021 GNUnet e.V. 3 Copyright (C) 2021--2022 GNUnet e.V.
4 4
5 GNUnet is free software: you can redistribute it and/or modify it 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 6 under the terms of the GNU Affero General Public License as published
@@ -53,10 +53,23 @@ typedef struct UI_NEW_GROUP_Handle
53 GtkButton *confirm_button; 53 GtkButton *confirm_button;
54} UI_NEW_GROUP_Handle; 54} UI_NEW_GROUP_Handle;
55 55
56/**
57 * Initializes a handle for the new group dialog
58 * of a given messenger application.
59 *
60 * @param app Messenger application
61 * @param handle New group dialog handle
62 */
56void 63void
57ui_new_group_dialog_init(MESSENGER_Application *app, 64ui_new_group_dialog_init(MESSENGER_Application *app,
58 UI_NEW_GROUP_Handle *handle); 65 UI_NEW_GROUP_Handle *handle);
59 66
67/**
68 * Cleans up the allocated resources and resets the
69 * state of a given new group dialog handle.
70 *
71 * @param handle New group dialog handle
72 */
60void 73void
61ui_new_group_dialog_cleanup(UI_NEW_GROUP_Handle *handle); 74ui_new_group_dialog_cleanup(UI_NEW_GROUP_Handle *handle);
62 75
diff --git a/src/ui/new_lobby.h b/src/ui/new_lobby.h
index 9d100b6..ea2e09c 100644
--- a/src/ui/new_lobby.h
+++ b/src/ui/new_lobby.h
@@ -61,10 +61,23 @@ typedef struct UI_NEW_LOBBY_Handle
61 QRcode *qr; 61 QRcode *qr;
62} UI_NEW_LOBBY_Handle; 62} UI_NEW_LOBBY_Handle;
63 63
64/**
65 * Initializes a handle for the new lobby dialog
66 * of a given messenger application.
67 *
68 * @param app Messenger application
69 * @param handle New lobby dialog handle
70 */
64void 71void
65ui_new_lobby_dialog_init(MESSENGER_Application *app, 72ui_new_lobby_dialog_init(MESSENGER_Application *app,
66 UI_NEW_LOBBY_Handle *handle); 73 UI_NEW_LOBBY_Handle *handle);
67 74
75/**
76 * Cleans up the allocated resources and resets the
77 * state of a given new lobby dialog handle.
78 *
79 * @param handle New lobby dialog handle
80 */
68void 81void
69ui_new_lobby_dialog_cleanup(UI_NEW_LOBBY_Handle *handle); 82ui_new_lobby_dialog_cleanup(UI_NEW_LOBBY_Handle *handle);
70 83
diff --git a/src/ui/new_platform.h b/src/ui/new_platform.h
index e2ec288..be2d481 100644
--- a/src/ui/new_platform.h
+++ b/src/ui/new_platform.h
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2021 GNUnet e.V. 3 Copyright (C) 2021--2022 GNUnet e.V.
4 4
5 GNUnet is free software: you can redistribute it and/or modify it 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 6 under the terms of the GNU Affero General Public License as published
@@ -41,10 +41,23 @@ typedef struct UI_NEW_PLATFORM_Handle
41 GtkButton *confirm_button; 41 GtkButton *confirm_button;
42} UI_NEW_PLATFORM_Handle; 42} UI_NEW_PLATFORM_Handle;
43 43
44/**
45 * Initializes a handle for the new platform dialog
46 * of a given messenger application.
47 *
48 * @param app Messenger application
49 * @param handle New platform dialog handle
50 */
44void 51void
45ui_new_platform_dialog_init(MESSENGER_Application *app, 52ui_new_platform_dialog_init(MESSENGER_Application *app,
46 UI_NEW_PLATFORM_Handle *handle); 53 UI_NEW_PLATFORM_Handle *handle);
47 54
55/**
56 * Cleans up the allocated resources and resets the
57 * state of a given new platform dialog handle.
58 *
59 * @param handle New platform dialog handle
60 */
48void 61void
49ui_new_platform_dialog_cleanup(UI_NEW_PLATFORM_Handle *handle); 62ui_new_platform_dialog_cleanup(UI_NEW_PLATFORM_Handle *handle);
50 63
diff --git a/src/ui/picker.h b/src/ui/picker.h
index 3313956..9c21bc9 100644
--- a/src/ui/picker.h
+++ b/src/ui/picker.h
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2021 GNUnet e.V. 3 Copyright (C) 2021--2022 GNUnet e.V.
4 4
5 GNUnet is free software: you can redistribute it and/or modify it 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 6 under the terms of the GNU Affero General Public License as published
@@ -57,10 +57,25 @@ typedef struct UI_PICKER_Handle
57 GtkButton *settings_button; 57 GtkButton *settings_button;
58} UI_PICKER_Handle; 58} UI_PICKER_Handle;
59 59
60/**
61 * Allocates and creates a new picker handle to
62 * manage emoji selection in a chat for a given
63 * messenger application.
64 *
65 * @param app Messenger application
66 * @param chat Chat handle
67 * @return New picker handle
68 */
60UI_PICKER_Handle* 69UI_PICKER_Handle*
61ui_picker_new(MESSENGER_Application *app, 70ui_picker_new(MESSENGER_Application *app,
62 UI_CHAT_Handle *chat); 71 UI_CHAT_Handle *chat);
63 72
73/**
74 * Frees its resources and destroys a given picker
75 * handle.
76 *
77 * @param handle Picker handle
78 */
64void 79void
65ui_picker_delete(UI_PICKER_Handle *handle); 80ui_picker_delete(UI_PICKER_Handle *handle);
66 81
diff --git a/src/ui/send_file.h b/src/ui/send_file.h
index 138426a..a4cad4f 100644
--- a/src/ui/send_file.h
+++ b/src/ui/send_file.h
@@ -49,14 +49,35 @@ typedef struct UI_SEND_FILE_Handle
49 guint redraw_animation; 49 guint redraw_animation;
50} UI_SEND_FILE_Handle; 50} UI_SEND_FILE_Handle;
51 51
52/**
53 * Initializes a handle for the send file dialog
54 * of a given messenger application.
55 *
56 * @param app Messenger application
57 * @param handle Send file dialog handle
58 */
52void 59void
53ui_send_file_dialog_init(MESSENGER_Application *app, 60ui_send_file_dialog_init(MESSENGER_Application *app,
54 UI_SEND_FILE_Handle *handle); 61 UI_SEND_FILE_Handle *handle);
55 62
63/**
64 * Updates a given send file dialog handle with
65 * a certain filename to pre-determine which file
66 * gets selected by the dialog as default.
67 *
68 * @param handle Send file dialog handle
69 * @param filename Custom filename
70 */
56void 71void
57ui_send_file_dialog_update(UI_SEND_FILE_Handle *handle, 72ui_send_file_dialog_update(UI_SEND_FILE_Handle *handle,
58 const gchar *filename); 73 const gchar *filename);
59 74
75/**
76 * Cleans up the allocated resources and resets the
77 * state of a given send file dialog handle.
78 *
79 * @param handle Send file dialog handle
80 */
60void 81void
61ui_send_file_dialog_cleanup(UI_SEND_FILE_Handle *handle); 82ui_send_file_dialog_cleanup(UI_SEND_FILE_Handle *handle);
62 83
diff --git a/src/ui/settings.h b/src/ui/settings.h
index b2b7486..87e7263 100644
--- a/src/ui/settings.h
+++ b/src/ui/settings.h
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2021 GNUnet e.V. 3 Copyright (C) 2021--2022 GNUnet e.V.
4 4
5 GNUnet is free software: you can redistribute it and/or modify it 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 6 under the terms of the GNU Affero General Public License as published
@@ -52,10 +52,23 @@ typedef struct UI_SETTINGS_Handle
52 GtkButton *leave_chats_button; 52 GtkButton *leave_chats_button;
53} UI_SETTINGS_Handle; 53} UI_SETTINGS_Handle;
54 54
55/**
56 * Initializes a handle for the settings dialog
57 * of a given messenger application.
58 *
59 * @param app Messenger application
60 * @param handle Settings dialog handle
61 */
55void 62void
56ui_settings_dialog_init(MESSENGER_Application *app, 63ui_settings_dialog_init(MESSENGER_Application *app,
57 UI_SETTINGS_Handle *handle); 64 UI_SETTINGS_Handle *handle);
58 65
66/**
67 * Cleans up the allocated resources and resets the
68 * state of a given settings dialog handle.
69 *
70 * @param handle Settings dialog handle
71 */
59void 72void
60ui_settings_dialog_cleanup(UI_SETTINGS_Handle *handle); 73ui_settings_dialog_cleanup(UI_SETTINGS_Handle *handle);
61 74