#define __CSR_CONTENT_SCREENING_API_H_
#include <time.h>
-#include <stdbool.h>
#include <stddef.h>
#include <csr-content-screening-types.h>
/**
+ * @partner
* @brief Initializes and returns a Content Screening API handle.
*
* @details A Content Screening API handle (or CSR CS handle) is obtained by this method.
*
* @since_tizen 3.0
*
- * @remarks The @a handle should be released using csr_cs_context_destroy().
+ * @remarks @a handle should be released using csr_cs_context_destroy().
* @remarks Multiple handles can be obtained.
*
* @param[out] handle A pointer of CSR CS context handle.
int csr_cs_context_create(csr_cs_context_h *handle);
/**
+ * @partner
* @brief Releases all system resources associated with a Content Screening API handle.
*
* @since_tizen 3.0
int csr_cs_context_destroy(csr_cs_context_h handle);
/**
+ * @partner
* @brief Sets a popup option for malware detected.
*
- * @details If #CSR_CS_ASK_USER is set, a popup will be prompted to a user when a malware
- * is detected. If #CSR_CS_NOT_ASK_USER is set which is default value, no popup
+ * @details If #CSR_CS_ASK_USER_YES is set, a popup will be prompted to a user when a malware
+ * is detected. If #CSR_CS_ASK_USER_NO is set which is default value, no popup
* will be prompted even if a malware is detected. User can allow, disallow and
* remove detected malware by popup. Selection can be different between malware's
* severity.
*
* @since_tizen 3.0
*
- * @remarks This option is disabled(#CSR_CS_NOT_ASK_USER) as a default.
+ * @remarks This option is disabled(#CSR_CS_ASK_USER_NO) as a default.
*
* @param[in] handle CSR CS context handle returned by csr_cs_context_create().
* @param[in] ask_user Popup option to set or unset.
int csr_cs_set_ask_user(csr_cs_context_h handle, csr_cs_ask_user_e ask_user);
/**
+ * @partner
* @brief Sets a popup message of a client in case that a malware is detected.
*
* @details Default message is "Malware which may harm your device is detected.".
int csr_cs_set_popup_message(csr_cs_context_h handle, const char *message);
/**
+ * @partner
* @brief Sets a maximum core usage during scanning.
*
* @since_tizen 3.0
*
- * @remarks If a core usage is not set, #CSR_CS_USE_CORE_DEFAULT will be used.
+ * @remarks If a core usage is not set, #CSR_CS_CORE_USAGE_DEFAULT will be used.
*
* @param[in] handle CSR CS context handle returned by csr_cs_context_create().
* @param[in] usage A maximum core usage during scanning.
int csr_cs_set_core_usage(csr_cs_context_h handle, csr_cs_core_usage_e usage);
/**
+ * @partner
* @brief Sets a scan on cloud option.
*
* @since_tizen 3.0
*
+ * @remarks Scan on cloud option is turned off as a default.
* @remarks If an engine does not support "scanning on cloud", this option is silently
* ignored.
*
- * @param[in] handle CSR CS context handle returned by csr_cs_context_create().
+ * @param[in] handle CSR CS context handle returned by csr_cs_context_create().
+ * @param[int] scan_on_cloud Flag to turn on(#true) or off(#false) of scanning on cloud option.
*
* @return #CSR_ERROR_NONE on success, otherwise a negative error value
*
* @see csr_cs_context_create()
* @see csr_cs_context_destroy()
*/
-int csr_cs_set_scan_on_cloud(csr_cs_context_h handle);
+int csr_cs_set_scan_on_cloud(csr_cs_context_h handle, bool scan_on_cloud);
/**
+ * @partner
* @brief Scans a data buffer for malware.
*
* @details @a malware result of this method is not available for being judged by
* @privilege %http://tizen.org/privilege/antivirus.scan
*
* @remarks Scan data synchronously.
- * @remarks The @a malware will be released when @a handle is released using
+ * @remarks @a malware will be released when @a handle is released using
* csr_cs_context_destroy().
+ * @remarks If multiple malwares exists in @a data,
+ * the malware with the highest severity will be returned.
*
* @param[in] handle CSR CS context handle returned by csr_cs_context_create().
* @param[in] data A scan target data.
csr_cs_malware_h *malware);
/**
+ * @partner
* @brief Scans a file specified by file path for malware.
*
* @since_tizen 3.0
* @privilege %http://tizen.org/privilege/antivirus.scan
*
* @remarks Scan file synchronously.
- * @remarks The @a malware will be released when @a handle is released using
+ * @remarks @a malware will be released when @a handle is released using
* csr_cs_context_destroy().
+ * @remarks If multiple malwares exists in a file,
+ * the malware with the highest severity will be returned.
*
* @param[in] handle CSR CS context handle returned by csr_cs_context_create().
* @param[in] file_path A path of scan target file.
csr_cs_malware_h *malware);
/**
+ * @partner
* @brief Sets a callback function for the case that a file scan is completed.
*
* @since_tizen 3.0
int csr_cs_set_file_scanned_cb(csr_cs_context_h handle, csr_cs_file_scanned_cb callback);
/**
+ * @partner
* @brief Sets a callback function for detection of a malware.
*
* @since_tizen 3.0
int csr_cs_set_detected_cb(csr_cs_context_h handle, csr_cs_detected_cb callback);
/**
+ * @partner
* @brief Sets a callback function for scanning completed without an error.
*
* @since_tizen 3.0
int csr_cs_set_completed_cb(csr_cs_context_h handle, csr_cs_completed_cb callback);
/**
+ * @partner
* @brief Sets a callback function for scanning cancelled.
*
* @since_tizen 3.0
int csr_cs_set_cancelled_cb(csr_cs_context_h handle, csr_cs_cancelled_cb callback);
/**
+ * @partner
* @brief Sets a callback function for scanning stopped with an error.
*
* @since_tizen 3.0
int csr_cs_set_error_cb(csr_cs_context_h handle, csr_cs_error_cb callback);
/**
+ * @partner
* @brief Scan files specified by an array of file paths for malware.
*
* @details If scanning of the single file is done without detected malware,
* @remarks The caller should set callback functions before call this method.
* @remarks Detected malware which is provided to the callback will be released when
* @a handle is released using csr_cs_context_destroy().
+ * @remarks If multiple malwares exists in a file, the malware with the highest
+ * severity will be returned for the file via csr_cs_set_detected_cb().
*
* @param[in] handle CSR CS context handle returned by csr_cs_context_create().
* @param[in] file_paths An array of scan target files.
* @retval #CSR_ERROR_INVALID_PARAMETER @a file_paths is invalid
* @retval #CSR_ERROR_PERMISSION_DENIED Access denied
* @retval #CSR_ERROR_NOT_SUPPORTED Device needed to run API is not supported
+ * @retval #CSR_ERROR_BUSY Busy for processing another request
* @retval #CSR_ERROR_FILE_DO_NOT_EXIST File not found
* @retval #CSR_ERROR_SOCKET Socket error between client and server
* @retval #CSR_ERROR_SERVER Server has been failed for some reason
size_t count, void *user_data);
/**
+ * @partner
* @brief Scans a directory specified by directory path for malware.
*
* @details If scanning of the single file is done without detected malware,
* @remarks The caller should set callback functions before calls this method.
* @remarks Detected malware which is provided to the callback will be released when
* @a handle is released using csr_cs_context_destroy().
+ * @remarks If multiple malwares exists in a file, the malware with the highest
+ * severity will be returned for the file via csr_cs_set_detected_cb().
*
* @param[in] handle CSR CS context handle returned by csr_cs_context_create().
* @param[in] dir_path A path of scan target directory.
* @retval #CSR_ERROR_INVALID_PARAMETER @a dir_path is invalid
* @retval #CSR_ERROR_PERMISSION_DENIED Access denied
* @retval #CSR_ERROR_NOT_SUPPORTED Device needed to run API is not supported
+ * @retval #CSR_ERROR_BUSY Busy for processing another request
* @retval #CSR_ERROR_FILE_DO_NOT_EXIST File not found
* @retval #CSR_ERROR_FILE_SYSTEM File type is invalid. It should be directory
* @retval #CSR_ERROR_SOCKET Socket error between client and server
int csr_cs_scan_dir_async(csr_cs_context_h handle, const char *dir_path, void *user_data);
/**
+ * @partner
* @brief Scan directories specified by an array of directory paths for malware.
*
* @details If scanning of the single file is done without detected malware,
* @remarks The caller should set callback functions before calls this method.
* @remarks Detected malware which is provided to the callback will be released when
* @a handle is released using csr_cs_context_destroy().
+ * @remarks If multiple malwares exists in a file, the malware with the highest
+ * severity will be returned for the file via csr_cs_set_detected_cb().
*
* @param[in] handle CSR CS context handle returned by csr_cs_context_create().
* @param[in] dir_paths An array of scan target directories.
* @retval #CSR_ERROR_INVALID_PARAMETER @a dir_paths is invalid
* @retval #CSR_ERROR_PERMISSION_DENIED Access denied
* @retval #CSR_ERROR_NOT_SUPPORTED Device needed to run API is not supported
+ * @retval #CSR_ERROR_BUSY Busy for processing another request
* @retval #CSR_ERROR_FILE_DO_NOT_EXIST File not found
* @retval #CSR_ERROR_FILE_SYSTEM File type is invalid. It should be directory
* @retval #CSR_ERROR_SOCKET Socket error between client and server
/**
+ * @partner
* @brief Cancels a running scanning task, asynchronously.
*
* @since_tizen 3.0
/**
+ * @partner
* @brief Extracts the severity of a detected malware from the detected malware handle.
*
* @since_tizen 3.0
csr_cs_severity_level_e *severity);
/**
+ * @partner
* @brief Extracts the name of a detected malware from the detected malware handle.
*
* @since_tizen 3.0
*
- * @remarks The @a name must be released using free().
+ * @remarks @a name must be released using free().
*
* @param[in] malware A detected malware handle.
* @param[out] name A pointer of the name of a detected malware.
int csr_cs_malware_get_name(csr_cs_malware_h malware, char **name);
/**
+ * @partner
* @brief Extracts an url that contains detailed information on vendor's web site from
* the detected malware handle.
*
* @since_tizen 3.0
*
- * @remarks The @a detailed_url must be released using free().
+ * @remarks @a detailed_url must be released using free().
*
* @param[in] malware A detected malware handle.
* @param[out] detailed_url A pointer of an url that contains detailed information on
int csr_cs_malware_get_detailed_url(csr_cs_malware_h malware, char **detailed_url);
/**
+ * @partner
* @brief Extracts the time stamp when a malware is detected from the detected malware
* handle.
*
int csr_cs_malware_get_timestamp(csr_cs_malware_h malware, time_t *timestamp);
/**
+ * @partner
* @brief Extracts the file name where a malware is detected from the detected malware
* handle.
*
* @since_tizen 3.0
*
- * @remarks The @a file_name must be released using free().
+ * @remarks @a file_name must be released using free().
*
* @param[in] malware A detected malware handle.
* @param[out] file_name A pointer of the file name where a malware is detected. The
int csr_cs_malware_get_file_name(csr_cs_malware_h malware, char **file_name);
/**
+ * @partner
* @brief Extracts a user response of a popup from the detected malware handle.
*
* @since_tizen 3.0
csr_cs_user_response_e *response);
/**
+ * @partner
* @brief Checks if a malware was detected in an application or in a file.
*
* @since_tizen 3.0
int csr_cs_malware_is_app(csr_cs_malware_h malware, bool *is_app);
/**
+ * @partner
* @brief Extracts the package id of an application where a malware is detected from
* detected malware handle.
*
* @since_tizen 3.0
*
- * @remarks The @a pkg_id must be released using free().
+ * @remarks @a pkg_id must be released using free().
*
* @param[in] malware A detected malware handle.
* @param[out] pkg_id A pointer of the package id where a malware is detected.
int csr_cs_malware_get_pkg_id(csr_cs_malware_h malware, char **pkg_id);
/**
+ * @platform
* @brief Judges how a detected malware file is handled.
*
* @details Detected malware will removed by #CSR_CS_ACTION_REMOVE action. File or
/**
+ * @partner
* @brief Gets information on a detected malware file specified by file path.
*
* @since_tizen 3.0
* @privlevel partner
* @privilege %http://tizen.org/privilege/antivirus.scan
*
- * @remarks The @a malware will be released when @a handle is destroyed.
+ * @remarks @a malware will be released when @a handle is destroyed.
* @remarks @a file_path will be null if it's result of csr_cs_scan_data().
*
* @param[in] handle CSR CS context handle returned by csr_cs_context_create().
csr_cs_malware_h *malware);
/**
+ * @partner
* @brief Gets information on a detected malware files specified by directory path.
*
* @since_tizen 3.0
* @privlevel partner
* @privilege %http://tizen.org/privilege/antivirus.scan
*
- * @remarks The @a list will be released when @a handle is destroyed.
+ * @remarks @a list will be released when @a handle is destroyed.
*
* @param[in] handle CSR CS context handle returned by csr_cs_context_create().
* @param[in] dir_paths A directory path where detected malware files exists.
size_t *list_count);
/**
+ * @partner
* @brief Gets information on a ignored malware file specified by file path.
*
* @since_tizen 3.0
* @privlevel partner
* @privilege %http://tizen.org/privilege/antivirus.scan
*
- * @remarks The @a malware will be released when @a handle is destroyed.
+ * @remarks @a malware will be released when @a handle is destroyed.
*
* @param[in] handle CSR CS context handle returned by csr_cs_context_create().
* @param[in] file_path A path of a ignored malware file.
csr_cs_malware_h *malware);
/**
+ * @partner
* @brief Gets information on a ignored malware files specified by directory path.
*
* @since_tizen 3.0
* @privlevel partner
* @privilege %http://tizen.org/privilege/antivirus.scan
*
- * @remarks The @a list will be released when @a handle is destroyed.
+ * @remarks @a list will be released when @a handle is destroyed.
*
* @param[in] handle CSR CS context handle returned by csr_cs_context_create().
* @param[in] dir_paths A directory path where ignored malware files exists.
size_t *list_count);
/**
+ * @partner
* @brief Extracts the detected malware handle from the detected malware list handle.
*
* @since_tizen 3.0
*
+ * @remarks @a malware will be released when a context is released using
+ * csr_cs_context_destroy().
+ *
* @param[in] list A detected malware list handle returned by
* csr_cs_get_detected_malwares() or
* csr_cs_get_ignored_malwares().