aboutsummaryrefslogtreecommitdiff
path: root/include/gnunet_chat_lib.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/gnunet_chat_lib.h')
-rw-r--r--include/gnunet_chat_lib.h56
1 files changed, 43 insertions, 13 deletions
diff --git a/include/gnunet_chat_lib.h b/include/gnunet_chat_lib.h
index 06b7478..2023323 100644
--- a/include/gnunet_chat_lib.h
+++ b/include/gnunet_chat_lib.h
@@ -139,7 +139,8 @@ struct GNUNET_CHAT_Invitation;
139 * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise. 139 * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise.
140 */ 140 */
141typedef int 141typedef int
142(*GNUNET_CHAT_ContactCallback) (void *cls, struct GNUNET_CHAT_Handle *handle, 142(*GNUNET_CHAT_ContactCallback) (void *cls,
143 struct GNUNET_CHAT_Handle *handle,
143 struct GNUNET_CHAT_Contact *contact); 144 struct GNUNET_CHAT_Contact *contact);
144 145
145/** 146/**
@@ -151,7 +152,8 @@ typedef int
151 * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise. 152 * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise.
152 */ 153 */
153typedef int 154typedef int
154(*GNUNET_CHAT_GroupCallback) (void *cls, struct GNUNET_CHAT_Handle *handle, 155(*GNUNET_CHAT_GroupCallback) (void *cls,
156 struct GNUNET_CHAT_Handle *handle,
155 struct GNUNET_CHAT_Group *group); 157 struct GNUNET_CHAT_Group *group);
156 158
157/** 159/**
@@ -163,8 +165,9 @@ typedef int
163 * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise. 165 * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise.
164 */ 166 */
165typedef int 167typedef int
166(*GNUNET_CHAT_GroupContactCallback) (void *cls, struct GNUNET_CHAT_Group *group, 168(*GNUNET_CHAT_GroupContactCallback) (void *cls,
167 struct GNUNET_CHAT_Contact *contact); 169 struct GNUNET_CHAT_Group *group,
170 struct GNUNET_CHAT_Contact *contact);
168 171
169/** 172/**
170 * Iterator over chat messages in a specific chat context. 173 * Iterator over chat messages in a specific chat context.
@@ -175,7 +178,8 @@ typedef int
175 * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise. 178 * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise.
176 */ 179 */
177typedef int 180typedef int
178(*GNUNET_CHAT_ContextMessageCallback) (void *cls, struct GNUNET_CHAT_Context *context, 181(*GNUNET_CHAT_ContextMessageCallback) (void *cls,
182 struct GNUNET_CHAT_Context *context,
179 const struct GNUNET_CHAT_Message *message); 183 const struct GNUNET_CHAT_Message *message);
180 184
181/** 185/**
@@ -187,7 +191,8 @@ typedef int
187 * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise. 191 * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise.
188 */ 192 */
189typedef int 193typedef int
190(*GNUNET_CHAT_ContextFileCallback) (void *cls, struct GNUNET_CHAT_Context *context, 194(*GNUNET_CHAT_ContextFileCallback) (void *cls,
195 struct GNUNET_CHAT_Context *context,
191 struct GNUNET_CHAT_File *file); 196 struct GNUNET_CHAT_File *file);
192 197
193/** 198/**
@@ -202,7 +207,8 @@ typedef int
202 * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise. 207 * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise.
203 */ 208 */
204typedef int 209typedef int
205(*GNUNET_CHAT_MessageReadReceiptCallback) (void *cls, const struct GNUNET_CHAT_Message *message, 210(*GNUNET_CHAT_MessageReadReceiptCallback) (void *cls,
211 const struct GNUNET_CHAT_Message *message,
206 const struct GNUNET_CHAT_Contact *contact, 212 const struct GNUNET_CHAT_Contact *contact,
207 int read_receipt); 213 int read_receipt);
208 214
@@ -215,8 +221,10 @@ typedef int
215 * @param[in] size Full size of the uploading file (in bytes) 221 * @param[in] size Full size of the uploading file (in bytes)
216 */ 222 */
217typedef void 223typedef void
218(*GNUNET_CHAT_FileUploadCallback) (void *cls, const struct GNUNET_CHAT_File *file, 224(*GNUNET_CHAT_FileUploadCallback) (void *cls,
219 uint64_t completed, uint64_t size); 225 const struct GNUNET_CHAT_File *file,
226 uint64_t completed,
227 uint64_t size);
220 228
221/** 229/**
222 * Method called during a download of a specific file in a chat which was shared. 230 * Method called during a download of a specific file in a chat which was shared.
@@ -227,8 +235,10 @@ typedef void
227 * @param[in] size Full size of the downloading file (in bytes) 235 * @param[in] size Full size of the downloading file (in bytes)
228 */ 236 */
229typedef void 237typedef void
230(*GNUNET_CHAT_FileDownloadCallback) (void *cls, const struct GNUNET_CHAT_File *file, 238(*GNUNET_CHAT_FileDownloadCallback) (void *cls,
231 uint64_t completed, uint64_t size); 239 const struct GNUNET_CHAT_File *file,
240 uint64_t completed,
241 uint64_t size);
232 242
233/** 243/**
234 * Method called during an unindexing of a specific file in a chat which was 244 * Method called during an unindexing of a specific file in a chat which was
@@ -240,8 +250,10 @@ typedef void
240 * @param[in] size Full size of the unindexing file (in bytes) 250 * @param[in] size Full size of the unindexing file (in bytes)
241 */ 251 */
242typedef void 252typedef void
243(*GNUNET_CHAT_FileUnindexCallback) (void *cls, struct GNUNET_CHAT_File *file, 253(*GNUNET_CHAT_FileUnindexCallback) (void *cls,
244 uint64_t completed, uint64_t size); 254 struct GNUNET_CHAT_File *file,
255 uint64_t completed,
256 uint64_t size);
245 257
246/** 258/**
247 * Start a chat handle with a certain configuration, an application <i>directory</i> 259 * Start a chat handle with a certain configuration, an application <i>directory</i>
@@ -516,6 +528,24 @@ struct GNUNET_CHAT_Context*
516GNUNET_CHAT_group_get_context (struct GNUNET_CHAT_Group *group); 528GNUNET_CHAT_group_get_context (struct GNUNET_CHAT_Group *group);
517 529
518/** 530/**
531 * Returns the chat contact which uses a given <i>context</i>.
532 *
533 * @param[in] context Context
534 * @return Chat contact
535 */
536const struct GNUNET_CHAT_Contact*
537GNUNET_CHAT_context_get_contact (const struct GNUNET_CHAT_Context *context);
538
539/**
540 * Returns the chat group which uses a given <i>context</i>.
541 *
542 * @param[in] context Context
543 * @return Chat group
544 */
545const struct GNUNET_CHAT_Group*
546GNUNET_CHAT_context_get_group (const struct GNUNET_CHAT_Context *context);
547
548/**
519 * Sets a custom <i>user pointer</i> to a given chat <i>context</i> so it can 549 * Sets a custom <i>user pointer</i> to a given chat <i>context</i> so it can
520 * be accessed in chat context related callbacks. 550 * be accessed in chat context related callbacks.
521 * 551 *