Deprecate csr framework APIs
[platform/upstream/csr-framework.git] / src / include / csr / csr-content-screening-types.h
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License
15  */
16 /*
17  * @file csr-content-screening-types.h
18  * @author Dongsun Lee (ds73.lee@samsung.com)
19  * @version 1.0
20  * @brief Content screening CAPI enums, handles and callbacks
21  */
22
23
24 #ifndef __CSR_CONTENT_SCREENING_TYPES_H_
25 #define __CSR_CONTENT_SCREENING_TYPES_H_
26
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32
33 /**
34  * @addtogroup CAPI_CSR_FRAMEWORK_CS_MODULE
35  * @{
36  */
37
38
39 /**
40  * @deprecated Deprecated since 7.5.
41  * @partner
42  * @brief Enumeration for severity level of a detected malware.
43  * @since_tizen 3.0
44  */
45 typedef enum {
46         CSR_CS_SEVERITY_LOW = 0x01, /**< Low Severity. User can choose how to handle between skip, ignore and remove. */
47         CSR_CS_SEVERITY_MEDIUM = 0x02, /**< Medium Severity. User can choose how to handle between skip, ignore and remove. */
48         CSR_CS_SEVERITY_HIGH = 0x03 /**< High Severity. User can choose how to handle between skip and remove. */
49 } csr_cs_severity_level_e;
50
51
52 /**
53  * @deprecated Deprecated since 7.5.
54  * @partner
55  * @brief Enumeration for the option of asking user about handling a detected malware.
56  * @since_tizen 3.0
57  */
58 typedef enum {
59         CSR_CS_ASK_USER_NO = 0x00, /**< Do not ask the user even if malicious contents were found.*/
60         CSR_CS_ASK_USER_YES = 0x01 /**< Ask the user when malicious contents were found. */
61 } csr_cs_ask_user_e;
62
63
64 /**
65  * @deprecated Deprecated since 7.5.
66  * @partner
67  * @brief Enumeration for the user response from popup.
68  * @since_tizen 3.0
69  */
70 typedef enum {
71         CSR_CS_USER_RESPONSE_USER_NOT_ASKED = 0x00, /**< No response from user. */
72         CSR_CS_USER_RESPONSE_REMOVE = 0x01, /**< A user decided to remove a detected malicious content and it was removed. */
73         CSR_CS_USER_RESPONSE_PROCESSING_ALLOWED = 0x02, /**< A user decided to process a detected malware. */
74         CSR_CS_USER_RESPONSE_PROCESSING_DISALLOWED = 0x03, /**< A user decided not to process a detected malware. */
75 } csr_cs_user_response_e;
76
77
78 /**
79  * @deprecated Deprecated since 7.5.
80  * @partner
81  * @brief Enumeration for the action types for the detected malware files.
82  * @since_tizen 3.0
83  */
84 typedef enum {
85         CSR_CS_ACTION_REMOVE = 0x00, /**< Remove the detected malware file. */
86         CSR_CS_ACTION_IGNORE = 0x01, /**< Ignore the detected malware file. */
87         CSR_CS_ACTION_UNIGNORE = 0x02 /**< Unignore the previously ignored file. */
88 } csr_cs_action_e;
89
90
91 /**
92  * @deprecated Deprecated since 7.5.
93  * @partner
94  * @brief Enumeration for maximum core usage during scanning.
95  * @since_tizen 3.0
96  */
97 typedef enum {
98         CSR_CS_CORE_USAGE_DEFAULT = 0x00, /**< Use default setting value. */
99         CSR_CS_CORE_USAGE_ALL = 0x01, /**< Use all cores during scanning. */
100         CSR_CS_CORE_USAGE_HALF = 0x02, /**< Use half cores during scanning. */
101         CSR_CS_CORE_USAGE_SINGLE = 0x03 /**< Use a single core during scanning. */
102 } csr_cs_core_usage_e;
103
104
105 /**
106  * @deprecated Deprecated since 7.5.
107  * @partner
108  * @brief Content screening APIs context handle.
109  * @since_tizen 3.0
110  */
111 typedef struct __csr_cs_context_s *csr_cs_context_h;
112
113
114 /**
115  * @deprecated Deprecated since 7.5.
116  * @partner
117  * @brief Detected malware handle.
118  * @since_tizen 3.0
119  */
120 typedef struct __csr_cs_malware_s *csr_cs_malware_h;
121
122
123 /**
124  * @deprecated Deprecated since 7.5.
125  * @partner
126  * @brief Detected malware list handle.
127  * @since_tizen 3.0
128  */
129 typedef struct __csr_cs_malware_list_s *csr_cs_malware_list_h;
130
131
132 /**
133  * @deprecated Deprecated since 7.5.
134  * @partner
135  * @brief Engine info handle.
136  * @since_tizen 3.0
137  */
138 typedef struct __csr_cs_engine_s *csr_cs_engine_h;
139
140
141 /**
142  * @deprecated Deprecated since 7.5.
143  * @partner
144  * @brief Called when each file scanning is done without malware.
145  * @since_tizen 3.0
146  * @remarks Only for asynchronous scan functions.
147  * @remarks Called for each file or application which is not detected malware.
148  * @param[in] file_path A path of the file scanned. It would be package path if it's in application
149  * @param[in] user_data A pointer of a user data. It's provided by client when calling asynchronous scanning method
150  * @see csr_cs_set_file_scanned_cb()
151  * @see csr_cs_scan_files_async()
152  * @see csr_cs_scan_dir_async()
153  * @see csr_cs_scan_dirs_async()
154  */
155 typedef void (*csr_cs_file_scanned_cb)(const char *file_path, void *user_data);
156
157
158 /**
159  * @deprecated Deprecated since 7.5.
160  * @partner
161  * @brief Called when each file scanning is done with malware.
162  * @since_tizen 3.0
163  * @remarks Only for asynchronous scan functions.
164  * @remarks Called for each file or application which is detected malware.
165  * @remarks @a malware will be released when a context is released using csr_cs_context_destroy().
166  * @param[in] malware The detected malware handle
167  * @param[in] user_data A pointer of a user data. It's provided by client when calling asynchronous scanning method
168  * @see csr_cs_set_detected_cb()
169  * @see csr_cs_scan_files_async()
170  * @see csr_cs_scan_dir_async()
171  * @see csr_cs_scan_dirs_async()
172  */
173 typedef void (*csr_cs_detected_cb)(csr_cs_malware_h malware, void *user_data);
174
175
176 /**
177  * @deprecated Deprecated since 7.5.
178  * @partner
179  * @brief Called when scanning is finished successfully.
180  * @since_tizen 3.0
181  * @remarks Only for asynchronous scan functions.
182  * @remarks Called only once at the end of scanning when success.
183  * @param[in] user_data A pointer of a user data. It's provided by client when calling asynchronous scanning method
184  * @see csr_cs_set_completed_cb()
185  * @see csr_cs_scan_files_async()
186  * @see csr_cs_scan_dir_async()
187  * @see csr_cs_scan_dirs_async()
188  */
189 typedef void (*csr_cs_completed_cb)(void *user_data);
190
191
192 /**
193  * @deprecated Deprecated since 7.5.
194  * @partner
195  * @brief Called when scanning is cancelled by csr_cs_cancel_scanning().
196  * @since_tizen 3.0
197  * @remarks Only for asynchronous scan functions.
198  * @remarks Called only once at the end of scanning by being cancelled.
199  * @param[in] user_data A pointer of a user data. It's provided by client when calling asynchronous scanning method
200  * @see csr_cs_set_cancelled_cb()
201  * @see csr_cs_cancel_scanning()
202  * @see csr_cs_scan_files_async()
203  * @see csr_cs_scan_dir_async()
204  * @see csr_cs_scan_dirs_async()
205  */
206 typedef void (*csr_cs_cancelled_cb)(void *user_data);
207
208
209 /**
210  * @deprecated Deprecated since 7.5.
211  * @partner
212  * @brief Called when scanning is stopped with an error.
213  * @details The following error codes can be delivered.\n
214  *          #CSR_ERROR_FILE_DO_NOT_EXIST,\n
215  *          #CSR_ERROR_SOCKET,\n
216  *          #CSR_ERROR_SERVER,\n
217  *          #CSR_ERROR_ENGINE_NOT_EXIST,\n
218  *          #CSR_ERROR_ENGINE_DISABLED,\n
219  *          #CSR_ERROR_ENGINE_NOT_ACTIVATED,\n
220  *          #CSR_ERROR_ENGINE_PERMISSION,\n
221  *          #CSR_ERROR_ENGINE_INTERNAL
222  * @since_tizen 3.0
223  * @remarks Only for asynchronous scan functions.
224  * @remarks Called only once at the end of scanning when failed with error.
225  * @param[in] error_code Error code of #csr_error_e defined in csr-error.h
226  * @param[in] user_data A pointer of a user data. It's provided by client when calling asynchronous scanning method
227  * @see csr_cs_set_error_cb()
228  * @see csr_cs_scan_files_async()
229  * @see csr_cs_scan_dir_async()
230  * @see csr_cs_scan_dirs_async()
231  */
232 typedef void (*csr_cs_error_cb)(int error_code, void *user_data);
233
234
235 /**
236  * @}
237  */
238
239
240 #ifdef __cplusplus
241 }
242 #endif
243
244
245 #endif