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.Tts;
21 namespace Tizen.Uix.Tts
24 /// This class holds information related to the TTS ErrorOccurred event.
26 /// <since_tizen> 3 </since_tizen>
27 public class ErrorOccurredEventArgs
29 private IntPtr _handle;
31 internal ErrorOccurredEventArgs(IntPtr handle, int utteranceId, Interop.Tts.TtsError error)
33 this._handle = handle;
34 this.UtteranceId = utteranceId;
37 case Interop.Tts.TtsError.None:
39 ErrorValue = Error.None;
43 case Interop.Tts.TtsError.OutOfMemory:
45 ErrorValue = Error.OutOfMemory;
49 case Interop.Tts.TtsError.IoError:
51 ErrorValue = Error.IoError;
55 case Interop.Tts.TtsError.InvalidParameter:
57 ErrorValue = Error.InvalidParameter;
61 case Interop.Tts.TtsError.TimedOut:
63 ErrorValue = Error.TimedOut;
67 case Interop.Tts.TtsError.OutOfNetwork:
69 ErrorValue = Error.OutOfNetwork;
73 case Interop.Tts.TtsError.PermissionDenied:
75 ErrorValue = Error.PermissionDenied;
79 case Interop.Tts.TtsError.NotSupported:
81 ErrorValue = Error.NotSupported;
85 case Interop.Tts.TtsError.InvalidState:
87 ErrorValue = Error.InvalidState;
91 case Interop.Tts.TtsError.InvalidVoice:
93 ErrorValue = Error.InvalidVoice;
97 case Interop.Tts.TtsError.EngineNotFound:
99 ErrorValue = Error.EngineNotFound;
103 case Interop.Tts.TtsError.OperationFailed:
105 ErrorValue = Error.OperationFailed;
109 case Interop.Tts.TtsError.AudioPolicyBlocked:
111 ErrorValue = Error.AudioPolicyBlocked;
118 /// The utterance ID.
120 /// <since_tizen> 3 </since_tizen>
121 public int UtteranceId
130 /// <since_tizen> 3 </since_tizen>
131 public Error ErrorValue
138 /// Gets the current error message.
140 /// <since_tizen> 3 </since_tizen>
142 /// String error message.
144 public string ErrorMessage
148 string errorMesage = "";
149 TtsError error = TtsGetErrorMessage(_handle, out errorMesage);
150 if (error != TtsError.None)
152 Log.Error(LogTag, "GetErrorMessage Failed with error " + error);