2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 using System.Collections.Generic;
20 using System.Runtime.InteropServices;
21 using static Interop.Stt;
22 using static Tizen.Uix.Stt.ResultTime;
24 namespace Tizen.Uix.Stt
27 /// The recognition result from the engine.
29 public class RecognitionResultEventArgs
31 private ResultEvent _result;
32 private List<string> _data = new List<string>();
33 private ResultMessage _msg;
34 private int _dataCount;
36 internal RecognitionResultEventArgs(ResultEvent e, IntPtr data, int count, string msg)
41 case "stt.result.message.none":
43 _msg = ResultMessage.None;
47 case "stt.result.message.error.too.soon":
49 _msg = ResultMessage.TooSoon;
53 case "stt.result.message.error.too.short":
55 _msg = ResultMessage.TooShort;
59 case "stt.result.message.error.too.long":
61 _msg = ResultMessage.TooLong;
65 case "stt.result.message.error.too.quiet":
67 _msg = ResultMessage.TooQuiet;
71 case "stt.result.message.error.too.loud":
73 _msg = ResultMessage.TooLoud;
77 case "stt.result.message.error.too.fast":
79 _msg = ResultMessage.TooFast;
85 this._dataCount = count;
90 IntPtr[] dataArray = new IntPtr[count];
91 Marshal.Copy(data, dataArray, 0, count);
92 foreach (IntPtr handle in dataArray)
94 string info = Marshal.PtrToStringAnsi(handle);
103 public ResultEvent Result
114 public IEnumerable<string> Data
123 /// Returns the Result text count.
136 public ResultMessage Message