Home | History | Annotate | Download | only in common
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_ERROR_H_
      6 #define CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_ERROR_H_
      7 
      8 namespace content {
      9 
     10 enum SpeechRecognitionErrorCode {
     11 #define DEFINE_SPEECH_RECOGNITION_ERROR(x, y) SPEECH_RECOGNITION_ERROR_##x = y,
     12 #include "content/public/common/speech_recognition_error_list.h"
     13 #undef DEFINE_SPEECH_RECOGNITION_ERROR
     14 };
     15 
     16 // Error details for the SPEECH_RECOGNITION_ERROR_AUDIO error.
     17 enum SpeechAudioErrorDetails {
     18   SPEECH_AUDIO_ERROR_DETAILS_NONE = 0,
     19   SPEECH_AUDIO_ERROR_DETAILS_NO_MIC
     20 };
     21 
     22 struct CONTENT_EXPORT SpeechRecognitionError {
     23   SpeechRecognitionErrorCode code;
     24   SpeechAudioErrorDetails details;
     25 
     26   SpeechRecognitionError()
     27       : code(SPEECH_RECOGNITION_ERROR_NONE),
     28         details(SPEECH_AUDIO_ERROR_DETAILS_NONE) {
     29   }
     30   explicit SpeechRecognitionError(SpeechRecognitionErrorCode code_value)
     31       : code(code_value),
     32         details(SPEECH_AUDIO_ERROR_DETAILS_NONE) {
     33   }
     34   SpeechRecognitionError(SpeechRecognitionErrorCode code_value,
     35                          SpeechAudioErrorDetails details_value)
     36       : code(code_value),
     37         details(details_value) {
     38   }
     39 };
     40 
     41 }  // namespace content
     42 
     43 #endif  // CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_ERROR_H_
     44