Delta Chat Core C-API
mrstock.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 __MRSTOCK_H__
24 #define __MRSTOCK_H__
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 
30 #include "mrmailbox.h"
31 #include <stdlib.h>
32 #include <string.h>
33 
34 
35 /* Strings requested by MR_EVENT_GET_STRING and MR_EVENT_GET_QUANTITY_STRING */
36 #define MR_STR_FREE_ 0
37 #define MR_STR_NOMESSAGES 1
38 #define MR_STR_SELF 2
39 #define MR_STR_DRAFT 3
40 #define MR_STR_MEMBER 4
41 #define MR_STR_CONTACT 6
42 #define MR_STR_VOICEMESSAGE 7
43 #define MR_STR_DEADDROP 8
44 #define MR_STR_IMAGE 9
45 #define MR_STR_VIDEO 10
46 #define MR_STR_AUDIO 11
47 #define MR_STR_FILE 12
48 #define MR_STR_STATUSLINE 13
49 #define MR_STR_NEWGROUPDRAFT 14
50 #define MR_STR_MSGGRPNAME 15
51 #define MR_STR_MSGGRPIMGCHANGED 16
52 #define MR_STR_MSGADDMEMBER 17
53 #define MR_STR_MSGDELMEMBER 18
54 #define MR_STR_MSGGROUPLEFT 19
55 #define MR_STR_ERROR 20
56 #define MR_STR_SELFNOTINGRP 21
57 #define MR_STR_NONETWORK 22
58 #define MR_STR_GIF 23
59 #define MR_STR_ENCRYPTEDMSG 24
60 #define MR_STR_ENCR_E2E 25
61 #define MR_STR_ENCR_TRANSP 27
62 #define MR_STR_ENCR_NONE 28
63 #define MR_STR_FINGERPRINTS 30
64 #define MR_STR_READRCPT 31
65 #define MR_STR_READRCPT_MAILBODY 32
66 #define MR_STR_MSGGRPIMGDELETED 33
67 #define MR_STR_E2E_FINE 34
68 #define MR_STR_E2E_NO_AUTOCRYPT 35
69 #define MR_STR_E2E_DIS_BY_YOU 36
70 #define MR_STR_E2E_DIS_BY_RCPT 37
71 #define MR_STR_ARCHIVEDCHATS 40
72 #define MR_STR_STARREDMSGS 41
73 #define MR_STR_AC_SETUP_MSG_SUBJECT 42
74 #define MR_STR_AC_SETUP_MSG_BODY 43
75 #define MR_STR_SELFTALK_SUBTITLE 50
76 
77 
78 /* should be set up by mrmailbox_new() */
79 extern mrmailbox_t* s_localize_mb_obj;
80 
81 
82 /* Return the string with the given ID by calling MR_EVENT_GET_STRING.
83 The result must be free()'d! */
84 char* mrstock_str (int id);
85 
86 
87 /* Replaces the first `%1$s` in the given String-ID by the given value.
88 The result must be free()'d! */
89 char* mrstock_str_repl_string (int id, const char* value);
90 char* mrstock_str_repl_int (int id, int value);
91 
92 
93 /* Replaces the first `%1$s` and `%2$s` in the given String-ID by the two given strings.
94 The result must be free()'d! */
95 char* mrstock_str_repl_string2 (int id, const char*, const char*);
96 
97 
98 /* Return a string with a correct plural form by callint MR_EVENT_GET_QUANTITY_STRING.
99 The result must be free()'d! */
100 char* mrstock_str_repl_pl (int id, int cnt);
101 
102 
103 #ifdef __cplusplus
104 } /* /extern "C" */
105 #endif
106 #endif /* __MRSTOCK_H__ */
107 
An object representing a single mailbox.
Definition: mrmailbox.h:194