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 static Interop.Stt;
21 namespace Tizen.Uix.Stt
24 /// This class holds information related to the STT ErrorOccurred Event
26 /// <since_tizen> 3 </since_tizen>
27 public class ErrorOccurredEventArgs
29 private IntPtr _handle;
31 internal ErrorOccurredEventArgs(IntPtr handle, Interop.Stt.SttError error)
33 this._handle = handle;
36 case Interop.Stt.SttError.None:
38 ErrorValue = Error.None;
42 case Interop.Stt.SttError.OutOfMemory:
44 ErrorValue = Error.OutOfMemory;
48 case Interop.Stt.SttError.IoError:
50 ErrorValue = Error.IoError;
54 case Interop.Stt.SttError.InvalidParameter:
56 ErrorValue = Error.InvalidParameter;
60 case Interop.Stt.SttError.TimedOut:
62 ErrorValue = Error.TimedOut;
66 case Interop.Stt.SttError.RecorderBusy:
68 ErrorValue = Error.RecorderBusy;
72 case Interop.Stt.SttError.OutOfNetwork:
74 ErrorValue = Error.OutOfNetwork;
78 case Interop.Stt.SttError.PermissionDenied:
80 ErrorValue = Error.PermissionDenied;
84 case Interop.Stt.SttError.NotSupported:
86 ErrorValue = Error.NotSupported;
90 case Interop.Stt.SttError.InvalidState:
92 ErrorValue = Error.InvalidState;
96 case Interop.Stt.SttError.InvalidLanguage:
98 ErrorValue = Error.InvalidLanguage;
102 case Interop.Stt.SttError.EngineNotFound:
104 ErrorValue = Error.EngineNotFound;
108 case Interop.Stt.SttError.OperationFailed:
110 ErrorValue = Error.OperationFailed;
114 case Interop.Stt.SttError.NotSupportedFeature:
116 ErrorValue = Error.NotSupportedFeature;
120 case Interop.Stt.SttError.RecordingTimedOut:
122 ErrorValue = Error.RecordingTimedOut;
126 case Interop.Stt.SttError.NoSpeech:
128 ErrorValue = Error.NoSpeech;
132 case Interop.Stt.SttError.InProgressToReady:
134 ErrorValue = Error.InProgressToReady;
138 case Interop.Stt.SttError.InProgressToRecording:
140 ErrorValue = Error.InProgressToRecording;
144 case Interop.Stt.SttError.InProgressToProcessing:
146 ErrorValue = Error.InProgressToProcessing;
150 case Interop.Stt.SttError.ServiceReset:
152 ErrorValue = Error.ServiceReset;
162 /// <since_tizen> 3 </since_tizen>
163 public Error ErrorValue
170 /// Gets the current error message.
172 /// <since_tizen> 3 </since_tizen>
174 /// string error message
176 public string ErrorMessage
180 string errorMesage = "";
181 SttError error = SttGetErrorMessage(_handle, out errorMesage);
182 if (error != SttError.None)
184 Log.Error(LogTag, "GetErrorMessage Failed with error " + error);