From 92553c34e336d7be04abf1684105b6c57d88fd6a Mon Sep 17 00:00:00 2001 From: "sooyeon.kim" Date: Wed, 31 May 2017 16:13:15 +0900 Subject: [PATCH] Change Exceptions and Properties and Add API level Change-Id: I2c8cc3ee3e78b0774b78bac9b0dcc739d77ee430 Signed-off-by: sooyeon.kim --- packaging/csapi-uix-tts.spec | 2 +- .../Tizen.Uix.Tts/DefaultVoiceChangedEventArgs.cs | 3 + .../Tizen.Uix.Tts/EngineChangedEventArgs.cs | 4 + .../Tizen.Uix.Tts/ErrorOccuredEventArgs.cs | 6 +- .../Tizen.Uix.Tts/ExceptionFactory.cs | 8 +- src/Tizen.Uix.Tts/Tizen.Uix.Tts/SpeedRange.cs | 4 + .../Tizen.Uix.Tts/StateChangedEventArgs.cs | 3 + src/Tizen.Uix.Tts/Tizen.Uix.Tts/SupportedVoice.cs | 2 + src/Tizen.Uix.Tts/Tizen.Uix.Tts/TtsClient.cs | 166 +++++++++++++-------- .../Tizen.Uix.Tts/UtteranceEventArgs.cs | 2 + 10 files changed, 130 insertions(+), 70 deletions(-) diff --git a/packaging/csapi-uix-tts.spec b/packaging/csapi-uix-tts.spec index fa35438..f7493f2 100755 --- a/packaging/csapi-uix-tts.spec +++ b/packaging/csapi-uix-tts.spec @@ -1,6 +1,6 @@ Name: csapi-uix-tts Summary: Tizen TTS Uix API for C# -Version: 1.0.2 +Version: 1.0.3 Release: 1 Group: Development/Libraries License: Apache-2.0 diff --git a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/DefaultVoiceChangedEventArgs.cs b/src/Tizen.Uix.Tts/Tizen.Uix.Tts/DefaultVoiceChangedEventArgs.cs index 2461733..6ece3cc 100755 --- a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/DefaultVoiceChangedEventArgs.cs +++ b/src/Tizen.Uix.Tts/Tizen.Uix.Tts/DefaultVoiceChangedEventArgs.cs @@ -20,6 +20,7 @@ namespace Tizen.Uix.Tts /// /// This Class holds information related to DefaultVoiceChanged Event /// + /// 3 public class DefaultVoiceChangedEventArgs { internal DefaultVoiceChangedEventArgs(string previousLanguage, int previousVoiceType, string currentLanguage, int currentVoiceType) @@ -31,6 +32,7 @@ namespace Tizen.Uix.Tts /// /// The Previous SupportedVoice /// + /// 3 public SupportedVoice Previous { get; @@ -40,6 +42,7 @@ namespace Tizen.Uix.Tts /// /// The current SupportedVoice /// + /// 3 public SupportedVoice Current { get; diff --git a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/EngineChangedEventArgs.cs b/src/Tizen.Uix.Tts/Tizen.Uix.Tts/EngineChangedEventArgs.cs index 78da32e..6419660 100755 --- a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/EngineChangedEventArgs.cs +++ b/src/Tizen.Uix.Tts/Tizen.Uix.Tts/EngineChangedEventArgs.cs @@ -22,6 +22,7 @@ namespace Tizen.Uix.Tts /// /// This class holds information related to Engine Changed Event /// + /// 3 public class EngineChangedEventArgs { internal EngineChangedEventArgs(string engineId, string language, int voiceType, bool needCredential) @@ -34,6 +35,7 @@ namespace Tizen.Uix.Tts /// /// Engine Id /// + /// 3 public string EngineId { get; @@ -43,6 +45,7 @@ namespace Tizen.Uix.Tts /// /// The necessity of credential /// + /// 3 public bool NeedCredential { get; @@ -52,6 +55,7 @@ namespace Tizen.Uix.Tts /// /// The supported voice /// + /// 3 public SupportedVoice VoiceType { get; diff --git a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/ErrorOccuredEventArgs.cs b/src/Tizen.Uix.Tts/Tizen.Uix.Tts/ErrorOccuredEventArgs.cs index 7916391..dd173dc 100755 --- a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/ErrorOccuredEventArgs.cs +++ b/src/Tizen.Uix.Tts/Tizen.Uix.Tts/ErrorOccuredEventArgs.cs @@ -23,6 +23,7 @@ namespace Tizen.Uix.Tts /// /// This class holds information related to the TTS ErrorOccured Event /// + /// 3 public class ErrorOccuredEventArgs { private IntPtr _handle; @@ -116,6 +117,7 @@ namespace Tizen.Uix.Tts /// /// The Utterance Id /// + /// 3 public int UtteranceId { get; @@ -125,6 +127,7 @@ namespace Tizen.Uix.Tts /// /// The Error Value /// + /// 3 public Error ErrorValue { get; @@ -134,10 +137,11 @@ namespace Tizen.Uix.Tts /// /// Gets the current error message. /// + /// 3 /// /// string error message /// - public string GetErrorMessage + public string ErrorMessage { get { diff --git a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/ExceptionFactory.cs b/src/Tizen.Uix.Tts/Tizen.Uix.Tts/ExceptionFactory.cs index dd05ab7..a29d9dd 100755 --- a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/ExceptionFactory.cs +++ b/src/Tizen.Uix.Tts/Tizen.Uix.Tts/ExceptionFactory.cs @@ -30,7 +30,7 @@ namespace Tizen.Uix.Tts { case TtsError.OutOfMemory: { - exp = new InvalidOperationException("Out Of Memory"); + exp = new OutOfMemoryException("Out Of Memory"); break; } @@ -48,7 +48,7 @@ namespace Tizen.Uix.Tts case TtsError.TimedOut: { - exp = new InvalidOperationException("No answer from the STT service"); + exp = new TimeoutException("No answer from the TTS service"); break; } @@ -60,13 +60,13 @@ namespace Tizen.Uix.Tts case TtsError.PermissionDenied: { - exp = new InvalidOperationException("Permission Denied"); + exp = new UnauthorizedAccessException("Permission Denied"); break; } case TtsError.NotSupported: { - exp = new InvalidOperationException("STT NOT supported"); + exp = new NotSupportedException("TTS NOT supported"); break; } diff --git a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/SpeedRange.cs b/src/Tizen.Uix.Tts/Tizen.Uix.Tts/SpeedRange.cs index 9911355..dbe1f68 100755 --- a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/SpeedRange.cs +++ b/src/Tizen.Uix.Tts/Tizen.Uix.Tts/SpeedRange.cs @@ -20,6 +20,7 @@ namespace Tizen.Uix.Tts /// /// This class holds the Speed Range Values /// + /// 3 public class SpeedRange { internal SpeedRange(int min, int normal, int max) @@ -32,6 +33,7 @@ namespace Tizen.Uix.Tts /// /// The Max Speed Range Value /// + /// 3 public int Max { get; @@ -41,6 +43,7 @@ namespace Tizen.Uix.Tts /// /// The Min Speed Range Value /// + /// 3 public int Min { get; @@ -50,6 +53,7 @@ namespace Tizen.Uix.Tts /// /// The Normal Speed Range Value /// + /// 3 public int Normal { get; diff --git a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/StateChangedEventArgs.cs b/src/Tizen.Uix.Tts/Tizen.Uix.Tts/StateChangedEventArgs.cs index 7c6bffa..ba1db04 100755 --- a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/StateChangedEventArgs.cs +++ b/src/Tizen.Uix.Tts/Tizen.Uix.Tts/StateChangedEventArgs.cs @@ -20,6 +20,7 @@ namespace Tizen.Uix.Tts /// /// This class holds information related to the TTS state change event /// + /// 3 public class StateChangedEventArgs { internal StateChangedEventArgs(State previous, State current) @@ -31,6 +32,7 @@ namespace Tizen.Uix.Tts /// /// A previous state /// + /// 3 public State Previous { get; @@ -40,6 +42,7 @@ namespace Tizen.Uix.Tts /// /// A current state /// + /// 3 public State Current { get; diff --git a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/SupportedVoice.cs b/src/Tizen.Uix.Tts/Tizen.Uix.Tts/SupportedVoice.cs index a79a1fd..eb6f75b 100755 --- a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/SupportedVoice.cs +++ b/src/Tizen.Uix.Tts/Tizen.Uix.Tts/SupportedVoice.cs @@ -20,6 +20,7 @@ namespace Tizen.Uix.Tts /// /// This Class holds information about the Supported Voices. /// + /// 3 public class SupportedVoice { internal SupportedVoice(string lang, int voiceType) @@ -55,6 +56,7 @@ namespace Tizen.Uix.Tts /// /// Language specified as an ISO 3166 alpha-2 two letter country-code followed by ISO 639-1 for the two-letter language code (for example, "ko_KR" for Korean, "en_US" for American English) /// + /// 3 public string Language { get; diff --git a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/TtsClient.cs b/src/Tizen.Uix.Tts/Tizen.Uix.Tts/TtsClient.cs index d91e54b..a8dedcc 100755 --- a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/TtsClient.cs +++ b/src/Tizen.Uix.Tts/Tizen.Uix.Tts/TtsClient.cs @@ -25,137 +25,166 @@ namespace Tizen.Uix.Tts /// /// Enumeration for States /// + /// 3 public enum State { /// /// Created atate /// + /// 3 Created = 0, /// /// Ready state /// + /// 3 Ready = 1, /// /// Playing state /// + /// 3 Playing = 2, /// /// Paused state /// + /// 3 Paused = 3, /// /// state Unavailable /// + /// 3 Unavailable }; /// /// Enumeration for TTS mode. /// + /// 3 public enum Mode { /// /// Default mode for normal application /// + /// 3 Default = 0, /// /// Notification mode /// + /// 3 Notification = 1, /// /// Accessibiliity mode /// + /// 3 ScreenReader = 2 }; /// /// Enum for Error values that can occur /// + /// 3 public enum Error { /// /// Successful, No error /// + /// 3 None, /// /// Out of Memory /// + /// 3 OutOfMemory, /// /// I/O error /// + /// 3 IoError, /// /// Invalid parameter /// + /// 3 InvalidParameter, /// /// No answer from the STT service /// + /// 3 TimedOut, /// /// Network is down /// + /// 3 OutOfNetwork, /// /// Permission denied /// + /// 3 PermissionDenied, /// /// STT NOT supported /// + /// 3 NotSupported, /// /// Invalid state /// + /// 3 InvalidState, /// /// Invalid Voice /// + /// 3 InvalidVoice, /// /// No available engine /// + /// 3 EngineNotFound, /// /// Operation failed /// + /// 3 OperationFailed, /// /// Audio policy blocked /// + /// 3 AudioPolicyBlocked }; /// /// Enumeration for Voice Types /// + /// 3 public enum Voice { /// /// Automatic Voice Type /// + /// 3 Auto, /// /// Male Voice /// + /// 3 Male, /// /// Female Voice /// + /// 3 Female, /// /// Child Voice Type /// + /// 3 Child }; @@ -163,6 +192,7 @@ namespace Tizen.Uix.Tts /// You can use Text-To-Speech (TTS) API's to read sound data transformed by the engine from input texts. /// Applications can add input-text to queue for reading continuously and control the player that can play, pause, and stop sound data synthesized from text. /// + /// 3 public class TtsClient : IDisposable { private IntPtr _handle; @@ -185,16 +215,17 @@ namespace Tizen.Uix.Tts /// /// Constructor to create a TTS instance. /// + /// 3 /// /// http://tizen.org/feature/speech.synthesis /// /// /// This Exception can be due to the following reaons - /// 1. Out Of Memory - /// 2. Operation Failed - /// 3. TTS Not Supported - /// 4. Engine Not Found + /// 1. Operation Failed + /// 2. Engine Not Found /// + /// This Exception can be due to Out Of Memory. + /// This Exception can be due to TTS Not Supported. public TtsClient() { IntPtr handle; @@ -211,6 +242,7 @@ namespace Tizen.Uix.Tts /// /// Event to be invoked when TTS state changes. /// + /// 3 public event EventHandler StateChanged { add @@ -254,6 +286,7 @@ namespace Tizen.Uix.Tts /// /// Event to be invoked when the utterance starts. /// + /// 3 public event EventHandler UtteranceStarted { add @@ -295,6 +328,7 @@ namespace Tizen.Uix.Tts /// /// Event to be invoked when the utterance completes. /// + /// 3 public event EventHandler UtteranceCompleted { add @@ -336,6 +370,7 @@ namespace Tizen.Uix.Tts /// /// Event to be invoked when an error occurs. /// + /// 3 public event EventHandler ErrorOccured { add @@ -378,6 +413,7 @@ namespace Tizen.Uix.Tts /// /// Event to be invoked when an error occurs. /// + /// 3 public event EventHandler DefaultVoiceChanged { add @@ -423,6 +459,7 @@ namespace Tizen.Uix.Tts /// /// Event to be invoked to detect engine change. /// + /// 3 public event EventHandler EngineChanged { add @@ -466,6 +503,7 @@ namespace Tizen.Uix.Tts /// /// Gets the default voice set by the user. /// + /// 3 /// /// Default voice in TTS /// @@ -495,6 +533,7 @@ namespace Tizen.Uix.Tts /// /// Gets the maximum byte size for text. /// + /// 3 /// /// Maximum byte size for text /// @@ -504,7 +543,7 @@ namespace Tizen.Uix.Tts ///
         /// The State should be Ready
         /// 
- public uint GetMaxTextSize + public uint MaxTextSize { get { @@ -528,13 +567,14 @@ namespace Tizen.Uix.Tts /// /// Gets the current TTS state. /// + /// 3 /// /// Current state of TTS /// /// /// Current TTS State value. /// - public State GetState + public State CurrentState { get { @@ -558,6 +598,7 @@ namespace Tizen.Uix.Tts /// /// The TTS Mode can be set using this property /// + /// 3 /// /// Current mode of TTS (default, screen-reader, notification) /// @@ -566,11 +607,11 @@ namespace Tizen.Uix.Tts /// /// /// This Exception can be due to the following reaons while setting the value - /// 1. Out Of Memory - /// 2. Operation Failed - /// 3. TTS Not Supported - /// 4. Engine Not Found + /// 1. Operation Failed + /// 2. Engine Not Found /// + /// This Exception can be due to Out Of Memory. + /// This Exception can be due to TTS Not Supported. ///
         /// State should be Created
         /// 
@@ -610,20 +651,16 @@ namespace Tizen.Uix.Tts /// /// Sets the app credential /// + /// 3 /// /// The credential string /// /// /// http://tizen.org/feature/speech.synthesis /// - /// - /// This Exception can be due to the following reaons - /// 1. TTS Not Supported - /// 2. Invalid State - /// - /// - /// This can happen if Improper value is provided while setting the value. - /// + /// This Exception can be due to Invalid State. + /// This Exception can be due to TTS Not Supported. + /// This can happen if Improper value is provided while setting the value. ///
         /// The State must be Created or Ready.
         /// 
@@ -643,14 +680,12 @@ namespace Tizen.Uix.Tts /// /// Connects to the TTS service asynchronously. /// + /// 3 /// /// http://tizen.org/feature/speech.synthesis /// - /// - /// This Exception can be due to the following reasons - /// 1. TTS Not Supported - /// 2. Invalid State - /// + /// This Exception can be due to Invalid State. + /// This Exception can be due to TTS Not Supported. ///
         /// The State must be Created.
         /// 
@@ -674,14 +709,12 @@ namespace Tizen.Uix.Tts /// /// Disconnects from the STT service. /// + /// 3 /// /// http://tizen.org/feature/speech.synthesis /// - /// - /// This Exception can be due to the following reasons - /// 1. TTS Not Supported - /// 2. Invalid State - /// + /// This Exception can be due to Invalid State. + /// This Exception can be due to TTS Not Supported. ///
         /// The State must be Ready.
         /// 
@@ -704,6 +737,7 @@ namespace Tizen.Uix.Tts /// /// Retrieves all supported voices of the current engine. /// + /// 3 /// /// list of SupportedVoice. /// @@ -712,10 +746,10 @@ namespace Tizen.Uix.Tts /// /// /// This Exception can be due to the following reasons - /// 1. TTS Not Supported - /// 2. Engine Not Found. - /// 3. Operation Failed. + /// 1. Engine Not Found. + /// 2. Operation Failed. /// + /// This Exception can be due to TTS Not Supported. public IEnumerable GetSupportedVoices() { List voicesList = new List(); @@ -743,6 +777,7 @@ namespace Tizen.Uix.Tts /// /// Gets the private data from tts engine. /// + /// 3 /// /// The key string /// @@ -754,11 +789,11 @@ namespace Tizen.Uix.Tts /// /// /// This Exception can be due to the following reaons - /// 1. TTS Not Supported - /// 2. Invalid State - /// 3. Engine Not found - /// 4. Operation Failure + /// 1. Invalid State + /// 2. Engine Not found + /// 3. Operation Failure /// + /// This Exception can be due to TTS Not Supported. ///
         /// The State must be Ready.
         /// 
@@ -782,6 +817,7 @@ namespace Tizen.Uix.Tts /// /// Sets the private data to tts engine. /// + /// 3 /// /// The key string /// @@ -793,14 +829,12 @@ namespace Tizen.Uix.Tts /// /// /// This Exception can be due to the following reaons - /// 1. TTS Not Supported - /// 2. Invalid State - /// 3. Engine Not found - /// 4. Operation Failure - /// - /// - /// This can happen if Improper value is provided while setting the value. + /// 1. Invalid State + /// 2. Engine Not found + /// 3. Operation Failure /// + /// This Exception can be due to TTS Not Supported. + /// This can happen if Improper value is provided while setting the value. ///
         /// The State must be Ready.
         /// 
@@ -820,6 +854,7 @@ namespace Tizen.Uix.Tts /// /// Gets the speed range. /// + /// 3 /// /// The SpeedRange value /// @@ -828,10 +863,10 @@ namespace Tizen.Uix.Tts /// /// /// This Exception can be due to the following reaons - /// 1. TTS Not Supported - /// 2. Invalid State - /// 3. Operation Failure + /// 1. Invalid State + /// 2. Operation Failure /// + /// This Exception can be due to TTS Not Supported. ///
         /// The State must be Created.
         /// 
@@ -855,6 +890,7 @@ namespace Tizen.Uix.Tts /// /// Adds a text to the queue. /// + /// 3 /// /// Locale MUST be set for utf8 text validation check. /// @@ -878,15 +914,13 @@ namespace Tizen.Uix.Tts /// /// /// This Exception can be due to the following reaons - /// 1. TTS Not Supported - /// 2. Invalid State - /// 3. Operation Failure - /// 4. Invalid Voice - /// 5. Permission Denied - /// - /// - /// This can happen if Improper value is provided. + /// 1. Invalid State + /// 2. Operation Failure + /// 3. Invalid Voice /// + /// This Exception can be due to TTS Not Supported. + /// This Exception can be due to Permission Denied. + /// This can happen if Improper value is provided. ///
         /// The State must be Ready or Playing or Paused.
         /// 
@@ -910,17 +944,18 @@ namespace Tizen.Uix.Tts /// /// Starts synthesizing voice from the text and plays the synthesized audio data. /// + /// 3 /// /// http://tizen.org/feature/speech.synthesis /// /// /// This Exception can be due to the following reaons - /// 1. TTS Not Supported - /// 2. Invalid State - /// 3. Operation Failure - /// 4. Out of Network - /// 5. Permission Denied + /// 1. Invalid State + /// 2. Operation Failure + /// 3. Out of Network /// + /// This Exception can be due to TTS Not Supported. + /// This Exception can be due to Permission Denied. ///
         /// The State must be Ready or Paused.
         /// 
@@ -943,15 +978,16 @@ namespace Tizen.Uix.Tts /// /// Stops playing the utterance and clears the queue. /// + /// 3 /// /// http://tizen.org/feature/speech.synthesis /// /// /// This Exception can be due to the following reaons - /// 1. TTS Not Supported - /// 2. Invalid State - /// 3. Operation Failure + /// 1. Invalid State + /// 2. Operation Failure /// + /// This Exception can be due to TTS Not Supported. ///
         /// The State must be Ready or Playing or Paused.
         /// 
@@ -975,15 +1011,16 @@ namespace Tizen.Uix.Tts /// /// Pauses the currently playing utterance. /// + /// 3 /// /// http://tizen.org/feature/speech.synthesis /// /// /// This Exception can be due to the following reaons - /// 1. TTS Not Supported - /// 2. Invalid State - /// 3. Operation Failure + /// 1. Invalid State + /// 2. Operation Failure /// + /// This Exception can be due to TTS Not Supported. ///
         /// The State must be Playing.
         /// 
@@ -1006,6 +1043,7 @@ namespace Tizen.Uix.Tts /// /// Method to release resources /// + /// 3 public void Dispose() { Dispose(true); diff --git a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/UtteranceEventArgs.cs b/src/Tizen.Uix.Tts/Tizen.Uix.Tts/UtteranceEventArgs.cs index afe841a..ba06b1d 100755 --- a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/UtteranceEventArgs.cs +++ b/src/Tizen.Uix.Tts/Tizen.Uix.Tts/UtteranceEventArgs.cs @@ -20,6 +20,7 @@ namespace Tizen.Uix.Tts /// /// This Class hold information related to UtteranceStared and UtteranceCompleted Events /// + /// 3 public class UtteranceEventArgs { internal UtteranceEventArgs(int uttId) @@ -30,6 +31,7 @@ namespace Tizen.Uix.Tts /// /// The utterance ID /// + /// 3 public int UtteranceId { get; -- 2.7.4