Delta Chat Core C-Library
mrpoortext.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 __MRPOORTEXT_H__
24 #define __MRPOORTEXT_H__
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 
35 typedef struct mrpoortext_t
36 {
38  char* m_text1;
39  char* m_text2;
40  time_t m_timestamp;
41  int m_state;
42 } mrpoortext_t;
43 
44 
45 #define MR_TEXT1_NORMAL 0
46 #define MR_TEXT1_DRAFT 1
47 #define MR_TEXT1_USERNAME 2
48 #define MR_TEXT1_SELF 3
51 mrpoortext_t* mrpoortext_new ();
52 void mrpoortext_empty (mrpoortext_t*);
54 
55 
56 #define MR_SUMMARY_CHARACTERS 160 /* in practice, the user additionally cuts the string himself pixel-accurate */
57 void mrpoortext_fill (mrpoortext_t*, const mrmsg_t*, const mrchat_t*, const mrcontact_t*);
58 
59 
60 #ifdef __cplusplus
61 } /* /extern "C" */
62 #endif
63 #endif /* __MRPOORTEXT_H__ */
void mrpoortext_unref(mrpoortext_t *poortext)
Frees a mrpoortext_t object created eg.
Definition: mrpoortext.c:55
An object representing a single contact in memory.
Definition: mrcontact.h:38
char * m_text2
may be NULL
Definition: mrpoortext.h:39
int m_state
may be 0
Definition: mrpoortext.h:41
time_t m_timestamp
may be 0
Definition: mrpoortext.h:40
char * m_text1
may be NULL
Definition: mrpoortext.h:38
the poortext object and some function accessing it.
Definition: mrpoortext.h:35
An object representing a single message in memory.
Definition: mrmsg.h:40
int m_text1_meaning
One of MR_TEXT1_NORMAL, MR_TEXT1_DRAFT, MR_TEXT1_USERNAME or MR_TEXT1_SELF.
Definition: mrpoortext.h:37
An object representing a single chat in memory.
Definition: mrchat.h:39