Delta Chat Core C-API
mrchatlist.h
1 /*******************************************************************************
2  *
3  * Delta Chat Core
4  * Copyright (C) 2017 Björn Petersen
5  * Contact: r10s@b44t.com, http://b44t.com
6  *
7  * This program is free software: you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License as published by the Free Software
9  * Foundation, either version 3 of the License, or (at your option) any later
10  * version.
11  *
12  * This program is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
15  * details.
16  *
17  * You should have received a copy of the GNU General Public License along with
18  * this program. If not, see http://www.gnu.org/licenses/ .
19  *
20  ******************************************************************************/
21 
22 
23 #ifndef __MRCHATLIST_H__
24 #define __MRCHATLIST_H__
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 
30 typedef struct mrmailbox_t mrmailbox_t;
31 typedef struct mrpoortext_t mrpoortext_t;
32 typedef struct mrchat_t mrchat_t;
33 
34 
42 typedef struct mrchatlist_t
43 {
47  #define MR_CHATLIST_IDS_PER_RESULT 2
48  size_t m_cnt;
49  carray* m_chatNlastmsg_ids;
50 } mrchatlist_t;
51 
52 
53 mrchatlist_t* mrchatlist_new (mrmailbox_t*);
57 uint32_t mrchatlist_get_chat_id (mrchatlist_t*, size_t index);
58 uint32_t mrchatlist_get_msg_id (mrchatlist_t*, size_t index);
60 
61 /* library-internal */
62 int mrchatlist_load_from_db__ (mrchatlist_t*, int listflags, const char* query);
63 
64 
65 #ifdef __cplusplus
66 } /* /extern "C" */
67 #endif
68 #endif /* __MRCHATLIST_H__ */
mrmailbox_t * m_mailbox
The mailbox, the chatlist belongs to.
Definition: mrchatlist.h:44
An object representing a single chatlist in memory.
Definition: mrchatlist.h:42
mrpoortext_t * mrchatlist_get_summary(mrchatlist_t *chatlist, size_t index, mrchat_t *chat)
Get a summary for a chatlist index.
Definition: mrchatlist.c:205
An object representing a single mailbox.
Definition: mrmailbox.h:178
void mrchatlist_empty(mrchatlist_t *chatlist)
Empty a chatlist object.
Definition: mrchatlist.c:83
uint32_t mrchatlist_get_msg_id(mrchatlist_t *chatlist, size_t index)
Get a single message ID of a chatlist.
Definition: mrchatlist.c:155
An object representing text with some attributes.
Definition: mrpoortext.h:35
size_t mrchatlist_get_cnt(mrchatlist_t *chatlist)
Find out the number of chats in a chatlist.
Definition: mrchatlist.c:101
uint32_t mrchatlist_get_chat_id(mrchatlist_t *chatlist, size_t index)
Get a single chat ID of a chatlist.
Definition: mrchatlist.c:123
void mrchatlist_unref(mrchatlist_t *chatlist)
Free a mrchatlist_t object as created eg.
Definition: mrchatlist.c:62
An object representing a single chat in memory.
Definition: mrchat.h:39