Delta Chat Core C-API
mrmimefactory.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 __MRMIMEFACTORY_H__
24 #define __MRMIMEFACTORY_H__
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 
30 
31 
32 typedef struct mrmsg_t mrmsg_t;
33 typedef struct mrchat_t mrchat_t;
34 typedef struct mrmailbox_t mrmailbox_t;
35 
36 
37 #define MR_SYSTEM_GROUPNAME_CHANGED 2
38 #define MR_SYSTEM_GROUPIMAGE_CHANGED 3
39 #define MR_SYSTEM_MEMBER_ADDED_TO_GROUP 4
40 #define MR_SYSTEM_MEMBER_REMOVED_FROM_GROUP 5
41 
42 
43 typedef enum {
44  MR_MF_NOTHING_LOADED = 0,
45  MR_MF_MSG_LOADED,
46  MR_MF_MDN_LOADED
47 } mrmimefactory_loaded_t;
48 
49 
53 typedef struct mrmimefactory_t {
54 
57  /* in: parameters, set eg. by mrmimefactory_load_msg() */
58  char* m_from_addr;
59  char* m_from_displayname;
60  char* m_selfstatus;
61  clist* m_recipients_names;
62  clist* m_recipients_addr;
63  time_t m_timestamp;
64  char* m_rfc724_mid;
65 
66  /* what is loaded? */
67  mrmimefactory_loaded_t m_loaded;
68 
69  mrmsg_t* m_msg;
70  mrchat_t* m_chat;
71  int m_increation;
72  char* m_predecessor;
73  char* m_references;
74  int m_req_mdn;
75 
76  /* out: after a successfull mrmimefactory_create_mime(), here's the data */
77  MMAPString* m_out;
78  int m_out_encrypted;
79 
80  /* private */
81  mrmailbox_t* m_mailbox;
82 
83 } mrmimefactory_t;
84 
85 
86 void mrmimefactory_init (mrmimefactory_t*, mrmailbox_t*);
87 void mrmimefactory_empty (mrmimefactory_t*);
88 int mrmimefactory_load_msg (mrmimefactory_t*, uint32_t msg_id);
89 int mrmimefactory_load_mdn (mrmimefactory_t*, uint32_t msg_id);
90 int mrmimefactory_render (mrmimefactory_t*, int encrypt_to_self);
91 
92 
93 #ifdef __cplusplus
94 } /* /extern "C" */
95 #endif
96 #endif /* __MRMIMEFACTORY_H__ */
97 
An object representing a single mailbox.
Definition: mrmailbox.h:178
An object representing a single message in memory.
Definition: mrmsg.h:40
An object representing a single chat in memory.
Definition: mrchat.h:39