Fix bugs
[platform/core/uifw/stt.git] / server / sttp.h
index 9d9b0c1..72366b1 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
@@ -43,7 +43,9 @@ typedef enum {
        STTP_ERROR_INVALID_LANGUAGE             = TIZEN_ERROR_STT | 0x02,       /**< Invalid language */
        STTP_ERROR_ENGINE_NOT_FOUND             = TIZEN_ERROR_STT | 0x03,       /**< No available engine  */
        STTP_ERROR_OPERATION_FAILED             = TIZEN_ERROR_STT | 0x04,       /**< Operation failed  */
-       STTP_ERROR_NOT_SUPPORTED_FEATURE        = TIZEN_ERROR_STT | 0x05        /**< Not supported feature of current engine */
+       STTP_ERROR_NOT_SUPPORTED_FEATURE        = TIZEN_ERROR_STT | 0x05,       /**< Not supported feature of current engine */
+       STTP_ERROR_NO_SPEECH                    = TIZEN_ERROR_STT | 0x06,       /**< No speech while recording */
+       STTP_ERROR_RECORDING_TIMED_OUT          = TIZEN_ERROR_STT | 0x10        /**< Recording timed out */
 }sttp_error_e;
 
 /**
@@ -356,6 +358,7 @@ typedef int (*sttpe_foreach_result_time)(void* time_info, sttpe_result_time_cb c
 * @retval #STTP_ERROR_INVALID_LANGUAGE Invalid language
 * @retval #STTP_ERROR_OPERATION_FAILED Operation failed
 * @retval #STTP_ERROR_OUT_OF_NETWORK Out of network
+* @retval #STTP_ERROR_PERMISSION_DENIED Permission denied
 *
 * @pre The engine is not in recognition processing.
 *
@@ -458,6 +461,38 @@ typedef int (*sttpe_start_file)(const char* language, const char* type, const ch
 typedef int (*sttpe_cancel_file)(void);
 
 /**
+* @brief Set private data.
+* @since_tizen 3.0
+*
+* @param[in] key Key field of private data.
+* @param[in] data Data field of private data.
+*
+* @return 0 on success, otherwise a negative error value
+* @retval #STTP_ERROR_NONE Successful
+* @retval #STTP_ERROR_INVALID_PARAMETER Invalid parameter
+* @retval #STTP_ERROR_OPERATION_FAILED Operation failed
+*
+* @see sttpe_get_private_data()
+*/
+typedef int (* sttpe_set_private_data)(const char* key, const char* data);
+
+/**
+* @brief Get private data.
+* @since_tizen 3.0
+*
+* @param[out] key Key field of private data.
+* @param[out] data Data field of private data.
+*
+* @return 0 on success, otherwise a negative error value
+* @retval #STTP_ERROR_NONE Successful
+* @retval #STTP_ERROR_INVALID_PARAMETER Invalid parameter
+* @retval #STTP_ERROR_OPERATION_FAILED Operation failed
+*
+* @see sttpe_set_private_data()
+*/
+typedef int (* sttpe_get_private_data)(const char* key, char** data);
+
+/**
 * @brief A structure of the engine functions.
 */
 typedef struct {
@@ -491,6 +526,10 @@ typedef struct {
        /* Control file recognition */
        sttpe_start_file                start_file;             /**< Start recognition */
        sttpe_cancel_file               cancel_file;            /**< Cancel recognition */
+
+       /* Set/Get private data */
+       sttpe_set_private_data          set_private_data;       /**< Set private data */
+       sttpe_get_private_data          get_private_data;       /**< Get private data */
 } sttpe_funcs_s;
 
 /**