OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_ERROR_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_ERROR_H_ |
6 #define CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_ERROR_H_ | 6 #define CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_ERROR_H_ |
7 | 7 |
8 namespace content { | 8 namespace content { |
9 | 9 |
10 // A Java counterpart will be generated for this enum. | |
11 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.content_public.common | |
12 // GENERATED_JAVA_PREFIX_TO_STRIP: SPEECH_RECOGNITION_ERROR_ | |
13 enum SpeechRecognitionErrorCode { | 10 enum SpeechRecognitionErrorCode { |
14 // There was no error. | 11 #define DEFINE_SPEECH_RECOGNITION_ERROR(x, y) SPEECH_RECOGNITION_ERROR_##x = y, |
15 SPEECH_RECOGNITION_ERROR_NONE, | 12 #include "content/public/common/speech_recognition_error_list.h" |
16 | 13 #undef DEFINE_SPEECH_RECOGNITION_ERROR |
17 // The user or a script aborted speech input. | |
18 SPEECH_RECOGNITION_ERROR_ABORTED, | |
19 | |
20 // There was an error with recording audio. | |
21 SPEECH_RECOGNITION_ERROR_AUDIO, | |
22 | |
23 // There was a network error. | |
24 SPEECH_RECOGNITION_ERROR_NETWORK, | |
25 | |
26 // Not allowed for privacy or security reasons. | |
27 SPEECH_RECOGNITION_ERROR_NOT_ALLOWED, | |
28 | |
29 // No speech heard before timeout. | |
30 SPEECH_RECOGNITION_ERROR_NO_SPEECH, | |
31 | |
32 // Speech was heard, but could not be interpreted. | |
33 SPEECH_RECOGNITION_ERROR_NO_MATCH, | |
34 | |
35 // There was an error in the speech recognition grammar. | |
36 SPEECH_RECOGNITION_ERROR_BAD_GRAMMAR, | |
37 SPEECH_RECOGNITION_ERROR_LAST = SPEECH_RECOGNITION_ERROR_BAD_GRAMMAR, | |
38 }; | 14 }; |
39 | 15 |
40 // Error details for the SPEECH_RECOGNITION_ERROR_AUDIO error. | 16 // Error details for the SPEECH_RECOGNITION_ERROR_AUDIO error. |
41 enum SpeechAudioErrorDetails { | 17 enum SpeechAudioErrorDetails { |
42 SPEECH_AUDIO_ERROR_DETAILS_NONE = 0, | 18 SPEECH_AUDIO_ERROR_DETAILS_NONE = 0, |
43 SPEECH_AUDIO_ERROR_DETAILS_NO_MIC, | 19 SPEECH_AUDIO_ERROR_DETAILS_NO_MIC, |
44 SPEECH_AUDIO_ERROR_DETAILS_LAST = SPEECH_AUDIO_ERROR_DETAILS_NO_MIC | 20 SPEECH_AUDIO_ERROR_DETAILS_LAST = SPEECH_AUDIO_ERROR_DETAILS_NO_MIC |
45 }; | 21 }; |
46 | 22 |
47 struct CONTENT_EXPORT SpeechRecognitionError { | 23 struct CONTENT_EXPORT SpeechRecognitionError { |
(...skipping 11 matching lines...) Expand all Loading... |
59 SpeechRecognitionError(SpeechRecognitionErrorCode code_value, | 35 SpeechRecognitionError(SpeechRecognitionErrorCode code_value, |
60 SpeechAudioErrorDetails details_value) | 36 SpeechAudioErrorDetails details_value) |
61 : code(code_value), | 37 : code(code_value), |
62 details(details_value) { | 38 details(details_value) { |
63 } | 39 } |
64 }; | 40 }; |
65 | 41 |
66 } // namespace content | 42 } // namespace content |
67 | 43 |
68 #endif // CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_ERROR_H_ | 44 #endif // CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_ERROR_H_ |
OLD | NEW |