Delta Chat Core C-API
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 {
44 
45  char* m_text1;
46  char* m_text2;
47  time_t m_timestamp;
48  int m_state;
49 } mrpoortext_t;
50 
51 
52 #define MR_TEXT1_NORMAL 0
53 #define MR_TEXT1_DRAFT 1
54 #define MR_TEXT1_USERNAME 2
55 #define MR_TEXT1_SELF 3
56 
57 
58 mrpoortext_t* mrpoortext_new ();
59 void mrpoortext_empty (mrpoortext_t*);
61 
62 
63 #define MR_SUMMARY_CHARACTERS 160
64 void mrpoortext_fill (mrpoortext_t*, const mrmsg_t*, const mrchat_t*, const mrcontact_t*);
65 
66 
67 #ifdef __cplusplus
68 } /* /extern "C" */
69 #endif
70 #endif /* __MRPOORTEXT_H__ */
void mrpoortext_unref(mrpoortext_t *poortext)
Frees a poortext object.
Definition: mrpoortext.c:55
char * m_text2
The meaning is defined by the creator of the object.
Definition: mrpoortext.h:46
int m_state
Typically a MR_MSG_STATE_* constant.
Definition: mrpoortext.h:48
time_t m_timestamp
Typically a message timestamp.
Definition: mrpoortext.h:47
char * m_text1
The meaning is defined by m_text1_meaning and by the creator of the object.
Definition: mrpoortext.h:45
An object representing text with some attributes.
Definition: mrpoortext.h:35
int m_text1_meaning
Defines the meaning of the m_text1 string.
Definition: mrpoortext.h:43