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