Delta Chat Core C-API
mrloginparam.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 __MRLOGINPARAM_H__
24 #define __MRLOGINPARAM_H__
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 
33 typedef struct mrloginparam_t
34 {
37  /* IMAP/POP3 - all pointers may be NULL if unset, public read */
38  char* m_addr;
39  char* m_mail_server;
40  char* m_mail_user;
41  char* m_mail_pw;
42  uint16_t m_mail_port;
43 
44  /* SMTP - all pointers may be NULL if unset, public read */
45  char* m_send_server;
46  char* m_send_user;
47  char* m_send_pw;
48  int m_send_port;
49 
50  /* Server options*/
51  #define MR_AUTH_XOAUTH2 0x2
52  #define MR_AUTH_NORMAL 0x4
53  #define MR_AUTH_FLAGS (MR_AUTH_XOAUTH2|MR_AUTH_NORMAL) /* if none of these flags are set, the default is choosen, even if MR_NO_AUTOCONFIG is set */
54 
55  #define MR_IMAP_SOCKET_STARTTLS 0x100
56  #define MR_IMAP_SOCKET_SSL 0x200
57  #define MR_IMAP_SOCKET_PLAIN 0x400
58  #define MR_IMAP_SOCKET_FLAGS (MR_IMAP_SOCKET_STARTTLS|MR_IMAP_SOCKET_SSL|MR_IMAP_SOCKET_PLAIN) /* if none of these flags are set, the default is choosen, even if MR_NO_AUTOCONFIG is set */
59 
60  #define MR_SMTP_SOCKET_STARTTLS 0x10000
61  #define MR_SMTP_SOCKET_SSL 0x20000
62  #define MR_SMTP_SOCKET_PLAIN 0x40000
63  #define MR_SMTP_SOCKET_FLAGS (MR_SMTP_SOCKET_STARTTLS|MR_SMTP_SOCKET_SSL|MR_SMTP_SOCKET_PLAIN) /* if none of these flags are set, the default is choosen, even if MR_NO_AUTOCONFIG is set */
64 
65  #define MR_NO_EXTRA_IMAP_UPLOAD 0x2000000
66  #define MR_NO_MOVE_TO_CHATS 0x4000000
67 
68  int m_server_flags;
69 } mrloginparam_t;
70 
71 
72 mrloginparam_t* mrloginparam_new ();
73 void mrloginparam_unref (mrloginparam_t*);
74 void mrloginparam_empty (mrloginparam_t*); /* clears all data and frees its memory. All pointers are NULL after this function is called. */
75 void mrloginparam_read__ (mrloginparam_t*, mrsqlite3_t*, const char* prefix);
76 void mrloginparam_write__ (const mrloginparam_t*, mrsqlite3_t*, const char* prefix);
77 char* mrloginparam_get_readable (const mrloginparam_t*);
78 
79 
80 #ifdef __cplusplus
81 } /* /extern "C" */
82 #endif
83 #endif /* __MRLOGINPARAM_H__ */
84