chenqiyang
2022-09-02 6a99d9bf65aa5878cb409945ed2bdbdcb916d047
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
/*
 * Copyright (c) 2010-2019 Belledonne Communications SARL.
 *
 * This file is part of Liblinphone.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
 
#ifndef LINPHONE_IM_ENCRYPTION_ENGINE_H
#define LINPHONE_IM_ENCRYPTION_ENGINE_H
 
#include "linphone/types.h"
 
#ifdef __cplusplus
extern "C" {
#endif
 
/**
 * @addtogroup misc
 * @{
 */
 
/**
 * Acquire a reference to the LinphoneImEncryptionEngineCbs.
 * @param cbs #LinphoneImEncryptionEngineCbs object.
 * @return The same #LinphoneImEncryptionEngineCbs object.
 * @donotwrap
**/
LinphoneImEncryptionEngineCbs * linphone_im_encryption_engine_cbs_ref(LinphoneImEncryptionEngineCbs *cbs);
 
/**
 * Release reference to the LinphoneImEncryptionEngineCbs.
 * @param cbs #LinphoneImEncryptionEngineCbs object.
 * @donotwrap
**/
void linphone_im_encryption_engine_cbs_unref(LinphoneImEncryptionEngineCbs *cbs);
 
/**
 * Gets the user data in the #LinphoneImEncryptionEngineCbs object
 * @param cbs the #LinphoneImEncryptionEngineCbs
 * @return the user data
 * @donotwrap
*/
LINPHONE_PUBLIC void *linphone_im_encryption_engine_cbs_get_user_data(const LinphoneImEncryptionEngineCbs *cbs);
 
/**
 * Sets the user data in the #LinphoneImEncryptionEngineCbs object
 * @param cbs the #LinphoneImEncryptionEngineCbs object
 * @param data the user data
 * @donotwrap
*/
LINPHONE_PUBLIC void linphone_im_encryption_engine_cbs_set_user_data(LinphoneImEncryptionEngineCbs *cbs, void *data);
 
/**
 * Acquire a reference to the LinphoneImEncryptionEngine.
 * @param imee #LinphoneImEncryptionEngine object.
 * @return The same #LinphoneImEncryptionEngine object.
 * @donotwrap
**/
LINPHONE_PUBLIC LinphoneImEncryptionEngine * linphone_im_encryption_engine_ref(LinphoneImEncryptionEngine *imee);
 
/**
 * Release reference to the LinphoneImEncryptionEngine.
 * @param imee #LinphoneImEncryptionEngine object.
 * @donotwrap
**/
LINPHONE_PUBLIC void linphone_im_encryption_engine_unref(LinphoneImEncryptionEngine *imee);
 
/**
 * Gets the user data in the #LinphoneImEncryptionEngine object
 * @param imee the #LinphoneImEncryptionEngine
 * @return the user data
 * @donotwrap
*/
LINPHONE_PUBLIC void *linphone_im_encryption_engine_get_user_data(const LinphoneImEncryptionEngine *imee);
 
/**
 * Sets the user data in the #LinphoneImEncryptionEngine object
 * @param imee the #LinphoneImEncryptionEngine object
 * @param data the user data
 * @donotwrap
*/
LINPHONE_PUBLIC void linphone_im_encryption_engine_set_user_data(LinphoneImEncryptionEngine *imee, void *data);
 
/**
 * Gets the #LinphoneCore object that created the IM encryption engine
 * @param imee #LinphoneImEncryptionEngine object
 * @return The #LinphoneCore object that created the IM encryption engine
 * @donotwrap
 */
LINPHONE_PUBLIC LinphoneCore * linphone_im_encryption_engine_get_core(LinphoneImEncryptionEngine *imee);
 
/**
 * Gets the #LinphoneImEncryptionEngineCbs object that holds the callbacks
 * @param imee the #LinphoneImEncryptionEngine object
 * @return the #LinphoneImEncryptionEngineCbs object
 * @donotwrap
*/
LINPHONE_PUBLIC LinphoneImEncryptionEngineCbs* linphone_im_encryption_engine_get_callbacks(const LinphoneImEncryptionEngine *imee);
 
/**
 * Gets the callback that will decrypt the chat messages upon reception
 * @param cbs the #LinphoneImEncryptionEngineCbs object
 * @return the callback
 * @donotwrap
*/
LINPHONE_PUBLIC LinphoneImEncryptionEngineCbsIncomingMessageCb linphone_im_encryption_engine_cbs_get_process_incoming_message(LinphoneImEncryptionEngineCbs *cbs);
 
/**
 * Sets the callback that will decrypt the chat messages upon reception
 * @param cbs the #LinphoneImEncryptionEngineCbs object
 * @param cb the callback to call
 * @donotwrap
*/
LINPHONE_PUBLIC void linphone_im_encryption_engine_cbs_set_process_incoming_message(LinphoneImEncryptionEngineCbs *cbs, LinphoneImEncryptionEngineCbsIncomingMessageCb cb);
 
/**
 * Gets the callback that will encrypt the chat messages before sending them
 * @param cbs the #LinphoneImEncryptionEngineCbs object
 * @return the callback
 * @donotwrap
*/
LINPHONE_PUBLIC LinphoneImEncryptionEngineCbsOutgoingMessageCb linphone_im_encryption_engine_cbs_get_process_outgoing_message(LinphoneImEncryptionEngineCbs *cbs);
 
/**
 * Sets the callback that will encrypt the chat messages before sending them
 * @param cbs the #LinphoneImEncryptionEngineCbs object
 * @param cb the callback to call
 * @donotwrap
*/
LINPHONE_PUBLIC void linphone_im_encryption_engine_cbs_set_process_outgoing_message(LinphoneImEncryptionEngineCbs *cbs, LinphoneImEncryptionEngineCbsOutgoingMessageCb cb);
 
/**
 * Gets the callback that will decrypt the files while downloading them
 * @param cbs the #LinphoneImEncryptionEngineCbs object
 * @return the callback
 * @donotwrap
*/
LINPHONE_PUBLIC LinphoneImEncryptionEngineCbsDownloadingFileCb linphone_im_encryption_engine_cbs_get_process_downloading_file(LinphoneImEncryptionEngineCbs *cbs);
 
/**
 * Sets the callback that will decrypt the files while downloading them
 * @param cbs the #LinphoneImEncryptionEngineCbs object
 * @param cb the callback to call
 * @donotwrap
*/
LINPHONE_PUBLIC void linphone_im_encryption_engine_cbs_set_process_downloading_file(LinphoneImEncryptionEngineCbs *cbs, LinphoneImEncryptionEngineCbsDownloadingFileCb cb);
 
/**
 * Gets the callback that will will encrypt the files while uploading them
 * @param cbs the #LinphoneImEncryptionEngineCbs object
 * @return the callback
 * @donotwrap
*/
LINPHONE_PUBLIC LinphoneImEncryptionEngineCbsUploadingFileCb linphone_im_encryption_engine_cbs_get_process_uploading_file(LinphoneImEncryptionEngineCbs *cbs);
 
/**
 * Sets the callback that will encrypt the files while uploading them
 * @param cbs the #LinphoneImEncryptionEngineCbs object
 * @param cb the callback to call
 * @donotwrap
*/
LINPHONE_PUBLIC void linphone_im_encryption_engine_cbs_set_process_uploading_file(LinphoneImEncryptionEngineCbs *cbs, LinphoneImEncryptionEngineCbsUploadingFileCb cb);
 
/**
 * Gets the callback telling whether or not to encrypt the files
 * @param cbs the LinphoneImEncryptionEngineCbs object
 * @return the callback
 * @donotwrap
*/
LINPHONE_PUBLIC LinphoneImEncryptionEngineCbsIsEncryptionEnabledForFileTransferCb linphone_im_encryption_engine_cbs_get_is_encryption_enabled_for_file_transfer(LinphoneImEncryptionEngineCbs *cbs);
 
/**
 * Sets the callback telling whether or not to encrypt the files
 * @param cbs the LinphoneImEncryptionEngineCbs object
 * @param cb the callback to call
 * @donotwrap
*/
LINPHONE_PUBLIC void linphone_im_encryption_engine_cbs_set_is_encryption_enabled_for_file_transfer(LinphoneImEncryptionEngineCbs *cbs, LinphoneImEncryptionEngineCbsIsEncryptionEnabledForFileTransferCb cb);
 
/**
 * Gets the callback that will generate the key to encrypt the file before uploading it
 * @param cbs the #LinphoneImEncryptionEngineCbs object
 * @return the callback
 * @donotwrap
*/
LINPHONE_PUBLIC LinphoneImEncryptionEngineCbsGenerateFileTransferKeyCb linphone_im_encryption_engine_cbs_get_generate_file_transfer_key(LinphoneImEncryptionEngineCbs *cbs);
 
/**
 * Sets the callback that will generate the key to encrypt the file before uploading it
 * @param cbs the #LinphoneImEncryptionEngineCbs object
 * @param cb the callback to call
 * @donotwrap
*/
LINPHONE_PUBLIC void linphone_im_encryption_engine_cbs_set_generate_file_transfer_key(LinphoneImEncryptionEngineCbs *cbs, LinphoneImEncryptionEngineCbsGenerateFileTransferKeyCb cb);
 
/**
 * Create the IM encryption engine
 * @return The created the IM encryption engine
 * @donotwrap
*/
LINPHONE_PUBLIC LinphoneImEncryptionEngine *linphone_im_encryption_engine_new(void);
    
/**
 * @}
 */
 
#ifdef __cplusplus
}
#endif
 
#endif /* LINPHONE_IM_ENCRYPTION_ENGINE_H */