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 and jobs */
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 #define DC_PARAM_PREP_FORWARDS 'P' /* for msgs in PREPARING: space-separated list of message IDs of forwarded copies */
46 #define DC_PARAM_SET_LATITUDE 'l' /* for msgs */
47 #define DC_PARAM_SET_LONGITUDE 'n' /* for msgs */
48 
49 #define DC_PARAM_SERVER_FOLDER 'Z' /* for jobs */
50 #define DC_PARAM_SERVER_UID 'z' /* for jobs */
51 #define DC_PARAM_ALSO_MOVE 'M' /* for jobs */
52 #define DC_PARAM_RECIPIENTS 'R' /* for jobs: space-separated list of message recipients */
53 
54 #define DC_PARAM_UNPROMOTED 'U' /* for groups */
55 #define DC_PARAM_PROFILE_IMAGE 'i' /* for groups and contacts */
56 #define DC_PARAM_SELFTALK 'K' /* for chats */
57 
58 
59 // values for DC_PARAM_FORCE_PLAINTEXT
60 #define DC_FP_ADD_AUTOCRYPT_HEADER 1
61 #define DC_FP_NO_AUTOCRYPT_HEADER 2
62 
63 
64 /* user functions */
65 int dc_param_exists (dc_param_t*, int key);
66 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. */
67 int32_t dc_param_get_int (const dc_param_t*, int key, int32_t def);
68 double dc_param_get_float (const dc_param_t*, int key, double def);
69 void dc_param_set (dc_param_t*, int key, const char* value);
70 void dc_param_set_int (dc_param_t*, int key, int32_t value);
71 void dc_param_set_float (dc_param_t*, int key, double value);
72 
73 /* library-private */
74 dc_param_t* dc_param_new ();
75 void dc_param_empty (dc_param_t*);
76 void dc_param_unref (dc_param_t*);
77 void dc_param_set_packed (dc_param_t*, const char*);
78 void dc_param_set_urlencoded (dc_param_t*, const char*);
79 
80 
81 #ifdef __cplusplus
82 } // /extern "C"
83 #endif
84 #endif // __DC_PARAM_H__