sync codes to 2.4 spin
[platform/core/uifw/tts.git] / server / ttsd_data.h
index a30ab5e..8039e9e 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved 
+*  Copyright (c) 2011-2014 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
 #ifndef __TTSD_DATA_H_
 #define __TTSD_DATA_H_
 
-#include <vector>
 #include "ttsp.h"
 
-using namespace std;
-
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -33,11 +30,11 @@ typedef enum {
 
 typedef struct 
 {
-       int                     utt_id; 
-       char*                   text;
-       char*                   lang;
-       ttsp_voice_type_e       vctype;
-       ttsp_speed_e            speed;
+       int     utt_id; 
+       char*   text;
+       char*   lang;
+       int     vctype;
+       int     speed;
 }speak_data_s;
 
 typedef struct 
@@ -52,20 +49,7 @@ typedef struct
        int                     channels;
 }sound_data_s;
 
-typedef struct 
-{
-       int             pid;
-       int             uid;
-       int             utt_id_stopped;
-       app_state_e     state;
-       
-       std::vector<speak_data_s> m_speak_data; 
-       std::vector<sound_data_s> m_wav_data;
-}app_data_s;
-
-typedef struct {
-       int pid;
-} setting_app_data_s;
+typedef void (* ttsd_used_voice_cb)(const char* lang, int type);
 
 int ttsd_data_new_client(int pid, int uid);
 
@@ -77,24 +61,32 @@ int ttsd_data_get_client_count();
 
 int ttsd_data_get_pid(int uid);
 
-int ttsd_data_add_speak_data(int uid, speak_data_s data);
+/* speak data */
+int ttsd_data_add_speak_data(int uid, speak_data_s* data);
 
-int ttsd_data_get_speak_data(int uid, speak_data_s* data);
+int ttsd_data_get_speak_data(int uid, speak_data_s** data);
 
 int ttsd_data_get_speak_data_size(int uid);
 
-int ttsd_data_add_sound_data(int uid, sound_data_s data);
+/* sound data */
+int ttsd_data_add_sound_data(int uid, sound_data_s* data);
 
-int ttsd_data_get_sound_data(int uid, sound_data_s* data);
+int ttsd_data_get_sound_data(int uid, sound_data_s** data);
 
 int ttsd_data_get_sound_data_size(int uid);
 
 int ttsd_data_clear_data(int uid);
 
+
+int ttsd_data_set_used_voice(int uid, const char* lang, int type);
+
+int ttsd_data_reset_used_voice(int uid, ttsd_used_voice_cb callback);
+
 int ttsd_data_get_client_state(int pid, app_state_e* state);
 
 int ttsd_data_set_client_state(int pid, app_state_e state);
 
+
 int ttsd_data_get_current_playing();
 
 typedef bool(*ttsd_data_get_client_cb)(int pid, int uid, app_state_e state, void* user_data);
@@ -103,14 +95,11 @@ int ttsd_data_foreach_clients(ttsd_data_get_client_cb callback, void* user_data)
 
 bool ttsd_data_is_uttid_valid(int uid, int uttid);
 
-int ttsd_data_is_current_playing();
-
-
-int ttsd_setting_data_add(int pid);
+int ttsd_data_get_same_pid_client_count(int pid);
 
-int ttsd_setting_data_delete(int pid);
+/* For error handing */
+int ttsd_data_save_error_log(int uid, FILE* fp);
 
-int ttsd_setting_data_is_setting(int pid);
 
 #ifdef __cplusplus
 }