Delta Chat Core C-API
dc_param.h
1 #ifndef __DC_PARAM_H__
2 #define __DC_PARAM_H__
3 #ifdef __cplusplus
4 extern "C" {
5 #endif
6 
7 
8 typedef struct _dc_param dc_param_t;
9 
10 
22 struct _dc_param
23 {
25  char* packed;
26 };
27 
28 
29 #define DC_PARAM_FILE 'f' /* for msgs */
30 #define DC_PARAM_WIDTH 'w' /* for msgs */
31 #define DC_PARAM_HEIGHT 'h' /* for msgs */
32 #define DC_PARAM_DURATION 'd' /* for msgs */
33 #define DC_PARAM_MIMETYPE 'm' /* for msgs */
34 #define DC_PARAM_GUARANTEE_E2EE 'c' /* for msgs: incoming: message is encryoted, outgoing: guarantee E2EE or the message is not send */
35 #define DC_PARAM_ERRONEOUS_E2EE 'e' /* for msgs: decrypted with validation errors or without mutual set, if neither 'c' nor 'e' are preset, the messages is only transport encrypted */
36 #define DC_PARAM_FORCE_PLAINTEXT 'u' /* for msgs: force unencrypted message, either DC_FP_ADD_AUTOCRYPT_HEADER (1), DC_FP_NO_AUTOCRYPT_HEADER (2) or 0 */
37 #define DC_PARAM_WANTS_MDN 'r' /* for msgs: an incoming message which requestes a MDN (aka read receipt) */
38 #define DC_PARAM_FORWARDED 'a' /* for msgs */
39 #define DC_PARAM_CMD 'S' /* for msgs */
40 #define DC_PARAM_CMD_ARG 'E' /* for msgs */
41 #define DC_PARAM_CMD_ARG2 'F' /* for msgs */
42 #define DC_PARAM_CMD_ARG3 'G' /* for msgs */
43 #define DC_PARAM_CMD_ARG4 'H' /* for msgs */
44 #define DC_PARAM_ERROR 'L' /* for msgs */
45 
46 #define DC_PARAM_SERVER_FOLDER 'Z' /* for jobs */
47 #define DC_PARAM_SERVER_UID 'z' /* for jobs */
48 #define DC_PARAM_ALSO_MOVE 'M' /* for jobs */
49 
50 #define DC_PARAM_UNPROMOTED 'U' /* for groups */
51 #define DC_PARAM_PROFILE_IMAGE 'i' /* for groups and contacts */
52 #define DC_PARAM_SELFTALK 'K' /* for chats */
53 
54 
55 // values for DC_PARAM_FORCE_PLAINTEXT
56 #define DC_FP_ADD_AUTOCRYPT_HEADER 1
57 #define DC_FP_NO_AUTOCRYPT_HEADER 2
58 
59 
60 /* user functions */
61 int dc_param_exists (dc_param_t*, int key);
62 char* dc_param_get (const dc_param_t*, int key, const char* def); /* the value may be an empty string, "def" is returned only if the value unset. The result must be free()'d in any case. */
63 int32_t dc_param_get_int (const dc_param_t*, int key, int32_t def);
64 void dc_param_set (dc_param_t*, int key, const char* value);
65 void dc_param_set_int (dc_param_t*, int key, int32_t value);
66 
67 /* library-private */
68 dc_param_t* dc_param_new ();
69 void dc_param_empty (dc_param_t*);
70 void dc_param_unref (dc_param_t*);
71 void dc_param_set_packed (dc_param_t*, const char*);
72 void dc_param_set_urlencoded (dc_param_t*, const char*);
73 
74 
75 #ifdef __cplusplus
76 } // /extern "C"
77 #endif
78 #endif // __DC_PARAM_H__